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 int GetLength() const
146 {
147 return m_start.Distance( m_end );
148 }
149
150 VECTOR2I GetPosition() const override { return GetStart(); }
151 void SetPosition( const VECTOR2I& aPos ) override { SetStart( aPos ); }
152
153 const BOX2I GetBoundingBox() const override;
154
155 bool HitTest( const VECTOR2I& aPosition, int aAccuracy = 0 ) const override;
156
157 void PrintWsItem( const RENDER_SETTINGS* aSettings, const VECTOR2I& aOffset ) override;
158
159 wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const override;
160
161#if defined(DEBUG)
162 void Show( int nestLevel, std::ostream& os ) const override { ShowDummy( os ); }
163#endif
164
165private:
166 VECTOR2I m_start; // start point of line/rect
167 VECTOR2I m_end; // end point
168};
169
170
172{
173public:
174 DS_DRAW_ITEM_POLYPOLYGONS( DS_DATA_ITEM* aPeer, int aIndex, VECTOR2I aPos, int aPenWidth ) :
175 DS_DRAW_ITEM_BASE( aPeer, aIndex, WSG_POLY_T )
176 {
177 m_penWidth = aPenWidth;
178 m_pos = aPos;
179 }
180
181 virtual wxString GetClass() const override { return wxT( "DS_DRAW_ITEM_POLYPOLYGONS" ); }
182
184 VECTOR2I GetPosition() const override { return m_pos; }
185 void SetPosition( const VECTOR2I& aPos ) override;
186
187 const BOX2I GetBoundingBox() const override;
188
189 bool HitTest( const VECTOR2I& aPosition, int aAccuracy = 0 ) const override;
190 bool HitTest( const BOX2I& aRect, bool aContained, int aAccuracy = 0 ) const override;
191
192 void PrintWsItem( const RENDER_SETTINGS* aSettings, const VECTOR2I& aOffset ) override;
193
194 wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const override;
195
196#if defined(DEBUG)
197 void Show( int nestLevel, std::ostream& os ) const override { ShowDummy( os ); }
198#endif
199
200public:
208
209private:
210 VECTOR2I m_pos; // position of reference point, from the DS_DATA_ITEM_POLYGONS parent
211 // (used only in drawing sheet editor to draw anchors)
212};
213
214
219{
220public:
221 DS_DRAW_ITEM_RECT( DS_DATA_ITEM* aPeer, int aIndex, VECTOR2I aStart, VECTOR2I aEnd,
222 int aPenWidth ) :
223 DS_DRAW_ITEM_BASE( aPeer, aIndex, WSG_RECT_T )
224 {
225 m_start = aStart;
226 m_end = aEnd;
227 m_penWidth = aPenWidth;
228 }
229
230 virtual wxString GetClass() const override { return wxT( "DS_DRAW_ITEM_RECT" ); }
231
232 const VECTOR2I& GetStart() const { return m_start; }
233 void SetStart( const VECTOR2I& aPos ) { m_start = aPos; }
234 const VECTOR2I& GetEnd() const { return m_end; }
235 void SetEnd( const VECTOR2I& aPos ) override { m_end = aPos; }
236
237 VECTOR2I GetPosition() const override { return GetStart(); }
238 void SetPosition( const VECTOR2I& aPos ) override { SetStart( aPos ); }
239
240 void PrintWsItem( const RENDER_SETTINGS* aSettings, const VECTOR2I& aOffset ) override;
241
242 const BOX2I GetBoundingBox() const override;
243
244 bool HitTest( const VECTOR2I& aPosition, int aAccuracy = 0 ) const override;
245 bool HitTest( const BOX2I& aRect, bool aContained, int aAccuracy = 0 ) const override;
246
247 wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const override;
248
249#if defined(DEBUG)
250 void Show( int nestLevel, std::ostream& os ) const override { ShowDummy( os ); }
251#endif
252
253private:
254 VECTOR2I m_start; // start point of line/rect
255 VECTOR2I m_end; // end point
256};
257
258
267{
268public:
269 DS_DRAW_ITEM_PAGE( int aPenWidth, double aMarkerSize ) :
270 DS_DRAW_ITEM_BASE( nullptr, 0, WSG_PAGE_T )
271 {
272 m_penWidth = aPenWidth;
273 m_markerSize = aMarkerSize;
274 }
275
276 virtual wxString GetClass() const override { return wxT( "DS_DRAW_ITEM_PAGE" ); }
277
278 void SetPageSize( const VECTOR2I& aSize ) { m_pageSize = aSize; }
279 VECTOR2I GetPageSize() const { return m_pageSize; }
280
281 const VECTOR2I& GetMarkerPos() const { return m_markerPos; }
282 void SetMarkerPos( const VECTOR2I& aPos ) { m_markerPos = aPos; }
283
284 double GetMarkerSize() const { return m_markerSize; }
285
286 VECTOR2I GetPosition() const override { return VECTOR2I( 0, 0 ); }
287 void SetPosition( const VECTOR2I& aPos ) override { /* do nothing */ }
288
289 void PrintWsItem( const RENDER_SETTINGS* , const VECTOR2I& ) override { /* do nothing */ }
290
291 const BOX2I GetBoundingBox() const override;
292 bool HitTest( const VECTOR2I& aPosition, int aAccuracy = 0 ) const override { return false; }
293
294 wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const override;
295
296#if defined(DEBUG)
297 void Show( int nestLevel, std::ostream& os ) const override { ShowDummy( os ); }
298#endif
299
300private:
301 VECTOR2I m_markerPos; // position of the marker
302 VECTOR2I m_pageSize; // full size of the page
304};
305
306
314{
315public:
316 DS_DRAW_ITEM_TEXT( const EDA_IU_SCALE& aIuScale, DS_DATA_ITEM* aPeer, int aIndex,
317 const wxString& aText, const VECTOR2I& aPos, const VECTOR2I& aSize,
318 int aPenWidth, KIFONT::FONT* aFont,
319 bool aItalic = false, bool aBold = false,
321 DS_DRAW_ITEM_BASE( aPeer, aIndex, WSG_TEXT_T),
322 EDA_TEXT( aIuScale, aText )
323 {
324 SetTextPos( aPos );
325 SetTextSize( aSize );
326 SetTextThickness( aPenWidth );
327 SetFont( aFont );
328 SetItalic( aItalic );
329 SetBold( aBold );
330 SetTextColor( aColor );
331 }
332
333 virtual wxString GetClass() const override { return wxT( "DS_DRAW_ITEM_TEXT" ); }
334
335 void PrintWsItem( const RENDER_SETTINGS* aSettings, const VECTOR2I& aOffset ) override;
336
337 VECTOR2I GetPosition() const override { return GetTextPos(); }
338 void SetPosition( const VECTOR2I& aPos ) override { SetTextPos( aPos ); }
339
340 virtual const BOX2I GetApproxBBox() override;
341
342 const BOX2I GetBoundingBox() const override;
343
344 bool HitTest( const VECTOR2I& aPosition, int aAccuracy = 0 ) const override;
345 bool HitTest( const BOX2I& aRect, bool aContained, int aAccuracy = 0 ) const override;
346
347 wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const override;
348
349#if defined(DEBUG)
350 void Show( int nestLevel, std::ostream& os ) const override { ShowDummy( os ); }
351#endif
352
353protected:
354 const KIFONT::METRICS& getFontMetrics() const override { return GetFontMetrics(); }
355};
356
357
362{
363public:
364 DS_DRAW_ITEM_BITMAP( DS_DATA_ITEM* aPeer, int aIndex, VECTOR2I aPos ) :
365 DS_DRAW_ITEM_BASE( aPeer, aIndex, WSG_BITMAP_T )
366 {
367 m_pos = aPos;
368 }
369
371
372 virtual wxString GetClass() const override { return wxT( "DS_DRAW_ITEM_BITMAP" ); }
373
374 VECTOR2I GetPosition() const override { return m_pos; }
375 void SetPosition( const VECTOR2I& aPos ) override { m_pos = aPos; }
376
377 void PrintWsItem( const RENDER_SETTINGS* aSettings, const VECTOR2I& aOffset ) override;
378
379 bool HitTest( const VECTOR2I& aPosition, int aAccuracy = 0 ) const override;
380 bool HitTest( const BOX2I& aRect, bool aContained, int aAccuracy = 0 ) const override;
381
382 const BOX2I GetBoundingBox() const override;
383
384 wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const override;
385
386#if defined(DEBUG)
387 void Show( int nestLevel, std::ostream& os ) const override { ShowDummy( os ); }
388#endif
389
390private:
391 VECTOR2I m_pos; // position of reference point
392};
393
394
402{
403public:
405 m_iuScale( aIuScale ),
406 m_context( aContext )
407 {
408 m_idx = 0;
409 m_plotterMilsToIu = 0.0;
410 m_penSize = 1;
411 m_pageNumber = "1";
412 m_sheetCount = 1;
413 m_titleBlock = nullptr;
414 m_project = nullptr;
415 m_isFirstPage = true;
416 m_properties = nullptr;
417 }
418
420 {
421 // Items in the m_graphicList are owned by their respective DS_DATA_ITEMs.
422 // for( DS_DRAW_ITEM_BASE* item : m_graphicList )
423 // delete item;
424 }
425
426 void SetProject( const PROJECT* aProject ) { m_project = aProject; }
427
431 void SetTitleBlock( const TITLE_BLOCK* aTblock ) { m_titleBlock = aTblock; }
432
436 void SetProperties( const std::map<wxString, wxString>* aProps ) { m_properties = aProps; }
437
441 void SetPaperFormat( const wxString& aFormatName ) { m_paperFormat = aFormatName; }
442
446 void SetFileName( const wxString& aFileName ) { m_fileName = aFileName; }
447
451 void SetSheetName( const wxString& aSheetName ) { m_sheetName = aSheetName; }
452
456 void SetSheetPath( const wxString& aSheetPath ) { m_sheetPath = aSheetPath; }
457
461 void SetSheetLayer( const wxString& aSheetLayer ) { m_sheetLayer = aSheetLayer; }
462
466 void SetVariantName( const wxString& aVariant ) { m_variantName = aVariant; }
467 void SetVariantDesc( const wxString& aDesc ) { m_variantDesc = aDesc; }
468
469 void SetDefaultPenSize( int aPenSize ) { m_penSize = aPenSize; }
470 int GetDefaultPenSize() const { return m_penSize; }
471
475 void SetPlotterMilsToIUfactor( double aMils2Iu ) { m_plotterMilsToIu = aMils2Iu; }
476
484 {
485 if( m_plotterMilsToIu > 0.0 )
486 return m_plotterMilsToIu;
487 else
488 return m_iuScale.IU_PER_MILS;
489 }
490
491 const EDA_IU_SCALE& GetIuScale() const { return m_iuScale; }
492
496 void SetPageNumber( const wxString& aPageNumber ) { m_pageNumber = aPageNumber; }
497
501 void SetIsFirstPage( bool aIsFirstPage ) { m_isFirstPage = aIsFirstPage; }
502
506 void SetSheetCount( int aSheetCount ) { m_sheetCount = aSheetCount; }
507
509 {
510 m_graphicList.push_back( aItem );
511 }
512
514 {
515 auto newEnd = std::remove( m_graphicList.begin(), m_graphicList.end(), aItem );
516 m_graphicList.erase( newEnd, m_graphicList.end() );
517 }
518
520 {
521 m_idx = 0;
522
523 if( m_graphicList.size() )
524 return m_graphicList[0];
525 else
526 return nullptr;
527 }
528
530 {
531 m_idx++;
532
533 if( m_graphicList.size() > m_idx )
534 return m_graphicList[m_idx];
535 else
536 return nullptr;
537 }
538
542 void Print( const RENDER_SETTINGS* aSettings );
543
558 void BuildDrawItemsList( const PAGE_INFO& aPageInfo, const TITLE_BLOCK& aTitleBlock );
559
560 static void GetTextVars( wxArrayString* aVars );
561
566 wxString BuildFullText( const wxString& aTextbase );
567
568protected:
569 std::vector <DS_DRAW_ITEM_BASE*> m_graphicList; // Items to draw/plot
570 const EDA_IU_SCALE& m_iuScale; // IU scale for drawing
571 double m_plotterMilsToIu; // IU scale for plotting
572
573 unsigned m_idx; // for GetFirst, GetNext functions
574 int m_penSize; // The default line width for drawings.
575 // used when an item has a pen size = 0
578 // for text variable references, in schematic
579 const TITLE_BLOCK* m_titleBlock; // for text variable references
580 wxString m_paperFormat; // for text variable references
581 wxString m_fileName; // for text variable references
582 wxString m_sheetName; // for text variable references
583 wxString m_sheetPath; // for text variable references
584 wxString m_pageNumber;
585 wxString m_sheetLayer; // for text variable references
586 wxString m_variantName; // for ${VARIANT} text variable reference
587 wxString m_variantDesc; // for ${VARIANT_DESC} text variable reference
588 const PROJECT* m_project; // for project-based text variable references
590
591 const std::map<wxString, wxString>* m_properties; // for text variable references
592};
593
594
595#endif // DS_DRAW_ITEM_H
BOX2< VECTOR2I > BOX2I
Definition box2.h:914
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.
int GetLength() const
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
RESOLUTION_CONTEXT m_context
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
DS_DRAW_ITEM_LIST(const EDA_IU_SCALE &aIuScale, RESOLUTION_CONTEXT aContext=INTERNAL)
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)
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:98
EDA_ITEM_FLAGS m_flags
Definition eda_item.h:608
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:309
EDA_ITEM(EDA_ITEM *parent, KICAD_T idType, bool isSCH_ITEM=false, bool isBOARD_ITEM=false)
Definition eda_item.cpp:84
void SetTextColor(const COLOR4D &aColor)
Definition eda_text.h:309
virtual VECTOR2I GetTextPos() const
Definition eda_text.h:313
virtual void SetTextSize(VECTOR2I aNewSize, bool aEnforceMinTextSize=true)
Definition eda_text.cpp:512
virtual void SetTextPos(const VECTOR2I &aPoint)
Definition eda_text.cpp:556
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:250
void SetBold(bool aBold)
Set the text to be bold - this will also update the font if needed.
Definition eda_text.cpp:310
void SetItalic(bool aItalic)
Set the text to be italic - this will also update the font if needed.
Definition eda_text.cpp:290
void SetFont(KIFONT::FONT *aFont)
Definition eda_text.cpp:471
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:400
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:63
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:38
RESOLUTION_CONTEXT
Definition common.h:91
@ INTERNAL
Definition common.h:96
Message panel definition file.
KICAD_T
The set of class identification values stored in EDA_ITEM::m_structType.
Definition typeinfo.h:70
@ WSG_POLY_T
Definition typeinfo.h:214
@ WSG_LINE_T
Definition typeinfo.h:212
@ WSG_TEXT_T
Definition typeinfo.h:215
@ WSG_PAGE_T
Definition typeinfo.h:217
@ WSG_RECT_T
Definition typeinfo.h:213
@ WSG_BITMAP_T
Definition typeinfo.h:216
VECTOR2< int32_t > VECTOR2I
Definition vector2d.h:708