KiCad PCB EDA Suite
Loading...
Searching...
No Matches
ds_draw_item.h
Go to the documentation of this file.
1/*
2 * This program source code file is part of KiCad, a free EDA CAD application.
3 *
4 * Copyright (C) 2013-2014 Jean-Pierre Charras, jp.charras at wanadoo.fr
5 * Copyright The KiCad Developers, see AUTHORS.txt for contributors.
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version 2
10 * of the License, or (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <https://www.gnu.org/licenses/>.
19 */
20
21#ifndef DS_DRAW_ITEM_H
22#define DS_DRAW_ITEM_H
23
24#include <core/typeinfo.h>
25#include <math/vector2d.h>
26#include <eda_text.h>
27#include "widgets/msgpanel.h"
29#include <eda_item.h>
30#include <eda_units.h>
31
32#include <algorithm>
33#include <vector>
34
35class DS_DATA_ITEM;
36class TITLE_BLOCK;
37class PAGE_INFO;
38class EDA_ITEM;
39class EDA_DRAW_FRAME;
40class PROJECT;
41
55{
56public:
57 virtual ~DS_DRAW_ITEM_BASE() {}
58
59 DS_DATA_ITEM* GetPeer() const { return m_peer; }
60 int GetIndexInPeer() const { return m_index; }
61
62 std::vector<int> ViewGetLayers() const override;
63
64 virtual void SetEnd( const VECTOR2I& aPos ) { /* not all types will need this */ }
65
66 virtual int GetPenWidth() const
67 {
68 if( m_penWidth > 0 )
69 return m_penWidth;
70 else
71 return 1;
72 }
73
74 const KIFONT::METRICS& GetFontMetrics() const;
75
76 // The function to print a WS_DRAW_ITEM
77 virtual void PrintWsItem( const RENDER_SETTINGS* aSettings )
78 {
79 PrintWsItem( aSettings, VECTOR2I( 0, 0 ) );
80 }
81
82 // More advanced version of DrawWsItem. This is what must be defined in the derived type.
83 virtual void PrintWsItem( const RENDER_SETTINGS* aSettings, const VECTOR2I& aOffset ) = 0;
84
85 // We can't cache bounding boxes because we're recreated for each draw event. This method
86 // can be overridden by items whose real bounding boxes are expensive to calculate. It is
87 // used to determine if we're in the current view, so it can be sloppy.
88 virtual const BOX2I GetApproxBBox()
89 {
90 return GetBoundingBox();
91 }
92
93 // Derived types must define GetBoundingBox() as a minimum, and can then override the
94 // two HitTest() functions if they need something more specific.
95 const BOX2I GetBoundingBox() const override = 0;
96
97 bool HitTest( const VECTOR2I& aPosition, int aAccuracy = 0 ) const override
98 {
99 // This is just here to prevent annoying compiler warnings about hidden overloaded
100 // virtual functions
101 return EDA_ITEM::HitTest( aPosition, aAccuracy );
102 }
103
104 bool HitTest( const BOX2I& aRect, bool aContained, int aAccuracy = 0 ) const override;
105
106 void GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList ) override;
107
108protected:
109 DS_DRAW_ITEM_BASE( DS_DATA_ITEM* aPeer, int aIndex, KICAD_T aType ) :
110 EDA_ITEM( aType )
111 {
112 m_peer = aPeer;
113 m_index = aIndex;
114 m_penWidth = 0;
115 m_flags = 0;
116 }
117
118protected:
119 DS_DATA_ITEM* m_peer; // the parent DS_DATA_ITEM item in the DS_DATA_MODEL
120 int m_index; // the index in the parent's repeat count
122};
123
124
125// This class draws a thick segment
127{
128public:
129 DS_DRAW_ITEM_LINE( DS_DATA_ITEM* aPeer, int aIndex, VECTOR2I aStart, VECTOR2I aEnd,
130 int aPenWidth ) :
131 DS_DRAW_ITEM_BASE( aPeer, aIndex, WSG_LINE_T )
132 {
133 m_start = aStart;
134 m_end = aEnd;
135 m_penWidth = aPenWidth;
136 }
137
138 virtual wxString GetClass() const override { return wxT( "DS_DRAW_ITEM_LINE" ); }
139
140 const VECTOR2I& GetStart() const { return m_start; }
141 void SetStart( const VECTOR2I& aPos ) { m_start = aPos; }
142 const VECTOR2I& GetEnd() const { return m_end; }
143 void SetEnd( const VECTOR2I& aPos ) override { m_end = aPos; }
144
145 VECTOR2I GetPosition() const override { return GetStart(); }
146 void SetPosition( const VECTOR2I& aPos ) override { SetStart( aPos ); }
147
148 const BOX2I GetBoundingBox() const override;
149
150 bool HitTest( const VECTOR2I& aPosition, int aAccuracy = 0 ) const override;
151
152 void PrintWsItem( const RENDER_SETTINGS* aSettings, const VECTOR2I& aOffset ) override;
153
154 wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const override;
155
156#if defined(DEBUG)
157 void Show( int nestLevel, std::ostream& os ) const override { ShowDummy( os ); }
158#endif
159
160private:
161 VECTOR2I m_start; // start point of line/rect
162 VECTOR2I m_end; // end point
163};
164
165
167{
168public:
169 DS_DRAW_ITEM_POLYPOLYGONS( DS_DATA_ITEM* aPeer, int aIndex, VECTOR2I aPos, int aPenWidth ) :
170 DS_DRAW_ITEM_BASE( aPeer, aIndex, WSG_POLY_T )
171 {
172 m_penWidth = aPenWidth;
173 m_pos = aPos;
174 }
175
176 virtual wxString GetClass() const override { return wxT( "DS_DRAW_ITEM_POLYPOLYGONS" ); }
177
179 VECTOR2I GetPosition() const override { return m_pos; }
180 void SetPosition( const VECTOR2I& aPos ) override;
181
182 const BOX2I GetBoundingBox() const override;
183
184 bool HitTest( const VECTOR2I& aPosition, int aAccuracy = 0 ) const override;
185 bool HitTest( const BOX2I& aRect, bool aContained, int aAccuracy = 0 ) const override;
186
187 void PrintWsItem( const RENDER_SETTINGS* aSettings, const VECTOR2I& aOffset ) override;
188
189 wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const override;
190
191#if defined(DEBUG)
192 void Show( int nestLevel, std::ostream& os ) const override { ShowDummy( os ); }
193#endif
194
195public:
203
204private:
205 VECTOR2I m_pos; // position of reference point, from the DS_DATA_ITEM_POLYGONS parent
206 // (used only in drawing sheet editor to draw anchors)
207};
208
209
214{
215public:
216 DS_DRAW_ITEM_RECT( DS_DATA_ITEM* aPeer, int aIndex, VECTOR2I aStart, VECTOR2I aEnd,
217 int aPenWidth ) :
218 DS_DRAW_ITEM_BASE( aPeer, aIndex, WSG_RECT_T )
219 {
220 m_start = aStart;
221 m_end = aEnd;
222 m_penWidth = aPenWidth;
223 }
224
225 virtual wxString GetClass() const override { return wxT( "DS_DRAW_ITEM_RECT" ); }
226
227 const VECTOR2I& GetStart() const { return m_start; }
228 void SetStart( const VECTOR2I& aPos ) { m_start = aPos; }
229 const VECTOR2I& GetEnd() const { return m_end; }
230 void SetEnd( const VECTOR2I& aPos ) override { m_end = aPos; }
231
232 VECTOR2I GetPosition() const override { return GetStart(); }
233 void SetPosition( const VECTOR2I& aPos ) override { SetStart( aPos ); }
234
235 void PrintWsItem( const RENDER_SETTINGS* aSettings, const VECTOR2I& aOffset ) override;
236
237 const BOX2I GetBoundingBox() const override;
238
239 bool HitTest( const VECTOR2I& aPosition, int aAccuracy = 0 ) const override;
240 bool HitTest( const BOX2I& aRect, bool aContained, int aAccuracy = 0 ) const override;
241
242 wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const override;
243
244#if defined(DEBUG)
245 void Show( int nestLevel, std::ostream& os ) const override { ShowDummy( os ); }
246#endif
247
248private:
249 VECTOR2I m_start; // start point of line/rect
250 VECTOR2I m_end; // end point
251};
252
253
262{
263public:
264 DS_DRAW_ITEM_PAGE( int aPenWidth, double aMarkerSize ) :
265 DS_DRAW_ITEM_BASE( nullptr, 0, WSG_PAGE_T )
266 {
267 m_penWidth = aPenWidth;
268 m_markerSize = aMarkerSize;
269 }
270
271 virtual wxString GetClass() const override { return wxT( "DS_DRAW_ITEM_PAGE" ); }
272
273 void SetPageSize( const VECTOR2I& aSize ) { m_pageSize = aSize; }
274 VECTOR2I GetPageSize() const { return m_pageSize; }
275
276 const VECTOR2I& GetMarkerPos() const { return m_markerPos; }
277 void SetMarkerPos( const VECTOR2I& aPos ) { m_markerPos = aPos; }
278
279 double GetMarkerSize() const { return m_markerSize; }
280
281 VECTOR2I GetPosition() const override { return VECTOR2I( 0, 0 ); }
282 void SetPosition( const VECTOR2I& aPos ) override { /* do nothing */ }
283
284 void PrintWsItem( const RENDER_SETTINGS* , const VECTOR2I& ) override { /* do nothing */ }
285
286 const BOX2I GetBoundingBox() const override;
287 bool HitTest( const VECTOR2I& aPosition, int aAccuracy = 0 ) const override { return false; }
288
289 wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const override;
290
291#if defined(DEBUG)
292 void Show( int nestLevel, std::ostream& os ) const override { ShowDummy( os ); }
293#endif
294
295private:
296 VECTOR2I m_markerPos; // position of the marker
297 VECTOR2I m_pageSize; // full size of the page
299};
300
301
309{
310public:
311 DS_DRAW_ITEM_TEXT( const EDA_IU_SCALE& aIuScale, DS_DATA_ITEM* aPeer, int aIndex,
312 const wxString& aText, const VECTOR2I& aPos, const VECTOR2I& aSize,
313 int aPenWidth, KIFONT::FONT* aFont,
314 bool aItalic = false, bool aBold = false,
316 DS_DRAW_ITEM_BASE( aPeer, aIndex, WSG_TEXT_T),
317 EDA_TEXT( aIuScale, aText )
318 {
319 SetTextPos( aPos );
320 SetTextSize( aSize );
321 SetTextThickness( aPenWidth );
322 SetFont( aFont );
323 SetItalic( aItalic );
324 SetBold( aBold );
325 SetTextColor( aColor );
326 }
327
328 virtual wxString GetClass() const override { return wxT( "DS_DRAW_ITEM_TEXT" ); }
329
330 void PrintWsItem( const RENDER_SETTINGS* aSettings, const VECTOR2I& aOffset ) override;
331
332 VECTOR2I GetPosition() const override { return GetTextPos(); }
333 void SetPosition( const VECTOR2I& aPos ) override { SetTextPos( aPos ); }
334
335 virtual const BOX2I GetApproxBBox() override;
336
337 const BOX2I GetBoundingBox() const override;
338
339 bool HitTest( const VECTOR2I& aPosition, int aAccuracy = 0 ) const override;
340 bool HitTest( const BOX2I& aRect, bool aContained, int aAccuracy = 0 ) const override;
341
342 wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const override;
343
344#if defined(DEBUG)
345 void Show( int nestLevel, std::ostream& os ) const override { ShowDummy( os ); }
346#endif
347
348protected:
349 const KIFONT::METRICS& getFontMetrics() const override { return GetFontMetrics(); }
350};
351
352
357{
358public:
359 DS_DRAW_ITEM_BITMAP( DS_DATA_ITEM* aPeer, int aIndex, VECTOR2I aPos ) :
360 DS_DRAW_ITEM_BASE( aPeer, aIndex, WSG_BITMAP_T )
361 {
362 m_pos = aPos;
363 }
364
366
367 virtual wxString GetClass() const override { return wxT( "DS_DRAW_ITEM_BITMAP" ); }
368
369 VECTOR2I GetPosition() const override { return m_pos; }
370 void SetPosition( const VECTOR2I& aPos ) override { m_pos = aPos; }
371
372 void PrintWsItem( const RENDER_SETTINGS* aSettings, const VECTOR2I& aOffset ) override;
373
374 bool HitTest( const VECTOR2I& aPosition, int aAccuracy = 0 ) const override;
375 bool HitTest( const BOX2I& aRect, bool aContained, int aAccuracy = 0 ) const override;
376
377 const BOX2I GetBoundingBox() const override;
378
379 wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const override;
380
381#if defined(DEBUG)
382 void Show( int nestLevel, std::ostream& os ) const override { ShowDummy( os ); }
383#endif
384
385private:
386 VECTOR2I m_pos; // position of reference point
387};
388
389
397{
398public:
399 DS_DRAW_ITEM_LIST( const EDA_IU_SCALE& aIuScale, int aFlags = 0 ) :
400 m_iuScale( aIuScale )
401 {
402 m_idx = 0;
403 m_plotterMilsToIu = 0.0;
404 m_penSize = 1;
405 m_pageNumber = "1";
406 m_sheetCount = 1;
407 m_titleBlock = nullptr;
408 m_project = nullptr;
409 m_isFirstPage = true;
410 m_flags = aFlags;
411 m_properties = nullptr;
412 }
413
415 {
416 // Items in the m_graphicList are owned by their respective DS_DATA_ITEMs.
417 // for( DS_DRAW_ITEM_BASE* item : m_graphicList )
418 // delete item;
419 }
420
421 void SetProject( const PROJECT* aProject ) { m_project = aProject; }
422
426 void SetTitleBlock( const TITLE_BLOCK* aTblock ) { m_titleBlock = aTblock; }
427
431 void SetProperties( const std::map<wxString, wxString>* aProps ) { m_properties = aProps; }
432
436 void SetPaperFormat( const wxString& aFormatName ) { m_paperFormat = aFormatName; }
437
441 void SetFileName( const wxString& aFileName ) { m_fileName = aFileName; }
442
446 void SetSheetName( const wxString& aSheetName ) { m_sheetName = aSheetName; }
447
451 void SetSheetPath( const wxString& aSheetPath ) { m_sheetPath = aSheetPath; }
452
456 void SetSheetLayer( const wxString& aSheetLayer ) { m_sheetLayer = aSheetLayer; }
457
461 void SetVariantName( const wxString& aVariant ) { m_variantName = aVariant; }
462 void SetVariantDesc( const wxString& aDesc ) { m_variantDesc = aDesc; }
463
464 void SetDefaultPenSize( int aPenSize ) { m_penSize = aPenSize; }
465 int GetDefaultPenSize() const { return m_penSize; }
466
470 void SetPlotterMilsToIUfactor( double aMils2Iu ) { m_plotterMilsToIu = aMils2Iu; }
471
479 {
480 if( m_plotterMilsToIu > 0.0 )
481 return m_plotterMilsToIu;
482 else
483 return m_iuScale.IU_PER_MILS;
484 }
485
486 const EDA_IU_SCALE& GetIuScale() const { return m_iuScale; }
487
491 void SetPageNumber( const wxString& aPageNumber ) { m_pageNumber = aPageNumber; }
492
496 void SetIsFirstPage( bool aIsFirstPage ) { m_isFirstPage = aIsFirstPage; }
497
501 void SetSheetCount( int aSheetCount ) { m_sheetCount = aSheetCount; }
502
504 {
505 m_graphicList.push_back( aItem );
506 }
507
509 {
510 auto newEnd = std::remove( m_graphicList.begin(), m_graphicList.end(), aItem );
511 m_graphicList.erase( newEnd, m_graphicList.end() );
512 }
513
515 {
516 m_idx = 0;
517
518 if( m_graphicList.size() )
519 return m_graphicList[0];
520 else
521 return nullptr;
522 }
523
525 {
526 m_idx++;
527
528 if( m_graphicList.size() > m_idx )
529 return m_graphicList[m_idx];
530 else
531 return nullptr;
532 }
533
537 void Print( const RENDER_SETTINGS* aSettings );
538
555 void BuildDrawItemsList( const PAGE_INFO& aPageInfo, const TITLE_BLOCK& aTitleBlock );
556
557 static void GetTextVars( wxArrayString* aVars );
558
563 wxString BuildFullText( const wxString& aTextbase );
564
565protected:
566 std::vector <DS_DRAW_ITEM_BASE*> m_graphicList; // Items to draw/plot
567 const EDA_IU_SCALE& m_iuScale; // IU scale for drawing
568 double m_plotterMilsToIu; // IU scale for plotting
569
570 unsigned m_idx; // for GetFirst, GetNext functions
571 int m_penSize; // The default line width for drawings.
572 // used when an item has a pen size = 0
575 // for text variable references, in schematic
576 const TITLE_BLOCK* m_titleBlock; // for text variable references
577 wxString m_paperFormat; // for text variable references
578 wxString m_fileName; // for text variable references
579 wxString m_sheetName; // for text variable references
580 wxString m_sheetPath; // for text variable references
581 wxString m_pageNumber;
582 wxString m_sheetLayer; // for text variable references
583 wxString m_variantName; // for ${VARIANT} text variable reference
584 wxString m_variantDesc; // for ${VARIANT_DESC} text variable reference
585 const PROJECT* m_project; // for project-based text variable references
587
588 const std::map<wxString, wxString>* m_properties; // for text variable references
589};
590
591
592#endif // DS_DRAW_ITEM_H
BOX2< VECTOR2I > BOX2I
Definition box2.h:918
Drawing sheet structure type definitions.
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.
virtual void PrintWsItem(const RENDER_SETTINGS *aSettings, const VECTOR2I &aOffset)=0
const BOX2I GetBoundingBox() const override=0
Return the orthogonal bounding box of this object for display purposes.
int GetIndexInPeer() const
virtual void SetEnd(const VECTOR2I &aPos)
virtual int GetPenWidth() const
virtual void PrintWsItem(const RENDER_SETTINGS *aSettings)
virtual const BOX2I GetApproxBBox()
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
DS_DRAW_ITEM_BASE(DS_DATA_ITEM *aPeer, int aIndex, KICAD_T aType)
const KIFONT::METRICS & GetFontMetrics() const
DS_DATA_ITEM * m_peer
std::vector< int > ViewGetLayers() const override
Return the all the layers within the VIEW the object is painted on.
virtual ~DS_DRAW_ITEM_BASE()
virtual wxString GetClass() const override
Return the class name.
VECTOR2I GetPosition() const override
DS_DRAW_ITEM_BITMAP(DS_DATA_ITEM *aPeer, int aIndex, VECTOR2I aPos)
void PrintWsItem(const RENDER_SETTINGS *aSettings, const VECTOR2I &aOffset) override
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.
wxString GetItemDescription(UNITS_PROVIDER *aUnitsProvider, bool aFull) 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.
virtual wxString GetClass() const override
Return the class name.
void SetEnd(const VECTOR2I &aPos) override
wxString GetItemDescription(UNITS_PROVIDER *aUnitsProvider, bool aFull) 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.
void PrintWsItem(const RENDER_SETTINGS *aSettings, const VECTOR2I &aOffset) override
void SetStart(const VECTOR2I &aPos)
const VECTOR2I & GetStart() const
VECTOR2I GetPosition() const override
DS_DRAW_ITEM_LINE(DS_DATA_ITEM *aPeer, int aIndex, VECTOR2I aStart, VECTOR2I aEnd, int aPenWidth)
void SetPosition(const VECTOR2I &aPos) override
const VECTOR2I & GetEnd() const
void SetPlotterMilsToIUfactor(double aMils2Iu)
Set the scalar to convert pages units (mils) to plot units.
void SetTitleBlock(const TITLE_BLOCK *aTblock)
Set the title block (mainly for drawing sheet editor)
int m_sheetCount
The number of sheets.
DS_DRAW_ITEM_BASE * GetFirst()
void SetVariantName(const wxString &aVariant)
Set the current variant name and description to draw/plot.
void BuildDrawItemsList(const PAGE_INFO &aPageInfo, const TITLE_BLOCK &aTitleBlock)
Drawing or plot the drawing sheet.
int GetDefaultPenSize() const
void SetSheetPath(const wxString &aSheetPath)
Set the sheet path to draw/plot.
static void GetTextVars(wxArrayString *aVars)
const std::map< wxString, wxString > * m_properties
const EDA_IU_SCALE & GetIuScale() const
void SetFileName(const wxString &aFileName)
Set the filename to draw/plot.
void SetDefaultPenSize(int aPenSize)
wxString BuildFullText(const wxString &aTextbase)
void SetVariantDesc(const wxString &aDesc)
void Print(const RENDER_SETTINGS *aSettings)
Draws the item list created by BuildDrawItemsList.
void SetSheetName(const wxString &aSheetName)
Set the sheet name to draw/plot.
void SetIsFirstPage(bool aIsFirstPage)
Set if the page is the first page.
void SetProperties(const std::map< wxString, wxString > *aProps)
Set properties used for text variable resolution.
const TITLE_BLOCK * m_titleBlock
const PROJECT * m_project
void SetSheetLayer(const wxString &aSheetLayer)
Set the sheet layer to draw/plot.
void SetSheetCount(int aSheetCount)
Set the value of the count of sheets, for basic inscriptions.
bool m_isFirstPage
Is this the first page or not.
void Append(DS_DRAW_ITEM_BASE *aItem)
void SetPageNumber(const wxString &aPageNumber)
Set the value of the sheet number.
double GetMilsToIUfactor()
Get the scalar to convert pages units (mils) to draw/plot units.
std::vector< DS_DRAW_ITEM_BASE * > m_graphicList
DS_DRAW_ITEM_BASE * GetNext()
wxString m_pageNumber
The actual page number displayed in the title block.
void Remove(DS_DRAW_ITEM_BASE *aItem)
DS_DRAW_ITEM_LIST(const EDA_IU_SCALE &aIuScale, int aFlags=0)
void SetPaperFormat(const wxString &aFormatName)
Set the paper format name (mainly for drawing sheet editor)
const EDA_IU_SCALE & m_iuScale
void SetProject(const PROJECT *aProject)
const VECTOR2I & GetMarkerPos() const
double GetMarkerSize() const
void SetPageSize(const VECTOR2I &aSize)
bool HitTest(const VECTOR2I &aPosition, int aAccuracy=0) const override
Test if aPosition is inside or on the boundary of this item.
void SetPosition(const VECTOR2I &aPos) override
DS_DRAW_ITEM_PAGE(int aPenWidth, double aMarkerSize)
void PrintWsItem(const RENDER_SETTINGS *, const VECTOR2I &) override
virtual wxString GetClass() const override
Return the class name.
wxString GetItemDescription(UNITS_PROVIDER *aUnitsProvider, bool aFull) const override
Return a user-visible description string of this item.
void SetMarkerPos(const VECTOR2I &aPos)
VECTOR2I GetPageSize() const
const BOX2I GetBoundingBox() const override
Return the orthogonal bounding box of this object for display purposes.
VECTOR2I GetPosition() const override
SHAPE_POLY_SET m_Polygons
The list of polygons.
virtual wxString GetClass() const override
Return the class name.
const BOX2I GetBoundingBox() const override
Return the orthogonal bounding box of this object for display purposes.
VECTOR2I GetPosition() const override
SHAPE_POLY_SET & GetPolygons()
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, bool aFull) const override
Return a user-visible description string of this item.
DS_DRAW_ITEM_POLYPOLYGONS(DS_DATA_ITEM *aPeer, int aIndex, VECTOR2I aPos, int aPenWidth)
const VECTOR2I & GetEnd() const
const BOX2I GetBoundingBox() const override
Return the orthogonal bounding box of this object for display purposes.
const VECTOR2I & GetStart() const
virtual wxString GetClass() const override
Return the class name.
VECTOR2I GetPosition() const override
void PrintWsItem(const RENDER_SETTINGS *aSettings, const VECTOR2I &aOffset) override
void SetEnd(const VECTOR2I &aPos) override
void SetPosition(const VECTOR2I &aPos) override
wxString GetItemDescription(UNITS_PROVIDER *aUnitsProvider, bool aFull) const override
Return a user-visible description string of this item.
DS_DRAW_ITEM_RECT(DS_DATA_ITEM *aPeer, int aIndex, VECTOR2I aStart, VECTOR2I aEnd, int aPenWidth)
void SetStart(const VECTOR2I &aPos)
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
DS_DRAW_ITEM_TEXT(const EDA_IU_SCALE &aIuScale, DS_DATA_ITEM *aPeer, int aIndex, const wxString &aText, const VECTOR2I &aPos, const VECTOR2I &aSize, int aPenWidth, KIFONT::FONT *aFont, bool aItalic=false, bool aBold=false, const KIGFX::COLOR4D &aColor=KIGFX::COLOR4D::UNSPECIFIED)
const KIFONT::METRICS & getFontMetrics() const override
void SetPosition(const VECTOR2I &aPos) override
virtual wxString GetClass() const override
Return the class name.
virtual const BOX2I GetApproxBBox() override
wxString GetItemDescription(UNITS_PROVIDER *aUnitsProvider, bool aFull) 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.
VECTOR2I GetPosition() const override
The base class for create windows for drawing purpose.
A base class for most all the KiCad significant classes used in schematics and boards.
Definition eda_item.h:96
EDA_ITEM_FLAGS m_flags
Definition eda_item.h:542
virtual bool HitTest(const VECTOR2I &aPosition, int aAccuracy=0) const
Test if aPosition is inside or on the boundary of this item.
Definition eda_item.h:243
EDA_ITEM(EDA_ITEM *parent, KICAD_T idType, bool isSCH_ITEM=false, bool isBOARD_ITEM=false)
Definition eda_item.cpp:37
void SetTextColor(const COLOR4D &aColor)
Definition eda_text.h:290
virtual VECTOR2I GetTextPos() const
Definition eda_text.h:294
virtual void SetTextSize(VECTOR2I aNewSize, bool aEnforceMinTextSize=true)
Definition eda_text.cpp:532
virtual void SetTextPos(const VECTOR2I &aPoint)
Definition eda_text.cpp:576
EDA_TEXT(const EDA_IU_SCALE &aIuScale, const wxString &aText=wxEmptyString)
Definition eda_text.cpp:98
virtual void SetTextThickness(int aWidth)
The TextThickness is that set by the user.
Definition eda_text.cpp:279
void SetBold(bool aBold)
Set the text to be bold - this will also update the font if needed.
Definition eda_text.cpp:330
void SetItalic(bool aItalic)
Set the text to be italic - this will also update the font if needed.
Definition eda_text.cpp:302
void SetFont(KIFONT::FONT *aFont)
Definition eda_text.cpp:495
FONT is an abstract base class for both outline and stroke fonts.
Definition font.h:94
A color representation with 4 components: red, green, blue, alpha.
Definition color4d.h:101
static const COLOR4D UNSPECIFIED
For legacy support; used as a value to indicate color hasn't been set yet.
Definition color4d.h:398
Container for all the knowledge about how graphical objects are drawn on any output surface/device.
Describe the page size and margins of a paper page on which to eventually print or plot.
Definition page_info.h:75
Container for project specific data.
Definition project.h:62
Represent a set of closed polygons.
Hold the information shown in the lower right corner of a plot, printout, or editing view.
Definition title_block.h:37
Message panel definition file.
KICAD_T
The set of class identification values stored in EDA_ITEM::m_structType.
Definition typeinfo.h:71
@ WSG_POLY_T
Definition typeinfo.h:215
@ WSG_LINE_T
Definition typeinfo.h:213
@ WSG_TEXT_T
Definition typeinfo.h:216
@ WSG_PAGE_T
Definition typeinfo.h:218
@ WSG_RECT_T
Definition typeinfo.h:214
@ WSG_BITMAP_T
Definition typeinfo.h:217
VECTOR2< int32_t > VECTOR2I
Definition vector2d.h:683