KiCad PCB EDA Suite
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 (C) 1992-2022 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, you may find one here:
19 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
20 * or you may search the http://www.gnu.org website for the version 2 license,
21 * or you may write to the Free Software Foundation, Inc.,
22 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
23 */
24
25#ifndef DS_DRAW_ITEM_H
26#define DS_DRAW_ITEM_H
27
28#include <core/typeinfo.h>
29#include <math/vector2d.h>
30#include <eda_text.h>
31#include "widgets/msgpanel.h"
33#include <eda_item.h>
34#include <eda_units.h>
35
36#include <algorithm>
37#include <vector>
38
39class DS_DATA_ITEM;
40class TITLE_BLOCK;
41class PAGE_INFO;
42class EDA_ITEM;
43class EDA_DRAW_FRAME;
44class PROJECT;
45
59{
60public:
61 virtual ~DS_DRAW_ITEM_BASE() {}
62
63 DS_DATA_ITEM* GetPeer() const { return m_peer; }
64 int GetIndexInPeer() const { return m_index; }
65
66 void ViewGetLayers( int aLayers[], int& aCount ) const override;
67
68 virtual void SetEnd( const VECTOR2I& aPos ) { /* not all types will need this */ }
69
70 virtual int GetPenWidth() const
71 {
72 if( m_penWidth > 0 )
73 return m_penWidth;
74 else
75 return 1;
76 }
77
78 // The function to print a WS_DRAW_ITEM
79 virtual void PrintWsItem( const RENDER_SETTINGS* aSettings )
80 {
81 PrintWsItem( aSettings, VECTOR2I( 0, 0 ) );
82 }
83
84 // More advanced version of DrawWsItem. This is what must be defined in the derived type.
85 virtual void PrintWsItem( const RENDER_SETTINGS* aSettings, const VECTOR2I& aOffset ) = 0;
86
87 // Derived types must define GetBoundingBox() as a minimum, and can then override the
88 // two HitTest() functions if they need something more specific.
89 const BOX2I GetBoundingBox() const override = 0;
90
91 bool HitTest( const VECTOR2I& aPosition, int aAccuracy = 0 ) const override
92 {
93 // This is just here to prevent annoying compiler warnings about hidden overloaded
94 // virtual functions
95 return EDA_ITEM::HitTest( aPosition, aAccuracy );
96 }
97
98 bool HitTest( const BOX2I& aRect, bool aContained, int aAccuracy = 0 ) const override;
99
100 void GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList ) override;
101
102protected:
103 DS_DRAW_ITEM_BASE( DS_DATA_ITEM* aPeer, int aIndex, KICAD_T aType ) :
104 EDA_ITEM( aType )
105 {
106 m_peer = aPeer;
107 m_index = aIndex;
108 m_penWidth = 0;
109 m_flags = 0;
110 }
111
112 DS_DATA_ITEM* m_peer; // the parent DS_DATA_ITEM item in the DS_DATA_MODEL
113 int m_index; // the index in the parent's repeat count
115};
116
117
118// This class draws a thick segment
120{
121public:
122 DS_DRAW_ITEM_LINE( DS_DATA_ITEM* aPeer, int aIndex, VECTOR2I aStart, VECTOR2I aEnd,
123 int aPenWidth ) :
124 DS_DRAW_ITEM_BASE( aPeer, aIndex, WSG_LINE_T )
125 {
126 m_start = aStart;
127 m_end = aEnd;
128 m_penWidth = aPenWidth;
129 }
130
131 virtual wxString GetClass() const override { return wxT( "DS_DRAW_ITEM_LINE" ); }
132
133 const VECTOR2I& GetStart() const { return m_start; }
134 void SetStart( const VECTOR2I& aPos ) { m_start = aPos; }
135 const VECTOR2I& GetEnd() const { return m_end; }
136 void SetEnd( const VECTOR2I& aPos ) override { m_end = aPos; }
137
138 VECTOR2I GetPosition() const override { return GetStart(); }
139 void SetPosition( const VECTOR2I& aPos ) override { SetStart( aPos ); }
140
141 const BOX2I GetBoundingBox() const override;
142
143 bool HitTest( const VECTOR2I& aPosition, int aAccuracy = 0 ) const override;
144
145 void PrintWsItem( const RENDER_SETTINGS* aSettings, const VECTOR2I& aOffset ) override;
146
147 wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider ) const override;
148
149#if defined(DEBUG)
150 void Show( int nestLevel, std::ostream& os ) const override { ShowDummy( os ); }
151#endif
152
153private:
154 VECTOR2I m_start; // start point of line/rect
155 VECTOR2I m_end; // end point
156};
157
158
160{
161public:
162 DS_DRAW_ITEM_POLYPOLYGONS( DS_DATA_ITEM* aPeer, int aIndex, VECTOR2I aPos, int aPenWidth ) :
163 DS_DRAW_ITEM_BASE( aPeer, aIndex, WSG_POLY_T )
164 {
165 m_penWidth = aPenWidth;
166 m_pos = aPos;
167 }
168
169 virtual wxString GetClass() const override { return wxT( "DS_DRAW_ITEM_POLYPOLYGONS" ); }
170
172 VECTOR2I GetPosition() const override { return m_pos; }
173 void SetPosition( const VECTOR2I& aPos ) override;
174
175 const BOX2I GetBoundingBox() const override;
176
177 bool HitTest( const VECTOR2I& aPosition, int aAccuracy = 0 ) const override;
178 bool HitTest( const BOX2I& aRect, bool aContained, int aAccuracy = 0 ) const override;
179
180 void PrintWsItem( const RENDER_SETTINGS* aSettings, const VECTOR2I& aOffset ) override;
181
182 wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider ) const override;
183
184#if defined(DEBUG)
185 void Show( int nestLevel, std::ostream& os ) const override { ShowDummy( os ); }
186#endif
187
188public:
196
197
198private:
199 VECTOR2I m_pos; // position of reference point, from the DS_DATA_ITEM_POLYGONS parent
200 // (used only in drawing sheet editor to draw anchors)
201};
202
203
208{
209public:
210 DS_DRAW_ITEM_RECT( DS_DATA_ITEM* aPeer, int aIndex, VECTOR2I aStart, VECTOR2I aEnd,
211 int aPenWidth ) :
212 DS_DRAW_ITEM_BASE( aPeer, aIndex, WSG_RECT_T )
213 {
214 m_start = aStart;
215 m_end = aEnd;
216 m_penWidth = aPenWidth;
217 }
218
219 virtual wxString GetClass() const override { return wxT( "DS_DRAW_ITEM_RECT" ); }
220
221 const VECTOR2I& GetStart() const { return m_start; }
222 void SetStart( const VECTOR2I& aPos ) { m_start = aPos; }
223 const VECTOR2I& GetEnd() const { return m_end; }
224 void SetEnd( const VECTOR2I& aPos ) override { m_end = aPos; }
225
226 VECTOR2I GetPosition() const override { return GetStart(); }
227 void SetPosition( const VECTOR2I& aPos ) override { SetStart( aPos ); }
228
229 void PrintWsItem( const RENDER_SETTINGS* aSettings, const VECTOR2I& aOffset ) override;
230
231 const BOX2I GetBoundingBox() const override;
232
233 bool HitTest( const VECTOR2I& aPosition, int aAccuracy = 0 ) const override;
234 bool HitTest( const BOX2I& aRect, bool aContained, int aAccuracy = 0 ) const override;
235
236 wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider ) const override;
237
238#if defined(DEBUG)
239 void Show( int nestLevel, std::ostream& os ) const override { ShowDummy( os ); }
240#endif
241
242private:
243 VECTOR2I m_start; // start point of line/rect
244 VECTOR2I m_end; // end point
245};
246
247
256{
257public:
258 DS_DRAW_ITEM_PAGE( int aPenWidth, double aMarkerSize ) :
259 DS_DRAW_ITEM_BASE( nullptr, 0, WSG_PAGE_T )
260 {
261 m_penWidth = aPenWidth;
262 m_markerSize = aMarkerSize;
263 }
264
265 virtual wxString GetClass() const override { return wxT( "DS_DRAW_ITEM_PAGE" ); }
266
267 void SetPageSize( const VECTOR2I& aSize ) { m_pageSize = aSize; }
268 VECTOR2I GetPageSize() const { return m_pageSize; }
269
270 const VECTOR2I& GetMarkerPos() const { return m_markerPos; }
271 void SetMarkerPos( const VECTOR2I& aPos ) { m_markerPos = aPos; }
272
273 double GetMarkerSize() const { return m_markerSize; }
274
275 VECTOR2I GetPosition() const override { return VECTOR2I( 0, 0 ); }
276 void SetPosition( const VECTOR2I& aPos ) override { /* do nothing */ }
277
278 void PrintWsItem( const RENDER_SETTINGS* , const VECTOR2I& ) override { /* do nothing */ }
279
280 const BOX2I GetBoundingBox() const override;
281 bool HitTest( const VECTOR2I& aPosition, int aAccuracy = 0 ) const override { return false; }
282
283 wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider ) const override;
284
285#if defined(DEBUG)
286 void Show( int nestLevel, std::ostream& os ) const override { ShowDummy( os ); }
287#endif
288
289private:
290 VECTOR2I m_markerPos; // position of the marker
291 VECTOR2I m_pageSize; // full size of the page
293};
294
295
303{
304public:
305 DS_DRAW_ITEM_TEXT( DS_DATA_ITEM* aPeer, int aIndex, const wxString& aText, const VECTOR2I& aPos,
306 const VECTOR2I& aSize, int aPenWidth, KIFONT::FONT* aFont,
307 bool aItalic = false, bool aBold = false,
309 DS_DRAW_ITEM_BASE( aPeer, aIndex, WSG_TEXT_T),
310 EDA_TEXT( drawSheetIUScale, aText )
311 {
312 SetTextPos( aPos );
313 SetTextSize( aSize );
314 SetTextThickness( aPenWidth );
315 SetFont( aFont );
316 SetItalic( aItalic );
317 SetBold( aBold );
318 SetTextColor( aColor );
319 }
320
321 virtual wxString GetClass() const override { return wxT( "DS_DRAW_ITEM_TEXT" ); }
322
323 void PrintWsItem( const RENDER_SETTINGS* aSettings, const VECTOR2I& aOffset ) override;
324
325 VECTOR2I GetPosition() const override { return GetTextPos(); }
326 void SetPosition( const VECTOR2I& aPos ) override { SetTextPos( aPos ); }
327
328 const BOX2I GetBoundingBox() const override;
329
330 bool HitTest( const VECTOR2I& aPosition, int aAccuracy = 0 ) const override;
331 bool HitTest( const BOX2I& aRect, bool aContained, int aAccuracy = 0 ) const override;
332
333 wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider ) const override;
334
335#if defined(DEBUG)
336 void Show( int nestLevel, std::ostream& os ) const override { ShowDummy( os ); }
337#endif
338};
339
340
345{
346public:
347 DS_DRAW_ITEM_BITMAP( DS_DATA_ITEM* aPeer, int aIndex, VECTOR2I aPos ) :
348 DS_DRAW_ITEM_BASE( aPeer, aIndex, WSG_BITMAP_T )
349 {
350 m_pos = aPos;
351 }
352
354
355 virtual wxString GetClass() const override { return wxT( "DS_DRAW_ITEM_BITMAP" ); }
356
357 VECTOR2I GetPosition() const override { return m_pos; }
358 void SetPosition( const VECTOR2I& aPos ) override { m_pos = aPos; }
359
360 void PrintWsItem( const RENDER_SETTINGS* aSettings, const VECTOR2I& aOffset ) override;
361
362 bool HitTest( const VECTOR2I& aPosition, int aAccuracy = 0 ) const override;
363 bool HitTest( const BOX2I& aRect, bool aContained, int aAccuracy = 0 ) const override;
364
365 const BOX2I GetBoundingBox() const override;
366
367 wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider ) const override;
368
369#if defined(DEBUG)
370 void Show( int nestLevel, std::ostream& os ) const override { ShowDummy( os ); }
371#endif
372
373private:
374 VECTOR2I m_pos; // position of reference point
375};
376
377
385{
386public:
388 {
389 m_idx = 0;
390 m_milsToIu = 1.0;
391 m_penSize = 1;
392 m_pageNumber = "1";
393 m_sheetCount = 1;
394 m_titleBlock = nullptr;
395 m_project = nullptr;
396 m_isFirstPage = true;
397 m_properties = nullptr;
398 }
399
401 {
402 // Items in the m_graphicList are owned by their respective DS_DATA_ITEMs.
403 // for( DS_DRAW_ITEM_BASE* item : m_graphicList )
404 // delete item;
405 }
406
407 void SetProject( const PROJECT* aProject ) { m_project = aProject; }
408
412 void SetTitleBlock( const TITLE_BLOCK* aTblock ) { m_titleBlock = aTblock; }
413
417 void SetProperties( const std::map<wxString, wxString>* aProps ) { m_properties = aProps; }
418
422 void SetPaperFormat( const wxString& aFormatName ) { m_paperFormat = aFormatName; }
423
427 void SetFileName( const wxString& aFileName ) { m_fileName = aFileName; }
428
432 void SetSheetName( const wxString& aSheetName ) { m_sheetName = aSheetName; }
433
437 void SetSheetPath( const wxString& aSheetPath ) { m_sheetPath = aSheetPath; }
438
442 void SetSheetLayer( const wxString& aSheetLayer ) { m_sheetLayer = aSheetLayer; }
443
444 void SetDefaultPenSize( int aPenSize ) { m_penSize = aPenSize; }
445 int GetDefaultPenSize() const { return m_penSize; }
446
450 void SetMilsToIUfactor( double aMils2Iu ) { m_milsToIu = aMils2Iu; }
451
455 double GetMilsToIUfactor() { return m_milsToIu; }
456
460 void SetPageNumber( const wxString& aPageNumber ) { m_pageNumber = aPageNumber; }
461
465 void SetIsFirstPage( bool aIsFirstPage ) { m_isFirstPage = aIsFirstPage; }
466
470 void SetSheetCount( int aSheetCount ) { m_sheetCount = aSheetCount; }
471
473 {
474 m_graphicList.push_back( aItem );
475 }
476
478 {
479 auto newEnd = std::remove( m_graphicList.begin(), m_graphicList.end(), aItem );
480 m_graphicList.erase( newEnd, m_graphicList.end() );
481 }
482
484 {
485 m_idx = 0;
486
487 if( m_graphicList.size() )
488 return m_graphicList[0];
489 else
490 return nullptr;
491 }
492
494 {
495 m_idx++;
496
497 if( m_graphicList.size() > m_idx )
498 return m_graphicList[m_idx];
499 else
500 return nullptr;
501 }
502
503 void GetAllItems( std::vector<DS_DRAW_ITEM_BASE*>* aList )
504 {
505 *aList = m_graphicList;
506 }
507
511 void Print( const RENDER_SETTINGS* aSettings );
512
530 void BuildDrawItemsList( const PAGE_INFO& aPageInfo, const TITLE_BLOCK& aTitleBlock );
531
532 static void GetTextVars( wxArrayString* aVars );
533
538 wxString BuildFullText( const wxString& aTextbase );
539
540protected:
541 std::vector <DS_DRAW_ITEM_BASE*> m_graphicList; // Items to draw/plot
542 unsigned m_idx; // for GetFirst, GetNext functions
543 double m_milsToIu; // the scalar to convert pages units ( mils)
544 // to draw/plot units.
545 int m_penSize; // The default line width for drawings.
546 // used when an item has a pen size = 0
549 // for text variable references, in schematic
550 const TITLE_BLOCK* m_titleBlock; // for text variable references
551 wxString m_paperFormat; // for text variable references
552 wxString m_fileName; // for text variable references
553 wxString m_sheetName; // for text variable references
554 wxString m_sheetPath; // for text variable references
555 wxString m_pageNumber;
556 wxString m_sheetLayer; // for text variable references
557 const PROJECT* m_project; // for project-based text variable references
558
559 const std::map<wxString, wxString>* m_properties; // for text variable references
560};
561
562
563#endif // DS_DRAW_ITEM_H
constexpr EDA_IU_SCALE drawSheetIUScale
Definition: base_units.h:110
Drawing sheet structure type definitions.
Definition: ds_data_item.h:96
Base class to handle basic graphic items.
Definition: ds_draw_item.h:59
bool HitTest(const VECTOR2I &aPosition, int aAccuracy=0) const override
Test if aPosition is inside or on the boundary of this item.
Definition: ds_draw_item.h:91
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
Definition: ds_draw_item.h:64
virtual void SetEnd(const VECTOR2I &aPos)
Definition: ds_draw_item.h:68
virtual int GetPenWidth() const
Definition: ds_draw_item.h:70
virtual void PrintWsItem(const RENDER_SETTINGS *aSettings)
Definition: ds_draw_item.h:79
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
Definition: ds_draw_item.h:63
DS_DRAW_ITEM_BASE(DS_DATA_ITEM *aPeer, int aIndex, KICAD_T aType)
Definition: ds_draw_item.h:103
DS_DATA_ITEM * m_peer
Definition: ds_draw_item.h:112
virtual ~DS_DRAW_ITEM_BASE()
Definition: ds_draw_item.h:61
virtual wxString GetClass() const override
Return the class name.
Definition: ds_draw_item.h:355
VECTOR2I GetPosition() const override
Definition: ds_draw_item.h:357
DS_DRAW_ITEM_BITMAP(DS_DATA_ITEM *aPeer, int aIndex, VECTOR2I aPos)
Definition: ds_draw_item.h:347
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.
void SetPosition(const VECTOR2I &aPos) override
Definition: ds_draw_item.h:358
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.
virtual wxString GetClass() const override
Return the class name.
Definition: ds_draw_item.h:131
void SetEnd(const VECTOR2I &aPos) override
Definition: ds_draw_item.h:136
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)
Definition: ds_draw_item.h:134
const VECTOR2I & GetStart() const
Definition: ds_draw_item.h:133
VECTOR2I GetPosition() const override
Definition: ds_draw_item.h:138
DS_DRAW_ITEM_LINE(DS_DATA_ITEM *aPeer, int aIndex, VECTOR2I aStart, VECTOR2I aEnd, int aPenWidth)
Definition: ds_draw_item.h:122
void SetPosition(const VECTOR2I &aPos) override
Definition: ds_draw_item.h:139
wxString GetItemDescription(UNITS_PROVIDER *aUnitsProvider) const override
Return a user-visible description string of this item.
const VECTOR2I & GetEnd() const
Definition: ds_draw_item.h:135
Store the list of graphic items: rect, lines, polygons and texts to draw/plot the title block and fra...
Definition: ds_draw_item.h:385
void SetTitleBlock(const TITLE_BLOCK *aTblock)
Set the title block (mainly for drawing sheet editor)
Definition: ds_draw_item.h:412
int m_sheetCount
The number of sheets.
Definition: ds_draw_item.h:548
DS_DRAW_ITEM_BASE * GetFirst()
Definition: ds_draw_item.h:483
void BuildDrawItemsList(const PAGE_INFO &aPageInfo, const TITLE_BLOCK &aTitleBlock)
Drawing or plot the drawing sheet.
int GetDefaultPenSize() const
Definition: ds_draw_item.h:445
wxString m_sheetPath
Definition: ds_draw_item.h:554
void SetSheetPath(const wxString &aSheetPath)
Set the sheet path to draw/plot.
Definition: ds_draw_item.h:437
static void GetTextVars(wxArrayString *aVars)
Definition: ds_painter.cpp:97
const std::map< wxString, wxString > * m_properties
Definition: ds_draw_item.h:559
void SetFileName(const wxString &aFileName)
Set the filename to draw/plot.
Definition: ds_draw_item.h:427
void SetDefaultPenSize(int aPenSize)
Definition: ds_draw_item.h:444
wxString BuildFullText(const wxString &aTextbase)
Definition: ds_painter.cpp:113
wxString m_sheetLayer
Definition: ds_draw_item.h:556
void GetAllItems(std::vector< DS_DRAW_ITEM_BASE * > *aList)
Definition: ds_draw_item.h:503
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.
Definition: ds_draw_item.h:432
wxString m_paperFormat
Definition: ds_draw_item.h:551
void SetIsFirstPage(bool aIsFirstPage)
Set if the page is the first page.
Definition: ds_draw_item.h:465
void SetProperties(const std::map< wxString, wxString > *aProps)
Set properties used for text variable resolution.
Definition: ds_draw_item.h:417
const TITLE_BLOCK * m_titleBlock
Definition: ds_draw_item.h:550
const PROJECT * m_project
Definition: ds_draw_item.h:557
void SetSheetLayer(const wxString &aSheetLayer)
Set the sheet layer to draw/plot.
Definition: ds_draw_item.h:442
void SetSheetCount(int aSheetCount)
Set the value of the count of sheets, for basic inscriptions.
Definition: ds_draw_item.h:470
bool m_isFirstPage
Is this the first page or not.
Definition: ds_draw_item.h:547
void Append(DS_DRAW_ITEM_BASE *aItem)
Definition: ds_draw_item.h:472
void SetPageNumber(const wxString &aPageNumber)
Set the value of the sheet number.
Definition: ds_draw_item.h:460
double GetMilsToIUfactor()
Get the scalar to convert pages units (mils) to draw/plot units.
Definition: ds_draw_item.h:455
std::vector< DS_DRAW_ITEM_BASE * > m_graphicList
Definition: ds_draw_item.h:541
DS_DRAW_ITEM_BASE * GetNext()
Definition: ds_draw_item.h:493
wxString m_pageNumber
The actual page number displayed in the title block.
Definition: ds_draw_item.h:555
void SetMilsToIUfactor(double aMils2Iu)
Set the scalar to convert pages units (mils) to draw/plot units.
Definition: ds_draw_item.h:450
void Remove(DS_DRAW_ITEM_BASE *aItem)
Definition: ds_draw_item.h:477
wxString m_sheetName
Definition: ds_draw_item.h:553
void SetPaperFormat(const wxString &aFormatName)
Set the paper format name (mainly for drawing sheet editor)
Definition: ds_draw_item.h:422
void SetProject(const PROJECT *aProject)
Definition: ds_draw_item.h:407
A rectangle with thick segment showing the page limits and a marker showing the coordinate origin.
Definition: ds_draw_item.h:256
const VECTOR2I & GetMarkerPos() const
Definition: ds_draw_item.h:270
double GetMarkerSize() const
Definition: ds_draw_item.h:273
VECTOR2I m_markerPos
Definition: ds_draw_item.h:290
void SetPageSize(const VECTOR2I &aSize)
Definition: ds_draw_item.h:267
bool HitTest(const VECTOR2I &aPosition, int aAccuracy=0) const override
Test if aPosition is inside or on the boundary of this item.
Definition: ds_draw_item.h:281
void SetPosition(const VECTOR2I &aPos) override
Definition: ds_draw_item.h:276
DS_DRAW_ITEM_PAGE(int aPenWidth, double aMarkerSize)
Definition: ds_draw_item.h:258
void PrintWsItem(const RENDER_SETTINGS *, const VECTOR2I &) override
Definition: ds_draw_item.h:278
virtual wxString GetClass() const override
Return the class name.
Definition: ds_draw_item.h:265
wxString GetItemDescription(UNITS_PROVIDER *aUnitsProvider) const override
Return a user-visible description string of this item.
void SetMarkerPos(const VECTOR2I &aPos)
Definition: ds_draw_item.h:271
VECTOR2I GetPageSize() const
Definition: ds_draw_item.h:268
const BOX2I GetBoundingBox() const override
Return the orthogonal bounding box of this object for display purposes.
VECTOR2I GetPosition() const override
Definition: ds_draw_item.h:275
SHAPE_POLY_SET m_Polygons
The list of polygons.
Definition: ds_draw_item.h:195
virtual wxString GetClass() const override
Return the class name.
Definition: ds_draw_item.h:169
const BOX2I GetBoundingBox() const override
Return the orthogonal bounding box of this object for display purposes.
VECTOR2I GetPosition() const override
Definition: ds_draw_item.h:172
SHAPE_POLY_SET & GetPolygons()
Definition: ds_draw_item.h:171
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.
DS_DRAW_ITEM_POLYPOLYGONS(DS_DATA_ITEM *aPeer, int aIndex, VECTOR2I aPos, int aPenWidth)
Definition: ds_draw_item.h:162
Non filled rectangle with thick segment.
Definition: ds_draw_item.h:208
const VECTOR2I & GetEnd() const
Definition: ds_draw_item.h:223
const BOX2I GetBoundingBox() const override
Return the orthogonal bounding box of this object for display purposes.
const VECTOR2I & GetStart() const
Definition: ds_draw_item.h:221
virtual wxString GetClass() const override
Return the class name.
Definition: ds_draw_item.h:219
VECTOR2I GetPosition() const override
Definition: ds_draw_item.h:226
void PrintWsItem(const RENDER_SETTINGS *aSettings, const VECTOR2I &aOffset) override
void SetEnd(const VECTOR2I &aPos) override
Definition: ds_draw_item.h:224
void SetPosition(const VECTOR2I &aPos) override
Definition: ds_draw_item.h:227
wxString GetItemDescription(UNITS_PROVIDER *aUnitsProvider) 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)
Definition: ds_draw_item.h:210
void SetStart(const VECTOR2I &aPos)
Definition: ds_draw_item.h:222
bool HitTest(const VECTOR2I &aPosition, int aAccuracy=0) const override
Test if aPosition is inside or on the boundary of this item.
A graphic text.
Definition: ds_draw_item.h:303
void PrintWsItem(const RENDER_SETTINGS *aSettings, const VECTOR2I &aOffset) override
void SetPosition(const VECTOR2I &aPos) override
Definition: ds_draw_item.h:326
DS_DRAW_ITEM_TEXT(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)
Definition: ds_draw_item.h:305
wxString GetItemDescription(UNITS_PROVIDER *aUnitsProvider) const override
Return a user-visible description string of this item.
virtual wxString GetClass() const override
Return the class name.
Definition: ds_draw_item.h:321
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
Definition: ds_draw_item.h:325
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:85
EDA_ITEM_FLAGS m_flags
Definition: eda_item.h:498
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:222
A mix-in class (via multiple inheritance) that handles texts such as labels, parts,...
Definition: eda_text.h:72
void SetTextColor(const COLOR4D &aColor)
Definition: eda_text.h:204
const VECTOR2I & GetTextPos() const
Definition: eda_text.h:208
void SetTextPos(const VECTOR2I &aPoint)
Definition: eda_text.cpp:371
void SetTextThickness(int aWidth)
The TextThickness is that set by the user.
Definition: eda_text.cpp:185
void SetBold(bool aBold)
Definition: eda_text.cpp:209
void SetTextSize(const VECTOR2I &aNewSize)
Definition: eda_text.cpp:347
void SetItalic(bool aItalic)
Definition: eda_text.cpp:201
void SetFont(KIFONT::FONT *aFont)
Definition: eda_text.cpp:331
FONT is an abstract base class for both outline and stroke fonts.
Definition: font.h:105
A color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:104
static const COLOR4D UNSPECIFIED
For legacy support; used as a value to indicate color hasn't been set yet.
Definition: color4d.h:396
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:54
Container for project specific data.
Definition: project.h:64
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:41
Message panel definition file.
KICAD_T
The set of class identification values stored in EDA_ITEM::m_structType.
Definition: typeinfo.h:78
@ WSG_POLY_T
Definition: typeinfo.h:222
@ WSG_LINE_T
Definition: typeinfo.h:220
@ WSG_TEXT_T
Definition: typeinfo.h:223
@ WSG_PAGE_T
Definition: typeinfo.h:225
@ WSG_RECT_T
Definition: typeinfo.h:221
@ WSG_BITMAP_T
Definition: typeinfo.h:224
VECTOR2< int > VECTOR2I
Definition: vector2d.h:618