109 std::vector<MSG_PANEL_ITEM>& aList )
114 if( dataItem ==
nullptr )
121 aList.emplace_back(
_(
"Line" ), wxEmptyString );
125 aList.emplace_back(
_(
"Rectangle" ), wxEmptyString );
137 aList.emplace_back(
_(
"Imported Shape" ), wxEmptyString );
141 aList.emplace_back(
_(
"Image" ), wxEmptyString );
149 default: msg =
_(
"All Pages" );
break;
152 aList.emplace_back(
_(
"First Page Option" ), msg );
156 aList.emplace_back(
_(
"Repeat Count" ), msg );
160 aList.emplace_back(
_(
"Repeat Label Increment" ), msg );
162 msg.Printf( wxT(
"(%s, %s)" ),
166 aList.emplace_back(
_(
"Repeat Position Increment" ), msg );
168 aList.emplace_back(
_(
"Comment" ), dataItem->
m_Info );
178 if(
color == COLOR4D::UNSPECIFIED )
249 std::vector<VECTOR2I> points_moved;
253 points_moved.clear();
256 for(
int ii = 0; ii < outline.
PointCount(); ii++ )
258 points_moved.emplace_back( outline.
CPoint( ii ).
x + aOffset.
x,
259 outline.
CPoint( ii ).
y + aOffset.
y );
262 GRPoly( DC, points_moved.size(), &points_moved[0],
true, penWidth,
color,
color );
308 for(
int ii = 0; ii < outline.
PointCount(); ii++ )
331 return _(
"Imported Shape" );
427 return wxString::Format(
_(
"Rectangle, width %s height %s" ),
453 int mindist = aAccuracy + (
GetPenWidth() / 2 ) + 1;
460 return wxString::Format(
_(
"Line, length %s" ),
518 return _(
"Page Limits" );
558 wsItem->SyncDrawItems(
this,
nullptr );
571 std::vector<DS_DRAW_ITEM_BASE*> second_items;
576 item->PrintWsItem( aSettings );
578 second_items.push_back( item );
582 item->PrintWsItem( aSettings );
constexpr EDA_IU_SCALE unityScale
void DrawBitmap(wxDC *aDC, const VECTOR2I &aPos, const KIGFX::COLOR4D &aBackgroundColor=KIGFX::COLOR4D::UNSPECIFIED)
void SetOrigin(const Vec &pos)
void Offset(coord_type dx, coord_type dy)
void SetX(coord_type val)
bool Intersects(const BOX2< Vec > &aRect) const
void SetY(coord_type val)
coord_type GetHeight() const
coord_type GetWidth() const
void SetWidth(coord_type val)
void SetSize(const Vec &size)
bool Contains(const Vec &aPoint) const
BOX2< Vec > & Inflate(coord_type dx, coord_type dy)
Inflates the rectangle horizontally by dx and vertically by dy.
void SetHeight(coord_type val)
BITMAP_BASE * m_ImageBitmap
Drawing sheet structure type definitions.
PAGE_OPTION GetPage1Option() const
DS_ITEM_TYPE GetType() const
VECTOR2D m_IncrementVector
Handle the graphic items list to draw/plot the frame and title block.
void SetupDrawEnvironment(const PAGE_INFO &aPageInfo, double aMilsToIU)
static DS_DATA_MODEL & GetTheInstance()
static function: returns the instance of DS_DATA_MODEL used in the application
unsigned GetCount() const
std::vector< DS_DATA_ITEM * > & GetItems()
bool LoadDrawingSheet(const wxString &aFullFileName=wxEmptyString, bool Append=false)
Populates the list with a custom layout or the default layout if no custom layout is available.
Base class to handle basic graphic items.
bool HitTest(const VECTOR2I &aPosition, int aAccuracy=0) const override
Test if aPosition is inside or on the boundary of this item.
const BOX2I GetBoundingBox() const override=0
Return the orthogonal bounding box of this object for display purposes.
virtual int GetPenWidth() const
void ViewGetLayers(int aLayers[], int &aCount) const override
Return the all the layers within the VIEW the object is painted on.
void GetMsgPanelInfo(EDA_DRAW_FRAME *aFrame, std::vector< MSG_PANEL_ITEM > &aList) override
Populate aList of MSG_PANEL_ITEM objects with it's internal state for display purposes.
DS_DATA_ITEM * GetPeer() const
const KIFONT::METRICS & GetFontMetrics() const
void PrintWsItem(const RENDER_SETTINGS *aSettings, const VECTOR2I &aOffset) override
wxString GetItemDescription(UNITS_PROVIDER *aUnitsProvider) const override
Return a user-visible description string of this item.
bool HitTest(const VECTOR2I &aPosition, int aAccuracy=0) const override
Test if aPosition is inside or on the boundary of this item.
const BOX2I GetBoundingBox() const override
Return the orthogonal bounding box of this object for display purposes.
bool HitTest(const VECTOR2I &aPosition, int aAccuracy=0) const override
Test if aPosition is inside or on the boundary of this item.
const BOX2I GetBoundingBox() const override
Return the orthogonal bounding box of this object for display purposes.
void PrintWsItem(const RENDER_SETTINGS *aSettings, const VECTOR2I &aOffset) override
const VECTOR2I & GetStart() const
wxString GetItemDescription(UNITS_PROVIDER *aUnitsProvider) const override
Return a user-visible description string of this item.
const VECTOR2I & GetEnd() const
DS_DRAW_ITEM_BASE * GetFirst()
void BuildDrawItemsList(const PAGE_INFO &aPageInfo, const TITLE_BLOCK &aTitleBlock)
Drawing or plot the drawing sheet.
void Print(const RENDER_SETTINGS *aSettings)
Draws the item list created by BuildDrawItemsList.
const TITLE_BLOCK * m_titleBlock
bool m_isFirstPage
Is this the first page or not.
double GetMilsToIUfactor()
Get the scalar to convert pages units (mils) to draw/plot units.
DS_DRAW_ITEM_BASE * GetNext()
wxString GetItemDescription(UNITS_PROVIDER *aUnitsProvider) const override
Return a user-visible description string of this item.
const BOX2I GetBoundingBox() const override
Return the orthogonal bounding box of this object for display purposes.
SHAPE_POLY_SET m_Polygons
The list of polygons.
const BOX2I GetBoundingBox() const override
Return the orthogonal bounding box of this object for display purposes.
void SetPosition(const VECTOR2I &aPos) override
bool HitTest(const VECTOR2I &aPosition, int aAccuracy=0) const override
Test if aPosition is inside or on the boundary of this item.
void PrintWsItem(const RENDER_SETTINGS *aSettings, const VECTOR2I &aOffset) override
wxString GetItemDescription(UNITS_PROVIDER *aUnitsProvider) const override
Return a user-visible description string of this item.
const VECTOR2I & GetEnd() const
const BOX2I GetBoundingBox() const override
Return the orthogonal bounding box of this object for display purposes.
const VECTOR2I & GetStart() const
void PrintWsItem(const RENDER_SETTINGS *aSettings, const VECTOR2I &aOffset) override
wxString GetItemDescription(UNITS_PROVIDER *aUnitsProvider) const override
Return a user-visible description string of this item.
bool HitTest(const VECTOR2I &aPosition, int aAccuracy=0) const override
Test if aPosition is inside or on the boundary of this item.
void PrintWsItem(const RENDER_SETTINGS *aSettings, const VECTOR2I &aOffset) override
wxString GetItemDescription(UNITS_PROVIDER *aUnitsProvider) const override
Return a user-visible description string of this item.
virtual const BOX2I GetApproxBBox() override
const BOX2I GetBoundingBox() const override
Return the orthogonal bounding box of this object for display purposes.
bool HitTest(const VECTOR2I &aPosition, int aAccuracy=0) const override
Test if aPosition is inside or on the boundary of this item.
The base class for create windows for drawing purpose.
BOX2I GetTextBox(int aLine=-1, bool aInvertY=false) const
Useful in multiline texts to calculate the full text or a line area (for zones filling,...
const VECTOR2I & GetTextPos() const
COLOR4D GetTextColor() const
virtual const wxString & GetText() const
Return the string associated with the text object.
virtual bool TextHitTest(const VECTOR2I &aPoint, int aAccuracy=0) const
Test if aPoint is within the bounds of this object.
const TEXT_ATTRIBUTES & GetAttributes() const
virtual wxString GetShownText(bool aAllowExtraText, int aDepth=0) const
Return the string actually shown after processing of the base text.
void Print(const RENDER_SETTINGS *aSettings, const VECTOR2I &aOffset, const COLOR4D &aColor, OUTLINE_MODE aDisplay_mode=FILLED)
Print this text object to the device context aDC.
static const METRICS & Default()
A color representation with 4 components: red, green, blue, alpha.
Container for all the knowledge about how graphical objects are drawn on any output surface/device.
int GetDefaultPenWidth() const
const COLOR4D & GetLayerColor(int aLayer) const
Return the color used to draw a layer.
virtual const COLOR4D & GetBackgroundColor() const =0
Return current background color settings.
wxDC * GetPrintDC() const
Describe the page size and margins of a paper page on which to eventually print or plot.
const wxString & GetType() const
Represent a polyline containing arcs as well as line segments: A chain of connected line and/or arc s...
int PointCount() const
Return the number of points (vertices) in this line chain.
const VECTOR2I & CPoint(int aIndex) const
Return a reference to a given point in the line chain.
bool Collide(const SHAPE *aShape, int aClearance=0, int *aActual=nullptr, VECTOR2I *aLocation=nullptr) const override
Check if the boundary of shape (this) lies closer to the shape aShape than aClearance,...
SHAPE_LINE_CHAIN & Outline(int aIndex)
Return the reference to aIndex-th outline in the set.
int OutlineCount() const
Return the number of outlines in the set.
void Move(const VECTOR2I &aVector) override
const SHAPE_LINE_CHAIN & COutline(int aIndex) const
const BOX2I BBox(int aClearance=0) const override
Compute a bounding box of the shape, with a margin of aClearance a collision.
GR_TEXT_H_ALIGN_T m_Halign
Hold the information shown in the lower right corner of a plot, printout, or editing view.
wxString MessageTextFromValue(double aValue, bool aAddUnitLabel=true, EDA_DATA_TYPE aType=EDA_DATA_TYPE::DISTANCE)
A lower-precision version of StringFromValue().
void GRRect(wxDC *DC, const VECTOR2I &aStart, const VECTOR2I &aEnd, int aWidth, const COLOR4D &aColor)
void GRLine(wxDC *DC, int x1, int y1, int x2, int y2, int width, const COLOR4D &Color, wxPenStyle aStyle)
void GRPoly(wxDC *DC, int n, const VECTOR2I *Points, bool Fill, int width, const COLOR4D &Color, const COLOR4D &BgColor)
Draw a new polyline and fill it if Fill, in drawing space.
@ LAYER_DRAWINGSHEET_PAGEn
for drawingsheetEditor previewing
@ LAYER_DRAWINGSHEET
drawingsheet frame and titleblock
@ LAYER_DRAWINGSHEET_PAGE1
for drawingsheetEditor previewing
KICOMMON_API wxString MessageTextFromValue(const EDA_IU_SCALE &aIuScale, EDA_UNITS aUnits, double aValue, bool aAddUnitsText=true, EDA_DATA_TYPE aType=EDA_DATA_TYPE::DISTANCE)
A helper to convert the double length aValue to a string in inches, millimeters, or unscaled units.
wxString EllipsizeMenuText(const wxString &aString)
Ellipsize text (at the end) to be no more than 36 characters.
wxString EllipsizeStatusText(wxWindow *aWindow, const wxString &aString)
Ellipsize text (at the end) to be no more than 1/3 of the window width.
EDA_ANGLE abs(const EDA_ANGLE &aAngle)
std::vector< FAB_LAYER_COLOR > dummy
bool TestSegmentHit(const VECTOR2I &aRefPoint, const VECTOR2I &aStart, const VECTOR2I &aEnd, int aDist)
Test if aRefPoint is with aDistance on the line defined by aStart and aEnd.
double EuclideanNorm(const VECTOR2I &vector)