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 (C) 1992-2023 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 // We can't cache bounding boxes because we're recreated for each draw event. This method
88 // can be overridden by items whose real bounding boxes are expensive to calculate. It is
89 // used to determine if we're in the current view, so it can be sloppy.
90 virtual const BOX2I GetApproxBBox()
91 {
92 return GetBoundingBox();
93 }
94
95 // Derived types must define GetBoundingBox() as a minimum, and can then override the
96 // two HitTest() functions if they need something more specific.
97 const BOX2I GetBoundingBox() const override = 0;
98
99 bool HitTest( const VECTOR2I& aPosition, int aAccuracy = 0 ) const override
100 {
101 // This is just here to prevent annoying compiler warnings about hidden overloaded
102 // virtual functions
103 return EDA_ITEM::HitTest( aPosition, aAccuracy );
104 }
105
106 bool HitTest( const BOX2I& aRect, bool aContained, int aAccuracy = 0 ) const override;
107
108 void GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList ) override;
109
110protected:
111 DS_DRAW_ITEM_BASE( DS_DATA_ITEM* aPeer, int aIndex, KICAD_T aType ) :
112 EDA_ITEM( aType )
113 {
114 m_peer = aPeer;
115 m_index = aIndex;
116 m_penWidth = 0;
117 m_flags = 0;
118 }
119
120protected:
121 DS_DATA_ITEM* m_peer; // the parent DS_DATA_ITEM item in the DS_DATA_MODEL
122 int m_index; // the index in the parent's repeat count
124};
125
126
127// This class draws a thick segment
129{
130public:
131 DS_DRAW_ITEM_LINE( DS_DATA_ITEM* aPeer, int aIndex, VECTOR2I aStart, VECTOR2I aEnd,
132 int aPenWidth ) :
133 DS_DRAW_ITEM_BASE( aPeer, aIndex, WSG_LINE_T )
134 {
135 m_start = aStart;
136 m_end = aEnd;
137 m_penWidth = aPenWidth;
138 }
139
140 virtual wxString GetClass() const override { return wxT( "DS_DRAW_ITEM_LINE" ); }
141
142 const VECTOR2I& GetStart() const { return m_start; }
143 void SetStart( const VECTOR2I& aPos ) { m_start = aPos; }
144 const VECTOR2I& GetEnd() const { return m_end; }
145 void SetEnd( const VECTOR2I& aPos ) override { m_end = aPos; }
146
147 VECTOR2I GetPosition() const override { return GetStart(); }
148 void SetPosition( const VECTOR2I& aPos ) override { SetStart( aPos ); }
149
150 const BOX2I GetBoundingBox() const override;
151
152 bool HitTest( const VECTOR2I& aPosition, int aAccuracy = 0 ) const override;
153
154 void PrintWsItem( const RENDER_SETTINGS* aSettings, const VECTOR2I& aOffset ) override;
155
156 wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider ) const override;
157
158#if defined(DEBUG)
159 void Show( int nestLevel, std::ostream& os ) const override { ShowDummy( os ); }
160#endif
161
162private:
163 VECTOR2I m_start; // start point of line/rect
164 VECTOR2I m_end; // end point
165};
166
167
169{
170public:
171 DS_DRAW_ITEM_POLYPOLYGONS( DS_DATA_ITEM* aPeer, int aIndex, VECTOR2I aPos, int aPenWidth ) :
172 DS_DRAW_ITEM_BASE( aPeer, aIndex, WSG_POLY_T )
173 {
174 m_penWidth = aPenWidth;
175 m_pos = aPos;
176 }
177
178 virtual wxString GetClass() const override { return wxT( "DS_DRAW_ITEM_POLYPOLYGONS" ); }
179
181 VECTOR2I GetPosition() const override { return m_pos; }
182 void SetPosition( const VECTOR2I& aPos ) override;
183
184 const BOX2I GetBoundingBox() const override;
185
186 bool HitTest( const VECTOR2I& aPosition, int aAccuracy = 0 ) const override;
187 bool HitTest( const BOX2I& aRect, bool aContained, int aAccuracy = 0 ) const override;
188
189 void PrintWsItem( const RENDER_SETTINGS* aSettings, const VECTOR2I& aOffset ) override;
190
191 wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider ) const override;
192
193#if defined(DEBUG)
194 void Show( int nestLevel, std::ostream& os ) const override { ShowDummy( os ); }
195#endif
196
197public:
205
206private:
207 VECTOR2I m_pos; // position of reference point, from the DS_DATA_ITEM_POLYGONS parent
208 // (used only in drawing sheet editor to draw anchors)
209};
210
211
216{
217public:
218 DS_DRAW_ITEM_RECT( DS_DATA_ITEM* aPeer, int aIndex, VECTOR2I aStart, VECTOR2I aEnd,
219 int aPenWidth ) :
220 DS_DRAW_ITEM_BASE( aPeer, aIndex, WSG_RECT_T )
221 {
222 m_start = aStart;
223 m_end = aEnd;
224 m_penWidth = aPenWidth;
225 }
226
227 virtual wxString GetClass() const override { return wxT( "DS_DRAW_ITEM_RECT" ); }
228
229 const VECTOR2I& GetStart() const { return m_start; }
230 void SetStart( const VECTOR2I& aPos ) { m_start = aPos; }
231 const VECTOR2I& GetEnd() const { return m_end; }
232 void SetEnd( const VECTOR2I& aPos ) override { m_end = aPos; }
233
234 VECTOR2I GetPosition() const override { return GetStart(); }
235 void SetPosition( const VECTOR2I& aPos ) override { SetStart( aPos ); }
236
237 void PrintWsItem( const RENDER_SETTINGS* aSettings, const VECTOR2I& aOffset ) override;
238
239 const BOX2I GetBoundingBox() const override;
240
241 bool HitTest( const VECTOR2I& aPosition, int aAccuracy = 0 ) const override;
242 bool HitTest( const BOX2I& aRect, bool aContained, int aAccuracy = 0 ) const override;
243
244 wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider ) const override;
245
246#if defined(DEBUG)
247 void Show( int nestLevel, std::ostream& os ) const override { ShowDummy( os ); }
248#endif
249
250private:
251 VECTOR2I m_start; // start point of line/rect
252 VECTOR2I m_end; // end point
253};
254
255
264{
265public:
266 DS_DRAW_ITEM_PAGE( int aPenWidth, double aMarkerSize ) :
267 DS_DRAW_ITEM_BASE( nullptr, 0, WSG_PAGE_T )
268 {
269 m_penWidth = aPenWidth;
270 m_markerSize = aMarkerSize;
271 }
272
273 virtual wxString GetClass() const override { return wxT( "DS_DRAW_ITEM_PAGE" ); }
274
275 void SetPageSize( const VECTOR2I& aSize ) { m_pageSize = aSize; }
276 VECTOR2I GetPageSize() const { return m_pageSize; }
277
278 const VECTOR2I& GetMarkerPos() const { return m_markerPos; }
279 void SetMarkerPos( const VECTOR2I& aPos ) { m_markerPos = aPos; }
280
281 double GetMarkerSize() const { return m_markerSize; }
282
283 VECTOR2I GetPosition() const override { return VECTOR2I( 0, 0 ); }
284 void SetPosition( const VECTOR2I& aPos ) override { /* do nothing */ }
285
286 void PrintWsItem( const RENDER_SETTINGS* , const VECTOR2I& ) override { /* do nothing */ }
287
288 const BOX2I GetBoundingBox() const override;
289 bool HitTest( const VECTOR2I& aPosition, int aAccuracy = 0 ) const override { return false; }
290
291 wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider ) const override;
292
293#if defined(DEBUG)
294 void Show( int nestLevel, std::ostream& os ) const override { ShowDummy( os ); }
295#endif
296
297private:
298 VECTOR2I m_markerPos; // position of the marker
299 VECTOR2I m_pageSize; // full size of the page
301};
302
303
311{
312public:
313 DS_DRAW_ITEM_TEXT( DS_DATA_ITEM* aPeer, int aIndex, const wxString& aText, const VECTOR2I& aPos,
314 const VECTOR2I& aSize, int aPenWidth, KIFONT::FONT* aFont,
315 bool aItalic = false, bool aBold = false,
317 DS_DRAW_ITEM_BASE( aPeer, aIndex, WSG_TEXT_T),
318 EDA_TEXT( drawSheetIUScale, aText )
319 {
320 SetTextPos( aPos );
321 SetTextSize( aSize );
322 SetTextThickness( aPenWidth );
323 SetFont( aFont );
324 SetItalic( aItalic );
325 SetBold( aBold );
326 SetTextColor( aColor );
327 }
328
329 virtual wxString GetClass() const override { return wxT( "DS_DRAW_ITEM_TEXT" ); }
330
331 void PrintWsItem( const RENDER_SETTINGS* aSettings, const VECTOR2I& aOffset ) override;
332
333 VECTOR2I GetPosition() const override { return GetTextPos(); }
334 void SetPosition( const VECTOR2I& aPos ) override { SetTextPos( aPos ); }
335
336 virtual const BOX2I GetApproxBBox() override;
337
338 const BOX2I GetBoundingBox() const override;
339
340 bool HitTest( const VECTOR2I& aPosition, int aAccuracy = 0 ) const override;
341 bool HitTest( const BOX2I& aRect, bool aContained, int aAccuracy = 0 ) const override;
342
343 wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider ) const override;
344
345#if defined(DEBUG)
346 void Show( int nestLevel, std::ostream& os ) const override { ShowDummy( os ); }
347#endif
348};
349
350
355{
356public:
357 DS_DRAW_ITEM_BITMAP( DS_DATA_ITEM* aPeer, int aIndex, VECTOR2I aPos ) :
358 DS_DRAW_ITEM_BASE( aPeer, aIndex, WSG_BITMAP_T )
359 {
360 m_pos = aPos;
361 }
362
364
365 virtual wxString GetClass() const override { return wxT( "DS_DRAW_ITEM_BITMAP" ); }
366
367 VECTOR2I GetPosition() const override { return m_pos; }
368 void SetPosition( const VECTOR2I& aPos ) override { m_pos = aPos; }
369
370 void PrintWsItem( const RENDER_SETTINGS* aSettings, const VECTOR2I& aOffset ) override;
371
372 bool HitTest( const VECTOR2I& aPosition, int aAccuracy = 0 ) const override;
373 bool HitTest( const BOX2I& aRect, bool aContained, int aAccuracy = 0 ) const override;
374
375 const BOX2I GetBoundingBox() const override;
376
377 wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider ) const override;
378
379#if defined(DEBUG)
380 void Show( int nestLevel, std::ostream& os ) const override { ShowDummy( os ); }
381#endif
382
383private:
384 VECTOR2I m_pos; // position of reference point
385};
386
387
395{
396public:
398 {
399 m_idx = 0;
400 m_milsToIu = 1.0;
401 m_penSize = 1;
402 m_pageNumber = "1";
403 m_sheetCount = 1;
404 m_titleBlock = nullptr;
405 m_project = nullptr;
406 m_isFirstPage = true;
407 m_properties = nullptr;
408 }
409
411 {
412 // Items in the m_graphicList are owned by their respective DS_DATA_ITEMs.
413 // for( DS_DRAW_ITEM_BASE* item : m_graphicList )
414 // delete item;
415 }
416
417 void SetProject( const PROJECT* aProject ) { m_project = aProject; }
418
422 void SetTitleBlock( const TITLE_BLOCK* aTblock ) { m_titleBlock = aTblock; }
423
427 void SetProperties( const std::map<wxString, wxString>* aProps ) { m_properties = aProps; }
428
432 void SetPaperFormat( const wxString& aFormatName ) { m_paperFormat = aFormatName; }
433
437 void SetFileName( const wxString& aFileName ) { m_fileName = aFileName; }
438
442 void SetSheetName( const wxString& aSheetName ) { m_sheetName = aSheetName; }
443
447 void SetSheetPath( const wxString& aSheetPath ) { m_sheetPath = aSheetPath; }
448
452 void SetSheetLayer( const wxString& aSheetLayer ) { m_sheetLayer = aSheetLayer; }
453
454 void SetDefaultPenSize( int aPenSize ) { m_penSize = aPenSize; }
455 int GetDefaultPenSize() const { return m_penSize; }
456
460 void SetMilsToIUfactor( double aMils2Iu ) { m_milsToIu = aMils2Iu; }
461
465 double GetMilsToIUfactor() { return m_milsToIu; }
466
470 void SetPageNumber( const wxString& aPageNumber ) { m_pageNumber = aPageNumber; }
471
475 void SetIsFirstPage( bool aIsFirstPage ) { m_isFirstPage = aIsFirstPage; }
476
480 void SetSheetCount( int aSheetCount ) { m_sheetCount = aSheetCount; }
481
483 {
484 m_graphicList.push_back( aItem );
485 }
486
488 {
489 auto newEnd = std::remove( m_graphicList.begin(), m_graphicList.end(), aItem );
490 m_graphicList.erase( newEnd, m_graphicList.end() );
491 }
492
494 {
495 m_idx = 0;
496
497 if( m_graphicList.size() )
498 return m_graphicList[0];
499 else
500 return nullptr;
501 }
502
504 {
505 m_idx++;
506
507 if( m_graphicList.size() > m_idx )
508 return m_graphicList[m_idx];
509 else
510 return nullptr;
511 }
512
516 void Print( const RENDER_SETTINGS* aSettings );
517
535 void BuildDrawItemsList( const PAGE_INFO& aPageInfo, const TITLE_BLOCK& aTitleBlock );
536
537 static void GetTextVars( wxArrayString* aVars );
538
543 wxString BuildFullText( const wxString& aTextbase );
544
545protected:
546 std::vector <DS_DRAW_ITEM_BASE*> m_graphicList; // Items to draw/plot
547 unsigned m_idx; // for GetFirst, GetNext functions
548 double m_milsToIu; // the scalar to convert pages units ( mils)
549 // to draw/plot units.
550 int m_penSize; // The default line width for drawings.
551 // used when an item has a pen size = 0
554 // for text variable references, in schematic
555 const TITLE_BLOCK* m_titleBlock; // for text variable references
556 wxString m_paperFormat; // for text variable references
557 wxString m_fileName; // for text variable references
558 wxString m_sheetName; // for text variable references
559 wxString m_sheetPath; // for text variable references
560 wxString m_pageNumber;
561 wxString m_sheetLayer; // for text variable references
562 const PROJECT* m_project; // for project-based text variable references
563
564 const std::map<wxString, wxString>* m_properties; // for text variable references
565};
566
567
568#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:99
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
virtual const BOX2I GetApproxBBox()
Definition: ds_draw_item.h:90
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:111
DS_DATA_ITEM * m_peer
Definition: ds_draw_item.h:121
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:365
VECTOR2I GetPosition() const override
Definition: ds_draw_item.h:367
DS_DRAW_ITEM_BITMAP(DS_DATA_ITEM *aPeer, int aIndex, VECTOR2I aPos)
Definition: ds_draw_item.h:357
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:368
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:140
void SetEnd(const VECTOR2I &aPos) override
Definition: ds_draw_item.h:145
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:143
const VECTOR2I & GetStart() const
Definition: ds_draw_item.h:142
VECTOR2I GetPosition() const override
Definition: ds_draw_item.h:147
DS_DRAW_ITEM_LINE(DS_DATA_ITEM *aPeer, int aIndex, VECTOR2I aStart, VECTOR2I aEnd, int aPenWidth)
Definition: ds_draw_item.h:131
void SetPosition(const VECTOR2I &aPos) override
Definition: ds_draw_item.h:148
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:144
Store the list of graphic items: rect, lines, polygons and texts to draw/plot the title block and fra...
Definition: ds_draw_item.h:395
void SetTitleBlock(const TITLE_BLOCK *aTblock)
Set the title block (mainly for drawing sheet editor)
Definition: ds_draw_item.h:422
int m_sheetCount
The number of sheets.
Definition: ds_draw_item.h:553
DS_DRAW_ITEM_BASE * GetFirst()
Definition: ds_draw_item.h:493
void BuildDrawItemsList(const PAGE_INFO &aPageInfo, const TITLE_BLOCK &aTitleBlock)
Drawing or plot the drawing sheet.
int GetDefaultPenSize() const
Definition: ds_draw_item.h:455
wxString m_sheetPath
Definition: ds_draw_item.h:559
void SetSheetPath(const wxString &aSheetPath)
Set the sheet path to draw/plot.
Definition: ds_draw_item.h:447
static void GetTextVars(wxArrayString *aVars)
Definition: ds_painter.cpp:97
const std::map< wxString, wxString > * m_properties
Definition: ds_draw_item.h:564
void SetFileName(const wxString &aFileName)
Set the filename to draw/plot.
Definition: ds_draw_item.h:437
void SetDefaultPenSize(int aPenSize)
Definition: ds_draw_item.h:454
wxString BuildFullText(const wxString &aTextbase)
Definition: ds_painter.cpp:113
wxString m_sheetLayer
Definition: ds_draw_item.h:561
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:442
wxString m_paperFormat
Definition: ds_draw_item.h:556
void SetIsFirstPage(bool aIsFirstPage)
Set if the page is the first page.
Definition: ds_draw_item.h:475
void SetProperties(const std::map< wxString, wxString > *aProps)
Set properties used for text variable resolution.
Definition: ds_draw_item.h:427
const TITLE_BLOCK * m_titleBlock
Definition: ds_draw_item.h:555
const PROJECT * m_project
Definition: ds_draw_item.h:562
void SetSheetLayer(const wxString &aSheetLayer)
Set the sheet layer to draw/plot.
Definition: ds_draw_item.h:452
void SetSheetCount(int aSheetCount)
Set the value of the count of sheets, for basic inscriptions.
Definition: ds_draw_item.h:480
bool m_isFirstPage
Is this the first page or not.
Definition: ds_draw_item.h:552
void Append(DS_DRAW_ITEM_BASE *aItem)
Definition: ds_draw_item.h:482
void SetPageNumber(const wxString &aPageNumber)
Set the value of the sheet number.
Definition: ds_draw_item.h:470
double GetMilsToIUfactor()
Get the scalar to convert pages units (mils) to draw/plot units.
Definition: ds_draw_item.h:465
std::vector< DS_DRAW_ITEM_BASE * > m_graphicList
Definition: ds_draw_item.h:546
DS_DRAW_ITEM_BASE * GetNext()
Definition: ds_draw_item.h:503
wxString m_pageNumber
The actual page number displayed in the title block.
Definition: ds_draw_item.h:560
void SetMilsToIUfactor(double aMils2Iu)
Set the scalar to convert pages units (mils) to draw/plot units.
Definition: ds_draw_item.h:460
void Remove(DS_DRAW_ITEM_BASE *aItem)
Definition: ds_draw_item.h:487
wxString m_sheetName
Definition: ds_draw_item.h:558
void SetPaperFormat(const wxString &aFormatName)
Set the paper format name (mainly for drawing sheet editor)
Definition: ds_draw_item.h:432
void SetProject(const PROJECT *aProject)
Definition: ds_draw_item.h:417
A rectangle with thick segment showing the page limits and a marker showing the coordinate origin.
Definition: ds_draw_item.h:264
const VECTOR2I & GetMarkerPos() const
Definition: ds_draw_item.h:278
double GetMarkerSize() const
Definition: ds_draw_item.h:281
VECTOR2I m_markerPos
Definition: ds_draw_item.h:298
void SetPageSize(const VECTOR2I &aSize)
Definition: ds_draw_item.h:275
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:289
void SetPosition(const VECTOR2I &aPos) override
Definition: ds_draw_item.h:284
DS_DRAW_ITEM_PAGE(int aPenWidth, double aMarkerSize)
Definition: ds_draw_item.h:266
void PrintWsItem(const RENDER_SETTINGS *, const VECTOR2I &) override
Definition: ds_draw_item.h:286
virtual wxString GetClass() const override
Return the class name.
Definition: ds_draw_item.h:273
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:279
VECTOR2I GetPageSize() const
Definition: ds_draw_item.h:276
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:283
SHAPE_POLY_SET m_Polygons
The list of polygons.
Definition: ds_draw_item.h:204
virtual wxString GetClass() const override
Return the class name.
Definition: ds_draw_item.h:178
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:181
SHAPE_POLY_SET & GetPolygons()
Definition: ds_draw_item.h:180
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:171
Non filled rectangle with thick segment.
Definition: ds_draw_item.h:216
const VECTOR2I & GetEnd() const
Definition: ds_draw_item.h:231
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:229
virtual wxString GetClass() const override
Return the class name.
Definition: ds_draw_item.h:227
VECTOR2I GetPosition() const override
Definition: ds_draw_item.h:234
void PrintWsItem(const RENDER_SETTINGS *aSettings, const VECTOR2I &aOffset) override
void SetEnd(const VECTOR2I &aPos) override
Definition: ds_draw_item.h:232
void SetPosition(const VECTOR2I &aPos) override
Definition: ds_draw_item.h:235
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:218
void SetStart(const VECTOR2I &aPos)
Definition: ds_draw_item.h:230
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:311
void PrintWsItem(const RENDER_SETTINGS *aSettings, const VECTOR2I &aOffset) override
void SetPosition(const VECTOR2I &aPos) override
Definition: ds_draw_item.h:334
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:313
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:329
virtual const BOX2I GetApproxBBox() override
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:333
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:480
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:205
A mix-in class (via multiple inheritance) that handles texts such as labels, parts,...
Definition: eda_text.h:77
void SetTextColor(const COLOR4D &aColor)
Definition: eda_text.h:212
const VECTOR2I & GetTextPos() const
Definition: eda_text.h:216
void SetTextPos(const VECTOR2I &aPoint)
Definition: eda_text.cpp:393
void SetTextThickness(int aWidth)
The TextThickness is that set by the user.
Definition: eda_text.cpp:197
void SetBold(bool aBold)
Definition: eda_text.cpp:221
void SetTextSize(const VECTOR2I &aNewSize)
Definition: eda_text.cpp:359
void SetItalic(bool aItalic)
Definition: eda_text.cpp:213
void SetFont(KIFONT::FONT *aFont)
Definition: eda_text.cpp:343
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:103
static const COLOR4D UNSPECIFIED
For legacy support; used as a value to indicate color hasn't been set yet.
Definition: color4d.h:381
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:212
@ WSG_LINE_T
Definition: typeinfo.h:210
@ WSG_TEXT_T
Definition: typeinfo.h:213
@ WSG_PAGE_T
Definition: typeinfo.h:215
@ WSG_RECT_T
Definition: typeinfo.h:211
@ WSG_BITMAP_T
Definition: typeinfo.h:214
VECTOR2< int > VECTOR2I
Definition: vector2d.h:588