106 if( dataItem ==
nullptr )
121 msg = static_cast<DS_DRAW_ITEM_TEXT*>(
this )->GetShownText();
138 default: msg =
_(
"All Pages" );
break;
147 aList.push_back(
MSG_PANEL_ITEM(
_(
"Repeat Label Increment" ), msg ) );
149 msg.Printf( wxT(
"(%s, %s)" ),
153 aList.push_back(
MSG_PANEL_ITEM(
_(
"Repeat Position Increment" ), msg ) );
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.
for drawingsheetEditor previewing
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 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.
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.
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 GRPoly(EDA_RECT *ClipBox, wxDC *DC, int n, const wxPoint *Points, bool Fill, int width, COLOR4D Color, COLOR4D BgColor)
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()
static LIB_PART * dummy()
Used to draw a dummy shape when a LIB_PART is not found in library.
const EDA_RECT GetBoundingBox() const override
Return the orthogonal bounding box of this object for display purposes.
const wxString & GetType() const
The base class for create windows for drawing purpose.
int PointCount() const
Function PointCount()
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...
bool TestSegmentHit(const wxPoint &aRefPoint, wxPoint aStart, wxPoint aEnd, int aDist)
Test if aRefPoint is with aDistance on the line defined by aStart and aEnd.
bool HitTest(const wxPoint &aPosition, int aAccuracy=0) const override
Test if aPosition is contained within or on the bounding box of an item.
Base class to handle basic graphic items.
const VECTOR2I & CPoint(int aIndex) const
Function Point()
void GRRect(EDA_RECT *aClipBox, wxDC *aDC, int x1, int y1, int x2, int y2, COLOR4D aColor)
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
for drawingsheetEditor previewing
void SetTextAngle(double aAngle) 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...
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
wxDC * GetPrintDC() const
void GetMsgPanelInfo(EDA_DRAW_FRAME *aFrame, MSG_PANEL_ITEMS &aList) override
void GRLine(EDA_RECT *ClipBox, wxDC *DC, int x1, int y1, int x2, int y2, int width, COLOR4D Color, wxPenStyle aStyle)
bool HitTest(const wxPoint &aPosition, int aAccuracy=0) const override
Test if aPosition is contained within or on the bounding box of an 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 page layout.
void SetSize(const wxSize &size)
DS_DATA_ITEM * GetPeer() const
void Print(const RENDER_SETTINGS *aSettings, const wxPoint &aOffset, COLOR4D aColor, OUTLINE_MODE aDisplay_mode=FILLED)
Print this text object to the device context aDC.
SHAPE_POLY_SET m_Polygons
The list of polygons.
Board layer functions and definitions.
Drawing sheet structure type definitions.
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 contained within or on the bounding box of an 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.
coord_type GetHeight() const
std::vector< MSG_PANEL_ITEM > MSG_PANEL_ITEMS
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
drawingsheet frame and titleblock
virtual void SetTextAngle(double aAngle)
EDA_MSG_ITEM is used EDA_MSG_PANEL as the item type for displaying messages.
bool HitTest(const wxPoint &aPosition, int aAccuracy=0) const override
Test if aPosition is contained within or on the bounding box of an 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 contained within or on the bounding box of an 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 contained within or on the bounding box of an item.
void SetPosition(const wxPoint &aPos) override