101 std::vector<MSG_PANEL_ITEM>& aList )
106 if( dataItem ==
nullptr )
113 aList.emplace_back(
_(
"Line" ), wxEmptyString );
117 aList.emplace_back(
_(
"Rectangle" ), wxEmptyString );
121 aList.emplace_back(
_(
"Text" ),
static_cast<DS_DRAW_ITEM_TEXT*
>(
this )->GetShownText() );
125 aList.emplace_back(
_(
"Imported Shape" ), wxEmptyString );
129 aList.emplace_back(
_(
"Image" ), wxEmptyString );
137 default: msg =
_(
"All Pages" );
break;
140 aList.emplace_back(
_(
"First Page Option" ), msg );
144 aList.emplace_back(
_(
"Repeat Count" ), msg );
148 aList.emplace_back(
_(
"Repeat Label Increment" ), msg );
150 msg.Printf( wxT(
"(%s, %s)" ),
154 aList.emplace_back(
_(
"Repeat Position Increment" ), msg );
156 aList.emplace_back(
_(
"Comment" ), dataItem->
m_Info );
166 if(
color == COLOR4D::UNSPECIFIED )
206 std::vector<VECTOR2I> 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( DC, points_moved.size(), &points_moved[0],
true, penWidth,
color,
color );
265 for(
int ii = 0; ii < outline.
PointCount(); ii++ )
288 return _(
"Imported Shape" );
410 int mindist = aAccuracy + (
GetPenWidth() / 2 ) + 1;
474 return _(
"Page Limits" );
514 wsItem->SyncDrawItems(
this,
nullptr );
527 std::vector<DS_DRAW_ITEM_BASE*> second_items;
532 item->PrintWsItem( aSettings );
534 second_items.push_back( item );
538 item->PrintWsItem( aSettings );
constexpr EDA_IU_SCALE unityScale
void DrawBitmap(wxDC *aDC, const VECTOR2I &aPos)
void SetOrigin(const Vec &pos)
void SetX(coord_type val)
bool Intersects(const BOX2< Vec > &aRect) const
void SetY(coord_type val)
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
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.
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.
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,...
COLOR4D GetTextColor() const
virtual bool TextHitTest(const VECTOR2I &aPoint, int aAccuracy=0) const
Test if aPoint is within the bounds of this object.
virtual wxString GetShownText(int aDepth=0, bool aAllowExtraText=true) 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.
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.
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)
int OutlineCount() const
Return the number of vertices in a given outline/hole.
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.
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
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.
EDA_ANGLE abs(const EDA_ANGLE &aAngle)
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, const CPTREE &aTree)
Output a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
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)