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 std::vector<int> ViewGetLayers() 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 const KIFONT::METRICS& GetFontMetrics() const;
79
80 // The function to print a WS_DRAW_ITEM
81 virtual void PrintWsItem( const RENDER_SETTINGS* aSettings )
82 {
83 PrintWsItem( aSettings, VECTOR2I( 0, 0 ) );
84 }
85
86 // More advanced version of DrawWsItem. This is what must be defined in the derived type.
87 virtual void PrintWsItem( const RENDER_SETTINGS* aSettings, const VECTOR2I& aOffset ) = 0;
88
89 // We can't cache bounding boxes because we're recreated for each draw event. This method
90 // can be overridden by items whose real bounding boxes are expensive to calculate. It is
91 // used to determine if we're in the current view, so it can be sloppy.
92 virtual const BOX2I GetApproxBBox()
93 {
94 return GetBoundingBox();
95 }
96
97 // Derived types must define GetBoundingBox() as a minimum, and can then override the
98 // two HitTest() functions if they need something more specific.
99 const BOX2I GetBoundingBox() const override = 0;
100
101 bool HitTest( const VECTOR2I& aPosition, int aAccuracy = 0 ) const override
102 {
103 // This is just here to prevent annoying compiler warnings about hidden overloaded
104 // virtual functions
105 return EDA_ITEM::HitTest( aPosition, aAccuracy );
106 }
107
108 bool HitTest( const BOX2I& aRect, bool aContained, int aAccuracy = 0 ) const override;
109
110 void GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList ) override;
111
112protected:
113 DS_DRAW_ITEM_BASE( DS_DATA_ITEM* aPeer, int aIndex, KICAD_T aType ) :
114 EDA_ITEM( aType )
115 {
116 m_peer = aPeer;
117 m_index = aIndex;
118 m_penWidth = 0;
119 m_flags = 0;
120 }
121
122protected:
123 DS_DATA_ITEM* m_peer; // the parent DS_DATA_ITEM item in the DS_DATA_MODEL
124 int m_index; // the index in the parent's repeat count
126};
127
128
129// This class draws a thick segment
131{
132public:
133 DS_DRAW_ITEM_LINE( DS_DATA_ITEM* aPeer, int aIndex, VECTOR2I aStart, VECTOR2I aEnd,
134 int aPenWidth ) :
135 DS_DRAW_ITEM_BASE( aPeer, aIndex, WSG_LINE_T )
136 {
137 m_start = aStart;
138 m_end = aEnd;
139 m_penWidth = aPenWidth;
140 }
141
142 virtual wxString GetClass() const override { return wxT( "DS_DRAW_ITEM_LINE" ); }
143
144 const VECTOR2I& GetStart() const { return m_start; }
145 void SetStart( const VECTOR2I& aPos ) { m_start = aPos; }
146 const VECTOR2I& GetEnd() const { return m_end; }
147 void SetEnd( const VECTOR2I& aPos ) override { m_end = aPos; }
148
149 VECTOR2I GetPosition() const override { return GetStart(); }
150 void SetPosition( const VECTOR2I& aPos ) override { SetStart( aPos ); }
151
152 const BOX2I GetBoundingBox() const override;
153
154 bool HitTest( const VECTOR2I& aPosition, int aAccuracy = 0 ) const override;
155
156 void PrintWsItem( const RENDER_SETTINGS* aSettings, const VECTOR2I& aOffset ) override;
157
158 wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const override;
159
160#if defined(DEBUG)
161 void Show( int nestLevel, std::ostream& os ) const override { ShowDummy( os ); }
162#endif
163
164private:
165 VECTOR2I m_start; // start point of line/rect
166 VECTOR2I m_end; // end point
167};
168
169
171{
172public:
173 DS_DRAW_ITEM_POLYPOLYGONS( DS_DATA_ITEM* aPeer, int aIndex, VECTOR2I aPos, int aPenWidth ) :
174 DS_DRAW_ITEM_BASE( aPeer, aIndex, WSG_POLY_T )
175 {
176 m_penWidth = aPenWidth;
177 m_pos = aPos;
178 }
179
180 virtual wxString GetClass() const override { return wxT( "DS_DRAW_ITEM_POLYPOLYGONS" ); }
181
183 VECTOR2I GetPosition() const override { return m_pos; }
184 void SetPosition( const VECTOR2I& aPos ) override;
185
186 const BOX2I GetBoundingBox() const override;
187
188 bool HitTest( const VECTOR2I& aPosition, int aAccuracy = 0 ) const override;
189 bool HitTest( const BOX2I& aRect, bool aContained, int aAccuracy = 0 ) const override;
190
191 void PrintWsItem( const RENDER_SETTINGS* aSettings, const VECTOR2I& aOffset ) override;
192
193 wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const override;
194
195#if defined(DEBUG)
196 void Show( int nestLevel, std::ostream& os ) const override { ShowDummy( os ); }
197#endif
198
199public:
207
208private:
209 VECTOR2I m_pos; // position of reference point, from the DS_DATA_ITEM_POLYGONS parent
210 // (used only in drawing sheet editor to draw anchors)
211};
212
213
218{
219public:
220 DS_DRAW_ITEM_RECT( DS_DATA_ITEM* aPeer, int aIndex, VECTOR2I aStart, VECTOR2I aEnd,
221 int aPenWidth ) :
222 DS_DRAW_ITEM_BASE( aPeer, aIndex, WSG_RECT_T )
223 {
224 m_start = aStart;
225 m_end = aEnd;
226 m_penWidth = aPenWidth;
227 }
228
229 virtual wxString GetClass() const override { return wxT( "DS_DRAW_ITEM_RECT" ); }
230
231 const VECTOR2I& GetStart() const { return m_start; }
232 void SetStart( const VECTOR2I& aPos ) { m_start = aPos; }
233 const VECTOR2I& GetEnd() const { return m_end; }
234 void SetEnd( const VECTOR2I& aPos ) override { m_end = aPos; }
235
236 VECTOR2I GetPosition() const override { return GetStart(); }
237 void SetPosition( const VECTOR2I& aPos ) override { SetStart( aPos ); }
238
239 void PrintWsItem( const RENDER_SETTINGS* aSettings, const VECTOR2I& aOffset ) override;
240
241 const BOX2I GetBoundingBox() const override;
242
243 bool HitTest( const VECTOR2I& aPosition, int aAccuracy = 0 ) const override;
244 bool HitTest( const BOX2I& aRect, bool aContained, int aAccuracy = 0 ) const override;
245
246 wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const override;
247
248#if defined(DEBUG)
249 void Show( int nestLevel, std::ostream& os ) const override { ShowDummy( os ); }
250#endif
251
252private:
253 VECTOR2I m_start; // start point of line/rect
254 VECTOR2I m_end; // end point
255};
256
257
266{
267public:
268 DS_DRAW_ITEM_PAGE( int aPenWidth, double aMarkerSize ) :
269 DS_DRAW_ITEM_BASE( nullptr, 0, WSG_PAGE_T )
270 {
271 m_penWidth = aPenWidth;
272 m_markerSize = aMarkerSize;
273 }
274
275 virtual wxString GetClass() const override { return wxT( "DS_DRAW_ITEM_PAGE" ); }
276
277 void SetPageSize( const VECTOR2I& aSize ) { m_pageSize = aSize; }
278 VECTOR2I GetPageSize() const { return m_pageSize; }
279
280 const VECTOR2I& GetMarkerPos() const { return m_markerPos; }
281 void SetMarkerPos( const VECTOR2I& aPos ) { m_markerPos = aPos; }
282
283 double GetMarkerSize() const { return m_markerSize; }
284
285 VECTOR2I GetPosition() const override { return VECTOR2I( 0, 0 ); }
286 void SetPosition( const VECTOR2I& aPos ) override { /* do nothing */ }
287
288 void PrintWsItem( const RENDER_SETTINGS* , const VECTOR2I& ) override { /* do nothing */ }
289
290 const BOX2I GetBoundingBox() const override;
291 bool HitTest( const VECTOR2I& aPosition, int aAccuracy = 0 ) const override { return false; }
292
293 wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const override;
294
295#if defined(DEBUG)
296 void Show( int nestLevel, std::ostream& os ) const override { ShowDummy( os ); }
297#endif
298
299private:
300 VECTOR2I m_markerPos; // position of the marker
301 VECTOR2I m_pageSize; // full size of the page
303};
304
305
313{
314public:
315 DS_DRAW_ITEM_TEXT( const EDA_IU_SCALE& aIuScale, DS_DATA_ITEM* aPeer, int aIndex,
316 const wxString& aText, const VECTOR2I& aPos, const VECTOR2I& aSize,
317 int aPenWidth, KIFONT::FONT* aFont,
318 bool aItalic = false, bool aBold = false,
320 DS_DRAW_ITEM_BASE( aPeer, aIndex, WSG_TEXT_T),
321 EDA_TEXT( aIuScale, aText )
322 {
323 SetTextPos( aPos );
324 SetTextSize( aSize );
325 SetTextThickness( aPenWidth );
326 SetFont( aFont );
327 SetItalic( aItalic );
328 SetBold( aBold );
329 SetTextColor( aColor );
330 }
331
332 virtual wxString GetClass() const override { return wxT( "DS_DRAW_ITEM_TEXT" ); }
333
334 void PrintWsItem( const RENDER_SETTINGS* aSettings, const VECTOR2I& aOffset ) override;
335
336 VECTOR2I GetPosition() const override { return GetTextPos(); }
337 void SetPosition( const VECTOR2I& aPos ) override { SetTextPos( aPos ); }
338
339 virtual const BOX2I GetApproxBBox() override;
340
341 const BOX2I GetBoundingBox() const override;
342
343 bool HitTest( const VECTOR2I& aPosition, int aAccuracy = 0 ) const override;
344 bool HitTest( const BOX2I& aRect, bool aContained, int aAccuracy = 0 ) const override;
345
346 wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const override;
347
348#if defined(DEBUG)
349 void Show( int nestLevel, std::ostream& os ) const override { ShowDummy( os ); }
350#endif
351
352protected:
353 const KIFONT::METRICS& getFontMetrics() const override { return GetFontMetrics(); }
354};
355
356
361{
362public:
363 DS_DRAW_ITEM_BITMAP( DS_DATA_ITEM* aPeer, int aIndex, VECTOR2I aPos ) :
364 DS_DRAW_ITEM_BASE( aPeer, aIndex, WSG_BITMAP_T )
365 {
366 m_pos = aPos;
367 }
368
370
371 virtual wxString GetClass() const override { return wxT( "DS_DRAW_ITEM_BITMAP" ); }
372
373 VECTOR2I GetPosition() const override { return m_pos; }
374 void SetPosition( const VECTOR2I& aPos ) override { m_pos = aPos; }
375
376 void PrintWsItem( const RENDER_SETTINGS* aSettings, const VECTOR2I& aOffset ) override;
377
378 bool HitTest( const VECTOR2I& aPosition, int aAccuracy = 0 ) const override;
379 bool HitTest( const BOX2I& aRect, bool aContained, int aAccuracy = 0 ) const override;
380
381 const BOX2I GetBoundingBox() const override;
382
383 wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const override;
384
385#if defined(DEBUG)
386 void Show( int nestLevel, std::ostream& os ) const override { ShowDummy( os ); }
387#endif
388
389private:
390 VECTOR2I m_pos; // position of reference point
391};
392
393
401{
402public:
403 DS_DRAW_ITEM_LIST( const EDA_IU_SCALE& aIuScale, int aFlags = 0 ) :
404 m_iuScale( aIuScale )
405 {
406 m_idx = 0;
407 m_plotterMilsToIu = 0.0;
408 m_penSize = 1;
409 m_pageNumber = "1";
410 m_sheetCount = 1;
411 m_titleBlock = nullptr;
412 m_project = nullptr;
413 m_isFirstPage = true;
414 m_flags = aFlags;
415 m_properties = nullptr;
416 }
417
419 {
420 // Items in the m_graphicList are owned by their respective DS_DATA_ITEMs.
421 // for( DS_DRAW_ITEM_BASE* item : m_graphicList )
422 // delete item;
423 }
424
425 void SetProject( const PROJECT* aProject ) { m_project = aProject; }
426
430 void SetTitleBlock( const TITLE_BLOCK* aTblock ) { m_titleBlock = aTblock; }
431
435 void SetProperties( const std::map<wxString, wxString>* aProps ) { m_properties = aProps; }
436
440 void SetPaperFormat( const wxString& aFormatName ) { m_paperFormat = aFormatName; }
441
445 void SetFileName( const wxString& aFileName ) { m_fileName = aFileName; }
446
450 void SetSheetName( const wxString& aSheetName ) { m_sheetName = aSheetName; }
451
455 void SetSheetPath( const wxString& aSheetPath ) { m_sheetPath = aSheetPath; }
456
460 void SetSheetLayer( const wxString& aSheetLayer ) { m_sheetLayer = aSheetLayer; }
461
462 void SetDefaultPenSize( int aPenSize ) { m_penSize = aPenSize; }
463 int GetDefaultPenSize() const { return m_penSize; }
464
468 void SetPlotterMilsToIUfactor( double aMils2Iu ) { m_plotterMilsToIu = aMils2Iu; }
469
477 {
478 if( m_plotterMilsToIu > 0.0 )
479 return m_plotterMilsToIu;
480 else
481 return m_iuScale.IU_PER_MILS;
482 }
483
484 const EDA_IU_SCALE& GetIuScale() const { return m_iuScale; }
485
489 void SetPageNumber( const wxString& aPageNumber ) { m_pageNumber = aPageNumber; }
490
494 void SetIsFirstPage( bool aIsFirstPage ) { m_isFirstPage = aIsFirstPage; }
495
499 void SetSheetCount( int aSheetCount ) { m_sheetCount = aSheetCount; }
500
502 {
503 m_graphicList.push_back( aItem );
504 }
505
507 {
508 auto newEnd = std::remove( m_graphicList.begin(), m_graphicList.end(), aItem );
509 m_graphicList.erase( newEnd, m_graphicList.end() );
510 }
511
513 {
514 m_idx = 0;
515
516 if( m_graphicList.size() )
517 return m_graphicList[0];
518 else
519 return nullptr;
520 }
521
523 {
524 m_idx++;
525
526 if( m_graphicList.size() > m_idx )
527 return m_graphicList[m_idx];
528 else
529 return nullptr;
530 }
531
535 void Print( const RENDER_SETTINGS* aSettings );
536
553 void BuildDrawItemsList( const PAGE_INFO& aPageInfo, const TITLE_BLOCK& aTitleBlock );
554
555 static void GetTextVars( wxArrayString* aVars );
556
561 wxString BuildFullText( const wxString& aTextbase );
562
563protected:
564 std::vector <DS_DRAW_ITEM_BASE*> m_graphicList; // Items to draw/plot
565 const EDA_IU_SCALE& m_iuScale; // IU scale for drawing
566 double m_plotterMilsToIu; // IU scale for plotting
567
568 unsigned m_idx; // for GetFirst, GetNext functions
569 int m_penSize; // The default line width for drawings.
570 // used when an item has a pen size = 0
573 // for text variable references, in schematic
574 const TITLE_BLOCK* m_titleBlock; // for text variable references
575 wxString m_paperFormat; // for text variable references
576 wxString m_fileName; // for text variable references
577 wxString m_sheetName; // for text variable references
578 wxString m_sheetPath; // for text variable references
579 wxString m_pageNumber;
580 wxString m_sheetLayer; // for text variable references
581 const PROJECT* m_project; // for project-based text variable references
583
584 const std::map<wxString, wxString>* m_properties; // for text variable references
585};
586
587
588#endif // DS_DRAW_ITEM_H
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:101
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:81
virtual const BOX2I GetApproxBBox()
Definition: ds_draw_item.h:92
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:113
const KIFONT::METRICS & GetFontMetrics() const
DS_DATA_ITEM * m_peer
Definition: ds_draw_item.h:123
std::vector< int > ViewGetLayers() const override
Return the all the layers within the VIEW the object is painted on.
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:371
VECTOR2I GetPosition() const override
Definition: ds_draw_item.h:373
DS_DRAW_ITEM_BITMAP(DS_DATA_ITEM *aPeer, int aIndex, VECTOR2I aPos)
Definition: ds_draw_item.h:363
void PrintWsItem(const RENDER_SETTINGS *aSettings, const VECTOR2I &aOffset) override
void SetPosition(const VECTOR2I &aPos) override
Definition: ds_draw_item.h:374
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.
Definition: ds_draw_item.h:142
void SetEnd(const VECTOR2I &aPos) override
Definition: ds_draw_item.h:147
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)
Definition: ds_draw_item.h:145
const VECTOR2I & GetStart() const
Definition: ds_draw_item.h:144
VECTOR2I GetPosition() const override
Definition: ds_draw_item.h:149
DS_DRAW_ITEM_LINE(DS_DATA_ITEM *aPeer, int aIndex, VECTOR2I aStart, VECTOR2I aEnd, int aPenWidth)
Definition: ds_draw_item.h:133
void SetPosition(const VECTOR2I &aPos) override
Definition: ds_draw_item.h:150
const VECTOR2I & GetEnd() const
Definition: ds_draw_item.h:146
Store the list of graphic items: rect, lines, polygons and texts to draw/plot the title block and fra...
Definition: ds_draw_item.h:401
void SetPlotterMilsToIUfactor(double aMils2Iu)
Set the scalar to convert pages units (mils) to plot units.
Definition: ds_draw_item.h:468
void SetTitleBlock(const TITLE_BLOCK *aTblock)
Set the title block (mainly for drawing sheet editor)
Definition: ds_draw_item.h:430
int m_sheetCount
The number of sheets.
Definition: ds_draw_item.h:572
DS_DRAW_ITEM_BASE * GetFirst()
Definition: ds_draw_item.h:512
void BuildDrawItemsList(const PAGE_INFO &aPageInfo, const TITLE_BLOCK &aTitleBlock)
Drawing or plot the drawing sheet.
int GetDefaultPenSize() const
Definition: ds_draw_item.h:463
wxString m_sheetPath
Definition: ds_draw_item.h:578
void SetSheetPath(const wxString &aSheetPath)
Set the sheet path to draw/plot.
Definition: ds_draw_item.h:455
static void GetTextVars(wxArrayString *aVars)
Definition: ds_painter.cpp:97
const std::map< wxString, wxString > * m_properties
Definition: ds_draw_item.h:584
const EDA_IU_SCALE & GetIuScale() const
Definition: ds_draw_item.h:484
void SetFileName(const wxString &aFileName)
Set the filename to draw/plot.
Definition: ds_draw_item.h:445
void SetDefaultPenSize(int aPenSize)
Definition: ds_draw_item.h:462
wxString BuildFullText(const wxString &aTextbase)
Definition: ds_painter.cpp:115
wxString m_sheetLayer
Definition: ds_draw_item.h:580
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:450
wxString m_paperFormat
Definition: ds_draw_item.h:575
void SetIsFirstPage(bool aIsFirstPage)
Set if the page is the first page.
Definition: ds_draw_item.h:494
void SetProperties(const std::map< wxString, wxString > *aProps)
Set properties used for text variable resolution.
Definition: ds_draw_item.h:435
const TITLE_BLOCK * m_titleBlock
Definition: ds_draw_item.h:574
const PROJECT * m_project
Definition: ds_draw_item.h:581
void SetSheetLayer(const wxString &aSheetLayer)
Set the sheet layer to draw/plot.
Definition: ds_draw_item.h:460
void SetSheetCount(int aSheetCount)
Set the value of the count of sheets, for basic inscriptions.
Definition: ds_draw_item.h:499
double m_plotterMilsToIu
Definition: ds_draw_item.h:566
bool m_isFirstPage
Is this the first page or not.
Definition: ds_draw_item.h:571
void Append(DS_DRAW_ITEM_BASE *aItem)
Definition: ds_draw_item.h:501
void SetPageNumber(const wxString &aPageNumber)
Set the value of the sheet number.
Definition: ds_draw_item.h:489
double GetMilsToIUfactor()
Get the scalar to convert pages units (mils) to draw/plot units.
Definition: ds_draw_item.h:476
std::vector< DS_DRAW_ITEM_BASE * > m_graphicList
Definition: ds_draw_item.h:564
DS_DRAW_ITEM_BASE * GetNext()
Definition: ds_draw_item.h:522
wxString m_pageNumber
The actual page number displayed in the title block.
Definition: ds_draw_item.h:579
void Remove(DS_DRAW_ITEM_BASE *aItem)
Definition: ds_draw_item.h:506
DS_DRAW_ITEM_LIST(const EDA_IU_SCALE &aIuScale, int aFlags=0)
Definition: ds_draw_item.h:403
wxString m_sheetName
Definition: ds_draw_item.h:577
void SetPaperFormat(const wxString &aFormatName)
Set the paper format name (mainly for drawing sheet editor)
Definition: ds_draw_item.h:440
const EDA_IU_SCALE & m_iuScale
Definition: ds_draw_item.h:565
void SetProject(const PROJECT *aProject)
Definition: ds_draw_item.h:425
A rectangle with thick segment showing the page limits and a marker showing the coordinate origin.
Definition: ds_draw_item.h:266
const VECTOR2I & GetMarkerPos() const
Definition: ds_draw_item.h:280
double GetMarkerSize() const
Definition: ds_draw_item.h:283
VECTOR2I m_markerPos
Definition: ds_draw_item.h:300
void SetPageSize(const VECTOR2I &aSize)
Definition: ds_draw_item.h:277
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:291
void SetPosition(const VECTOR2I &aPos) override
Definition: ds_draw_item.h:286
DS_DRAW_ITEM_PAGE(int aPenWidth, double aMarkerSize)
Definition: ds_draw_item.h:268
void PrintWsItem(const RENDER_SETTINGS *, const VECTOR2I &) override
Definition: ds_draw_item.h:288
virtual wxString GetClass() const override
Return the class name.
Definition: ds_draw_item.h:275
wxString GetItemDescription(UNITS_PROVIDER *aUnitsProvider, bool aFull) const override
Return a user-visible description string of this item.
void SetMarkerPos(const VECTOR2I &aPos)
Definition: ds_draw_item.h:281
VECTOR2I GetPageSize() const
Definition: ds_draw_item.h:278
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:285
SHAPE_POLY_SET m_Polygons
The list of polygons.
Definition: ds_draw_item.h:206
virtual wxString GetClass() const override
Return the class name.
Definition: ds_draw_item.h:180
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:183
SHAPE_POLY_SET & GetPolygons()
Definition: ds_draw_item.h:182
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)
Definition: ds_draw_item.h:173
Non filled rectangle with thick segment.
Definition: ds_draw_item.h:218
const VECTOR2I & GetEnd() const
Definition: ds_draw_item.h:233
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:231
virtual wxString GetClass() const override
Return the class name.
Definition: ds_draw_item.h:229
VECTOR2I GetPosition() const override
Definition: ds_draw_item.h:236
void PrintWsItem(const RENDER_SETTINGS *aSettings, const VECTOR2I &aOffset) override
void SetEnd(const VECTOR2I &aPos) override
Definition: ds_draw_item.h:234
void SetPosition(const VECTOR2I &aPos) override
Definition: ds_draw_item.h:237
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)
Definition: ds_draw_item.h:220
void SetStart(const VECTOR2I &aPos)
Definition: ds_draw_item.h:232
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:313
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)
Definition: ds_draw_item.h:315
const KIFONT::METRICS & getFontMetrics() const override
Definition: ds_draw_item.h:353
void SetPosition(const VECTOR2I &aPos) override
Definition: ds_draw_item.h:337
virtual wxString GetClass() const override
Return the class name.
Definition: ds_draw_item.h:332
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
Definition: ds_draw_item.h:336
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:89
EDA_ITEM_FLAGS m_flags
Definition: eda_item.h:499
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:216
A mix-in class (via multiple inheritance) that handles texts such as labels, parts,...
Definition: eda_text.h:80
void SetTextColor(const COLOR4D &aColor)
Definition: eda_text.h:253
const VECTOR2I & GetTextPos() const
Definition: eda_text.h:257
void SetTextSize(VECTOR2I aNewSize, bool aEnforceMinTextSize=true)
Definition: eda_text.cpp:506
void SetTextPos(const VECTOR2I &aPoint)
Definition: eda_text.cpp:551
void SetTextThickness(int aWidth)
The TextThickness is that set by the user.
Definition: eda_text.cpp:283
void SetBold(bool aBold)
Set the text to be bold - this will also update the font if needed.
Definition: eda_text.cpp:327
void SetItalic(bool aItalic)
Set the text to be italic - this will also update the font if needed.
Definition: eda_text.cpp:299
void SetFont(KIFONT::FONT *aFont)
Definition: eda_text.cpp:490
FONT is an abstract base class for both outline and stroke fonts.
Definition: font.h:131
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: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:59
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.
const double IU_PER_MILS
Definition: base_units.h:77
KICAD_T
The set of class identification values stored in EDA_ITEM::m_structType.
Definition: typeinfo.h:78
@ WSG_POLY_T
Definition: typeinfo.h:217
@ WSG_LINE_T
Definition: typeinfo.h:215
@ WSG_TEXT_T
Definition: typeinfo.h:218
@ WSG_PAGE_T
Definition: typeinfo.h:220
@ WSG_RECT_T
Definition: typeinfo.h:216
@ WSG_BITMAP_T
Definition: typeinfo.h:219
VECTOR2< int32_t > VECTOR2I
Definition: vector2d.h:691