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 bool HitTest( const VECTOR2I& aPosition, int aAccuracy = 0 ) const override;
143
144 void PrintWsItem( const RENDER_SETTINGS* aSettings, const VECTOR2I& aOffset ) override;
145
146 wxString GetSelectMenuText( UNITS_PROVIDER* aUnitsProvider ) const override;
147
148#if defined(DEBUG)
149 void Show( int nestLevel, std::ostream& os ) const override { ShowDummy( os ); }
150#endif
151
152private:
153 VECTOR2I m_start; // start point of line/rect
154 VECTOR2I m_end; // end point
155};
156
157
159{
160public:
161 DS_DRAW_ITEM_POLYPOLYGONS( DS_DATA_ITEM* aPeer, int aIndex, VECTOR2I aPos, int aPenWidth ) :
162 DS_DRAW_ITEM_BASE( aPeer, aIndex, WSG_POLY_T )
163 {
164 m_penWidth = aPenWidth;
165 m_pos = aPos;
166 }
167
168 virtual wxString GetClass() const override { return wxT( "DS_DRAW_ITEM_POLYPOLYGONS" ); }
169
171 VECTOR2I GetPosition() const override { return m_pos; }
172 void SetPosition( const VECTOR2I& aPos ) override;
173
174 const BOX2I GetBoundingBox() const override;
175
176 bool HitTest( const VECTOR2I& aPosition, int aAccuracy = 0 ) const override;
177 bool HitTest( const BOX2I& aRect, bool aContained, int aAccuracy = 0 ) const override;
178
179 void PrintWsItem( const RENDER_SETTINGS* aSettings, const VECTOR2I& aOffset ) override;
180
181 wxString GetSelectMenuText( UNITS_PROVIDER* aUnitsProvider ) const override;
182
183#if defined(DEBUG)
184 void Show( int nestLevel, std::ostream& os ) const override { ShowDummy( os ); }
185#endif
186
187public:
195
196
197private:
198 VECTOR2I m_pos; // position of reference point, from the DS_DATA_ITEM_POLYGONS parent
199 // (used only in drawing sheet editor to draw anchors)
200};
201
202
207{
208public:
209 DS_DRAW_ITEM_RECT( DS_DATA_ITEM* aPeer, int aIndex, VECTOR2I aStart, VECTOR2I aEnd,
210 int aPenWidth ) :
211 DS_DRAW_ITEM_BASE( aPeer, aIndex, WSG_RECT_T )
212 {
213 m_start = aStart;
214 m_end = aEnd;
215 m_penWidth = aPenWidth;
216 }
217
218 virtual wxString GetClass() const override { return wxT( "DS_DRAW_ITEM_RECT" ); }
219
220 const VECTOR2I& GetStart() const { return m_start; }
221 void SetStart( const VECTOR2I& aPos ) { m_start = aPos; }
222 const VECTOR2I& GetEnd() const { return m_end; }
223 void SetEnd( const VECTOR2I& aPos ) override { m_end = aPos; }
224
225 VECTOR2I GetPosition() const override { return GetStart(); }
226 void SetPosition( const VECTOR2I& aPos ) override { SetStart( aPos ); }
227
228 void PrintWsItem( const RENDER_SETTINGS* aSettings, const VECTOR2I& aOffset ) override;
229
230 const BOX2I GetBoundingBox() const override;
231
232 bool HitTest( const VECTOR2I& aPosition, int aAccuracy = 0 ) const override;
233 bool HitTest( const BOX2I& aRect, bool aContained, int aAccuracy = 0 ) const override;
234
235 wxString GetSelectMenuText( UNITS_PROVIDER* aUnitsProvider ) const override;
236
237#if defined(DEBUG)
238 void Show( int nestLevel, std::ostream& os ) const override { ShowDummy( os ); }
239#endif
240
241private:
242 VECTOR2I m_start; // start point of line/rect
243 VECTOR2I m_end; // end point
244};
245
246
255{
256public:
257 DS_DRAW_ITEM_PAGE( int aPenWidth, double aMarkerSize ) :
258 DS_DRAW_ITEM_BASE( nullptr, 0, WSG_PAGE_T )
259 {
260 m_penWidth = aPenWidth;
261 m_markerSize = aMarkerSize;
262 }
263
264 virtual wxString GetClass() const override { return wxT( "DS_DRAW_ITEM_PAGE" ); }
265
266 void SetPageSize( const VECTOR2I& aSize ) { m_pageSize = aSize; }
267 VECTOR2I GetPageSize() const { return m_pageSize; }
268
269 const VECTOR2I& GetMarkerPos() const { return m_markerPos; }
270 void SetMarkerPos( const VECTOR2I& aPos ) { m_markerPos = aPos; }
271
272 double GetMarkerSize() const { return m_markerSize; }
273
274 VECTOR2I GetPosition() const override { return VECTOR2I( 0, 0 ); }
275 void SetPosition( const VECTOR2I& aPos ) override { /* do nothing */ }
276
277 void PrintWsItem( const RENDER_SETTINGS* , const VECTOR2I& ) override { /* do nothing */ }
278
279 const BOX2I GetBoundingBox() const override;
280 bool HitTest( const VECTOR2I& aPosition, int aAccuracy = 0 ) const override { return false; }
281
282 wxString GetSelectMenuText( UNITS_PROVIDER* aUnitsProvider ) const override;
283
284#if defined(DEBUG)
285 void Show( int nestLevel, std::ostream& os ) const override { ShowDummy( os ); }
286#endif
287
288private:
289 VECTOR2I m_markerPos; // position of the marker
290 VECTOR2I m_pageSize; // full size of the page
292};
293
294
302{
303public:
304 DS_DRAW_ITEM_TEXT( DS_DATA_ITEM* aPeer, int aIndex, const wxString& aText, const VECTOR2I& aPos,
305 const VECTOR2I& aSize, int aPenWidth, KIFONT::FONT* aFont,
306 bool aItalic = false, bool aBold = false,
308 DS_DRAW_ITEM_BASE( aPeer, aIndex, WSG_TEXT_T),
309 EDA_TEXT( drawSheetIUScale, aText )
310 {
311 SetTextPos( aPos );
312 SetTextSize( aSize );
313 SetTextThickness( aPenWidth );
314 SetFont( aFont );
315 SetItalic( aItalic );
316 SetBold( aBold );
317 SetTextColor( aColor );
318 }
319
320 virtual wxString GetClass() const override { return wxT( "DS_DRAW_ITEM_TEXT" ); }
321
322 void PrintWsItem( const RENDER_SETTINGS* aSettings, const VECTOR2I& aOffset ) override;
323
324 VECTOR2I GetPosition() const override { return GetTextPos(); }
325 void SetPosition( const VECTOR2I& aPos ) override { SetTextPos( aPos ); }
326
327 const BOX2I GetBoundingBox() const override;
328
329 bool HitTest( const VECTOR2I& aPosition, int aAccuracy = 0 ) const override;
330 bool HitTest( const BOX2I& aRect, bool aContained, int aAccuracy = 0 ) const override;
331
332 wxString GetSelectMenuText( UNITS_PROVIDER* aUnitsProvider ) const override;
333
334#if defined(DEBUG)
335 void Show( int nestLevel, std::ostream& os ) const override { ShowDummy( os ); }
336#endif
337};
338
339
344{
345public:
346 DS_DRAW_ITEM_BITMAP( DS_DATA_ITEM* aPeer, int aIndex, VECTOR2I aPos ) :
347 DS_DRAW_ITEM_BASE( aPeer, aIndex, WSG_BITMAP_T )
348 {
349 m_pos = aPos;
350 }
351
353
354 virtual wxString GetClass() const override { return wxT( "DS_DRAW_ITEM_BITMAP" ); }
355
356 VECTOR2I GetPosition() const override { return m_pos; }
357 void SetPosition( const VECTOR2I& aPos ) override { m_pos = aPos; }
358
359 void PrintWsItem( const RENDER_SETTINGS* aSettings, const VECTOR2I& aOffset ) override;
360
361 bool HitTest( const VECTOR2I& aPosition, int aAccuracy = 0 ) const override;
362 bool HitTest( const BOX2I& aRect, bool aContained, int aAccuracy = 0 ) const override;
363 const BOX2I GetBoundingBox() const override;
364
365 wxString GetSelectMenuText( UNITS_PROVIDER* aUnitsProvider ) const override;
366
367#if defined(DEBUG)
368 void Show( int nestLevel, std::ostream& os ) const override { ShowDummy( os ); }
369#endif
370
371private:
372 VECTOR2I m_pos; // position of reference point
373};
374
375
383{
384public:
386 {
387 m_idx = 0;
388 m_milsToIu = 1.0;
389 m_penSize = 1;
390 m_pageNumber = "1";
391 m_sheetCount = 1;
392 m_sheetLayer = nullptr;
393 m_titleBlock = nullptr;
394 m_paperFormat = 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 )
428 {
429 m_fileName = aFileName;
430 }
431
435 void SetSheetName( const wxString& aSheetName )
436 {
437 m_sheetName = aSheetName;
438 }
439
443 void SetSheetPath( const wxString& aSheetPath )
444 {
445 m_sheetPath = aSheetPath;
446 }
447
451 void SetSheetLayer( const wxString& aSheetLayer )
452 {
453 m_sheetLayer = &aSheetLayer;
454 }
455
456 void SetDefaultPenSize( int aPenSize ) { m_penSize = aPenSize; }
457 int GetDefaultPenSize() const { return m_penSize; }
458
462 void SetMilsToIUfactor( double aMils2Iu )
463 {
464 m_milsToIu = aMils2Iu;
465 }
466
470 double GetMilsToIUfactor() { return m_milsToIu; }
471
475 void SetPageNumber( const wxString& aPageNumber )
476 {
477 m_pageNumber = aPageNumber;
478 }
479
483 void SetIsFirstPage( bool aIsFirstPage ) { m_isFirstPage = aIsFirstPage; }
484
488 void SetSheetCount( int aSheetCount )
489 {
490 m_sheetCount = aSheetCount;
491 }
492
494 {
495 m_graphicList.push_back( aItem );
496 }
497
499 {
500 auto newEnd = std::remove( m_graphicList.begin(), m_graphicList.end(), aItem );
501 m_graphicList.erase( newEnd, m_graphicList.end() );
502 }
503
505 {
506 m_idx = 0;
507
508 if( m_graphicList.size() )
509 return m_graphicList[0];
510 else
511 return nullptr;
512 }
513
515 {
516 m_idx++;
517
518 if( m_graphicList.size() > m_idx )
519 return m_graphicList[m_idx];
520 else
521 return nullptr;
522 }
523
524 void GetAllItems( std::vector<DS_DRAW_ITEM_BASE*>* aList )
525 {
526 *aList = m_graphicList;
527 }
528
532 void Print( const RENDER_SETTINGS* aSettings );
533
551 void BuildDrawItemsList( const PAGE_INFO& aPageInfo, const TITLE_BLOCK& aTitleBlock );
552
553 static void GetTextVars( wxArrayString* aVars );
554
559 wxString BuildFullText( const wxString& aTextbase );
560
561protected:
562 std::vector <DS_DRAW_ITEM_BASE*> m_graphicList; // Items to draw/plot
563 unsigned m_idx; // for GetFirst, GetNext functions
564 double m_milsToIu; // the scalar to convert pages units ( mils)
565 // to draw/plot units.
566 int m_penSize; // The default line width for drawings.
567 // used when an item has a pen size = 0
570 // for text variable references, in schematic
571 const TITLE_BLOCK* m_titleBlock; // for text variable references
572 const wxString* m_paperFormat; // for text variable references
573 wxString m_fileName; // for text variable references
574 wxString m_sheetName; // for text variable references
575 wxString m_sheetPath; // for text variable references
576 wxString m_pageNumber;
577 const wxString* m_sheetLayer; // for text variable references
578 const PROJECT* m_project; // for project-based text variable references
579
580 const std::map<wxString, wxString>* m_properties; // for text variable references
581};
582
583
584#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:354
VECTOR2I GetPosition() const override
Definition: ds_draw_item.h:356
DS_DRAW_ITEM_BITMAP(DS_DATA_ITEM *aPeer, int aIndex, VECTOR2I aPos)
Definition: ds_draw_item.h:346
void PrintWsItem(const RENDER_SETTINGS *aSettings, const VECTOR2I &aOffset) override
wxString GetSelectMenuText(UNITS_PROVIDER *aUnitsProvider) const override
Return the text to display to be used in the selection clarification context menu when multiple items...
void SetPosition(const VECTOR2I &aPos) override
Definition: ds_draw_item.h:357
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
wxString GetSelectMenuText(UNITS_PROVIDER *aUnitsProvider) const override
Return the text to display to be used in the selection clarification context menu when multiple items...
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
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:383
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:569
DS_DRAW_ITEM_BASE * GetFirst()
Definition: ds_draw_item.h:504
void BuildDrawItemsList(const PAGE_INFO &aPageInfo, const TITLE_BLOCK &aTitleBlock)
Drawing or plot the drawing sheet.
int GetDefaultPenSize() const
Definition: ds_draw_item.h:457
wxString m_sheetPath
Definition: ds_draw_item.h:575
void SetSheetPath(const wxString &aSheetPath)
Set the sheet path to draw/plot.
Definition: ds_draw_item.h:443
static void GetTextVars(wxArrayString *aVars)
Definition: ds_painter.cpp:97
const std::map< wxString, wxString > * m_properties
Definition: ds_draw_item.h:580
void SetPaperFormat(const wxString *aFormatName)
Set the paper format name (mainly for drawing sheet editor)
Definition: ds_draw_item.h:422
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:456
wxString BuildFullText(const wxString &aTextbase)
Definition: ds_painter.cpp:113
void GetAllItems(std::vector< DS_DRAW_ITEM_BASE * > *aList)
Definition: ds_draw_item.h:524
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:435
void SetIsFirstPage(bool aIsFirstPage)
Set if the page is the first page.
Definition: ds_draw_item.h:483
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:571
const PROJECT * m_project
Definition: ds_draw_item.h:578
void SetSheetLayer(const wxString &aSheetLayer)
Set the sheet layer to draw/plot.
Definition: ds_draw_item.h:451
void SetSheetCount(int aSheetCount)
Set the value of the count of sheets, for basic inscriptions.
Definition: ds_draw_item.h:488
bool m_isFirstPage
Is this the first page or not.
Definition: ds_draw_item.h:568
void Append(DS_DRAW_ITEM_BASE *aItem)
Definition: ds_draw_item.h:493
const wxString * m_paperFormat
Definition: ds_draw_item.h:572
void SetPageNumber(const wxString &aPageNumber)
Set the value of the sheet number.
Definition: ds_draw_item.h:475
double GetMilsToIUfactor()
Get the scalar to convert pages units (mils) to draw/plot units.
Definition: ds_draw_item.h:470
std::vector< DS_DRAW_ITEM_BASE * > m_graphicList
Definition: ds_draw_item.h:562
DS_DRAW_ITEM_BASE * GetNext()
Definition: ds_draw_item.h:514
wxString m_pageNumber
The actual page number displayed in the title block.
Definition: ds_draw_item.h:576
const wxString * m_sheetLayer
Definition: ds_draw_item.h:577
void SetMilsToIUfactor(double aMils2Iu)
Set the scalar to convert pages units (mils) to draw/plot units.
Definition: ds_draw_item.h:462
void Remove(DS_DRAW_ITEM_BASE *aItem)
Definition: ds_draw_item.h:498
wxString m_sheetName
Definition: ds_draw_item.h:574
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:255
const VECTOR2I & GetMarkerPos() const
Definition: ds_draw_item.h:269
double GetMarkerSize() const
Definition: ds_draw_item.h:272
VECTOR2I m_markerPos
Definition: ds_draw_item.h:289
void SetPageSize(const VECTOR2I &aSize)
Definition: ds_draw_item.h:266
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:280
void SetPosition(const VECTOR2I &aPos) override
Definition: ds_draw_item.h:275
DS_DRAW_ITEM_PAGE(int aPenWidth, double aMarkerSize)
Definition: ds_draw_item.h:257
void PrintWsItem(const RENDER_SETTINGS *, const VECTOR2I &) override
Definition: ds_draw_item.h:277
virtual wxString GetClass() const override
Return the class name.
Definition: ds_draw_item.h:264
void SetMarkerPos(const VECTOR2I &aPos)
Definition: ds_draw_item.h:270
wxString GetSelectMenuText(UNITS_PROVIDER *aUnitsProvider) const override
Return the text to display to be used in the selection clarification context menu when multiple items...
VECTOR2I GetPageSize() const
Definition: ds_draw_item.h:267
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:274
SHAPE_POLY_SET m_Polygons
The list of polygons.
Definition: ds_draw_item.h:194
virtual wxString GetClass() const override
Return the class name.
Definition: ds_draw_item.h:168
wxString GetSelectMenuText(UNITS_PROVIDER *aUnitsProvider) const override
Return the text to display to be used in the selection clarification context menu when multiple items...
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:171
SHAPE_POLY_SET & GetPolygons()
Definition: ds_draw_item.h:170
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
DS_DRAW_ITEM_POLYPOLYGONS(DS_DATA_ITEM *aPeer, int aIndex, VECTOR2I aPos, int aPenWidth)
Definition: ds_draw_item.h:161
Non filled rectangle with thick segment.
Definition: ds_draw_item.h:207
const VECTOR2I & GetEnd() const
Definition: ds_draw_item.h:222
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:220
virtual wxString GetClass() const override
Return the class name.
Definition: ds_draw_item.h:218
VECTOR2I GetPosition() const override
Definition: ds_draw_item.h:225
void PrintWsItem(const RENDER_SETTINGS *aSettings, const VECTOR2I &aOffset) override
void SetEnd(const VECTOR2I &aPos) override
Definition: ds_draw_item.h:223
void SetPosition(const VECTOR2I &aPos) override
Definition: ds_draw_item.h:226
wxString GetSelectMenuText(UNITS_PROVIDER *aUnitsProvider) const override
Return the text to display to be used in the selection clarification context menu when multiple items...
DS_DRAW_ITEM_RECT(DS_DATA_ITEM *aPeer, int aIndex, VECTOR2I aStart, VECTOR2I aEnd, int aPenWidth)
Definition: ds_draw_item.h:209
void SetStart(const VECTOR2I &aPos)
Definition: ds_draw_item.h:221
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:302
wxString GetSelectMenuText(UNITS_PROVIDER *aUnitsProvider) const override
Return the text to display to be used in the selection clarification context menu when multiple items...
void PrintWsItem(const RENDER_SETTINGS *aSettings, const VECTOR2I &aOffset) override
void SetPosition(const VECTOR2I &aPos) override
Definition: ds_draw_item.h:325
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:304
virtual wxString GetClass() const override
Return the class name.
Definition: ds_draw_item.h:320
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:324
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:194
const VECTOR2I & GetTextPos() const
Definition: eda_text.h:198
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:390
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: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: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