102 std::vector<MSG_PANEL_ITEM>& aList )
107 if( dataItem ==
nullptr )
114 aList.emplace_back(
_(
"Line" ), wxEmptyString );
118 aList.emplace_back(
_(
"Rectangle" ), wxEmptyString );
122 aList.emplace_back(
_(
"Text" ), static_cast<DS_DRAW_ITEM_TEXT*>(
this )->GetShownText() );
126 aList.emplace_back(
_(
"Imported Shape" ), wxEmptyString );
130 aList.emplace_back(
_(
"Image" ), wxEmptyString );
138 default: msg =
_(
"All Pages" );
break;
141 aList.emplace_back(
_(
"First Page Option" ), msg );
144 aList.emplace_back(
_(
"Repeat Count" ), msg );
147 aList.emplace_back(
_(
"Repeat Label Increment" ), msg );
149 msg.Printf( wxT(
"(%s, %s)" ),
153 aList.emplace_back(
_(
"Repeat Position Increment" ), msg );
155 aList.emplace_back(
_(
"Comment" ), dataItem->
m_Info );
200 const wxPoint& aOffset )
206 std::vector<wxPoint> points_moved;
210 points_moved.clear();
213 for(
int ii = 0; ii < outline.
PointCount(); ii++ )
215 points_moved.emplace_back( outline.
CPoint( ii ).
x + aOffset.x,
216 outline.
CPoint( ii ).
y + aOffset.y );
219 GRPoly(
nullptr, DC, points_moved.size(), &points_moved[0],
true, penWidth,
228 wxPoint move_vect = aPos -
m_pos;
257 int aAccuracy )
const 275 for(
int ii = 0; ii < outline.
PointCount(); ii++ )
285 wxPoint next_corner( outline.
CPoint( ii_next ).
x, outline.
CPoint( ii_next ).
y );
421 int mindist = aAccuracy + (
GetPenWidth() / 2 ) + 1;
448 auto* bitmap = static_cast<const DS_DATA_ITEM_BITMAP*>(
m_peer );
449 wxSize bm_size = bitmap->m_ImageBitmap->GetSize();
482 return _(
"Page Limits" );
492 dummy.SetSize( wxSize( std::numeric_limits<int>::max(), std::numeric_limits<int>::max() ) );
521 wsItem->SyncDrawItems(
this,
nullptr );
534 std::vector<DS_DRAW_ITEM_BASE*> second_items;
539 item->PrintWsItem( aSettings );
541 second_items.push_back( item );
544 for(
auto item : second_items )
545 item->PrintWsItem( aSettings );
double EuclideanNorm(const wxPoint &vector)
Euclidean norm of a 2D vector.
bool m_isFirstPage
Is this the first page or not.
const EDA_RECT GetBoundingBox() const override
Return the orthogonal bounding box of this object for display purposes.
wxString MessageTextFromValue(EDA_UNITS aUnits, int aValue, bool aAddUnitLabel, EDA_DATA_TYPE aType)
Convert a value to a string using double notation.
Handle the graphic items list to draw/plot the frame and title block.
wxString GetSelectMenuText(EDA_UNITS aUnits) const override
Return the text to display to be used in the selection clarification context menu when multiple items...
int OutlineCount() const
Return the number of vertices in a given outline/hole.
const TITLE_BLOCK * m_titleBlock
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.
Container for all the knowledge about how graphical objects are drawn on any output surface/device.
Implementation of conversion functions that require both schematic and board internal units.
for drawingsheetEditor previewing
void PrintWsItem(const RENDER_SETTINGS *aSettings, const wxPoint &aOffset) override
wxString GetSelectMenuText(EDA_UNITS aUnits) const override
Return the text to display to be used in the selection clarification context menu when multiple items...
void Print(const RENDER_SETTINGS *aSettings, const wxPoint &aOffset, const COLOR4D &aColor, OUTLINE_MODE aDisplay_mode=FILLED)
Print this text object to the device context aDC.
void ViewGetLayers(int aLayers[], int &aCount) const override
Return the all the layers within the VIEW the object is painted on.
EDA_RECT 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 EDA_RECT GetBoundingBox() const override
Return the orthogonal bounding box of this object for display purposes.
const COLOR4D & GetLayerColor(int aLayer) const
Return the color used to draw a layer.
void PrintWsItem(const RENDER_SETTINGS *aSettings, const wxPoint &aOffset) override
void SetOrigin(const wxPoint &pos)
std::vector< DS_DATA_ITEM * > & GetItems()
const EDA_RECT GetBoundingBox() const override
Return the orthogonal bounding box of this object for display purposes.
const wxString & GetType() const
void GRRect(EDA_RECT *ClipBox, wxDC *DC, int x1, int y1, int x2, int y2, int width, const COLOR4D &Color)
The base class for create windows for drawing purpose.
int PointCount() const
Return the number of points (vertices) in this line chain.
Hold the information shown in the lower right corner of a plot, printout, or editing view.
const wxPoint & GetStart() const
const wxPoint & GetStart() const
bool Contains(const wxPoint &aPoint) const
void Print(const RENDER_SETTINGS *aSettings)
Draws the item list created by BuildDrawItemsList.
wxString GetSelectMenuText(EDA_UNITS aUnits) const override
Return the text to display to be used in the selection clarification context menu when multiple items...
static LIB_SYMBOL * dummy()
Used to draw a dummy shape when a LIB_SYMBOL is not found in library.
bool HitTest(const wxPoint &aPosition, int aAccuracy=0) const override
Test if aPosition is inside or on the boundary of this item.
Base class to handle basic graphic items.
const VECTOR2I & CPoint(int aIndex) const
Return a reference to a given point in the line chain.
for drawingsheetEditor previewing
static DS_DATA_MODEL & GetTheInstance()
static function: returns the instance of DS_DATA_MODEL used in the application
DS_ITEM_TYPE GetType() const
DS_DRAW_ITEM_BASE * GetNext()
BITMAP_BASE * m_ImageBitmap
void Move(const VECTOR2I &aVector) override
SHAPE_LINE_CHAIN & Outline(int aIndex)
Describe the page size and margins of a paper page on which to eventually print or plot.
coord_type GetWidth() const
void SetTextAngle(double aAngle) override
bool TestSegmentHit(const wxPoint &aRefPoint, const wxPoint &aStart, const wxPoint &aEnd, int aDist)
Test if aRefPoint is with aDistance on the line defined by aStart and aEnd.
wxString GetSelectMenuText(EDA_UNITS aUnits) const override
Return the text to display to be used in the selection clarification context menu when multiple items...
const EDA_RECT GetBoundingBox() const override
Return the orthogonal bounding box of this object for display purposes.
const EDA_RECT GetBoundingBox() const override
Return the orthogonal bounding box of this object for display purposes.
void PrintWsItem(const RENDER_SETTINGS *aSettings, const wxPoint &aOffset) override
void GRLine(EDA_RECT *ClipBox, wxDC *DC, int x1, int y1, int x2, int y2, int width, const COLOR4D &Color, wxPenStyle aStyle)
wxDC * GetPrintDC() const
drawingsheet frame and titleblock
bool HitTest(const wxPoint &aPosition, int aAccuracy=0) const override
Test if aPosition is inside or on the boundary of this item.
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, const CPTREE &aTree)
Output a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
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,...
void BuildDrawItemsList(const PAGE_INFO &aPageInfo, const TITLE_BLOCK &aTitleBlock)
Drawing or plot the drawing sheet.
void SetSize(const wxSize &size)
DS_DATA_ITEM * GetPeer() const
SHAPE_POLY_SET m_Polygons
The list of polygons.
Drawing sheet structure type definitions.
Represent a polyline containing arcs as well as line segments: A chain of connected line and/or arc s...
const SHAPE_LINE_CHAIN & COutline(int aIndex) const
const wxString * m_paperFormat
void SetupDrawEnvironment(const PAGE_INFO &aPageInfo, double aMilsToIU)
bool HitTest(const wxPoint &aPosition, int aAccuracy=0) const override
Test if aPosition is inside or on the boundary of this item.
Handle the component boundary box.
virtual bool TextHitTest(const wxPoint &aPoint, int aAccuracy=0) const
Test if aPoint is within the bounds of this object.
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.
coord_type GetHeight() const
bool Intersects(const EDA_RECT &aRect) const
Test for a common area between rectangles.
unsigned GetCount() const
void DrawBitmap(wxDC *aDC, const wxPoint &aPos)
wxString GetSelectMenuText(EDA_UNITS aUnits) const override
Return the text to display to be used in the selection clarification context menu when multiple items...
int GetDefaultPenWidth() const
const wxPoint & GetEnd() const
virtual int GetPenWidth() const
virtual void SetTextAngle(double aAngle)
void GRPoly(EDA_RECT *ClipBox, wxDC *DC, int n, const wxPoint *Points, bool Fill, int width, const COLOR4D &Color, const COLOR4D &BgColor)
Draw a new polyline and fill it if Fill, in drawing space.
bool HitTest(const wxPoint &aPosition, int aAccuracy=0) const override
Test if aPosition is inside or on the boundary of this item.
const EDA_RECT GetBoundingBox() const override=0
Return the orthogonal bounding box of this object for display purposes.
T NormalizeAngle360Min(T Angle)
Normalize angle to be > -360.0 and < 360.0 Angle equal to -360 or +360 are set to 0.
DS_DRAW_ITEM_BASE * GetFirst()
bool HitTest(const wxPoint &aPosition, int aAccuracy=0) const override
Test if aPosition is inside or on the boundary of this item.
const BOX2I BBox(int aClearance=0) const override
Compute a bounding box of the shape, with a margin of aClearance a collision.
void PrintWsItem(const RENDER_SETTINGS *aSettings, const wxPoint &aOffset) override
virtual wxString GetShownText(int aDepth=0) const
Return the string actually shown after processing of the base text.
const wxPoint & GetEnd() const
EDA_UNITS GetUserUnits() const
Return the user units currently in use.
EDA_RECT & Inflate(wxCoord dx, wxCoord dy)
Inflate the rectangle horizontally by dx and vertically by dy.
PAGE_OPTION GetPage1Option() const
wxString GetSelectMenuText(EDA_UNITS aUnits) const override
Return the text to display to be used in the selection clarification context menu when multiple items...
void PrintWsItem(const RENDER_SETTINGS *aSettings, const wxPoint &aOffset) override
A color representation with 4 components: red, green, blue, alpha.
const EDA_RECT GetBoundingBox() const override
Return the orthogonal bounding box of this object for display purposes.
bool HitTest(const wxPoint &aPosition, int aAccuracy=0) const override
Test if aPosition is inside or on the boundary of this item.
void SetPosition(const wxPoint &aPos) override