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-2021 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 
39 class DS_DATA_ITEM;
40 class TITLE_BLOCK;
41 class PAGE_INFO;
42 class EDA_ITEM;
43 class EDA_DRAW_FRAME;
44 class PROJECT;
45 
59 {
60 public:
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 wxPoint& 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, wxPoint( 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 wxPoint& 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 EDA_RECT GetBoundingBox() const override = 0;
90 
91  bool HitTest( const wxPoint& 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 EDA_RECT& aRect, bool aContained, int aAccuracy = 0 ) const override;
99 
100  void GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, MSG_PANEL_ITEMS& aList ) override;
101 
102 protected:
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 {
121 public:
122  DS_DRAW_ITEM_LINE( DS_DATA_ITEM* aPeer, int aIndex, wxPoint aStart, wxPoint 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 wxPoint& GetStart() const { return m_start; }
134  void SetStart( const wxPoint& aPos ) { m_start = aPos; }
135  const wxPoint& GetEnd() const { return m_end; }
136  void SetEnd( const wxPoint& aPos ) override { m_end = aPos; }
137 
138  wxPoint GetPosition() const override { return GetStart(); }
139  void SetPosition( const wxPoint& aPos ) override { SetStart( aPos ); }
140 
141  const EDA_RECT GetBoundingBox() const override;
142  bool HitTest( const wxPoint& aPosition, int aAccuracy = 0 ) const override;
143 
144  void PrintWsItem( const RENDER_SETTINGS* aSettings, const wxPoint& aOffset ) override;
145 
146  wxString GetSelectMenuText( EDA_UNITS aUnits ) const override;
147 
148 #if defined(DEBUG)
149  void Show( int nestLevel, std::ostream& os ) const override { ShowDummy( os ); }
150 #endif
151 
152 private:
153  wxPoint m_start; // start point of line/rect
154  wxPoint m_end; // end point
155 };
156 
157 
159 {
160 public:
161  DS_DRAW_ITEM_POLYPOLYGONS( DS_DATA_ITEM* aPeer, int aIndex, wxPoint 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  wxPoint GetPosition() const override { return m_pos; }
172  void SetPosition( const wxPoint& aPos ) override;
173 
174  const EDA_RECT GetBoundingBox() const override;
175  bool HitTest( const wxPoint& aPosition, int aAccuracy = 0 ) const override;
176  bool HitTest( const EDA_RECT& aRect, bool aContained, int aAccuracy = 0 ) const override;
177 
178  void PrintWsItem( const RENDER_SETTINGS* aSettings, const wxPoint& aOffset ) override;
179 
180  wxString GetSelectMenuText( EDA_UNITS aUnits ) const override;
181 
182 #if defined(DEBUG)
183  void Show( int nestLevel, std::ostream& os ) const override { ShowDummy( os ); }
184 #endif
185 
186 public:
194 
195 
196 private:
197  wxPoint m_pos; // position of reference point, from the DS_DATA_ITEM_POLYGONS parent
198  // (used only in drawing sheet editor to draw anchors)
199 };
200 
201 
206 {
207 public:
208  DS_DRAW_ITEM_RECT( DS_DATA_ITEM* aPeer, int aIndex, wxPoint aStart, wxPoint aEnd,
209  int aPenWidth ) :
210  DS_DRAW_ITEM_BASE( aPeer, aIndex, WSG_RECT_T )
211  {
212  m_start = aStart;
213  m_end = aEnd;
214  m_penWidth = aPenWidth;
215  }
216 
217  virtual wxString GetClass() const override { return wxT( "DS_DRAW_ITEM_RECT" ); }
218 
219  const wxPoint& GetStart() const { return m_start; }
220  void SetStart( const wxPoint& aPos ) { m_start = aPos; }
221  const wxPoint& GetEnd() const { return m_end; }
222  void SetEnd( const wxPoint& aPos ) override { m_end = aPos; }
223 
224  wxPoint GetPosition() const override { return GetStart(); }
225  void SetPosition( const wxPoint& aPos ) override { SetStart( aPos ); }
226 
227  void PrintWsItem( const RENDER_SETTINGS* aSettings, const wxPoint& aOffset ) override;
228 
229  const EDA_RECT GetBoundingBox() const override;
230  bool HitTest( const wxPoint& aPosition, int aAccuracy = 0 ) const override;
231  bool HitTest( const EDA_RECT& aRect, bool aContained, int aAccuracy = 0 ) const override;
232 
233  wxString GetSelectMenuText( EDA_UNITS aUnits ) const override;
234 
235 #if defined(DEBUG)
236  void Show( int nestLevel, std::ostream& os ) const override { ShowDummy( os ); }
237 #endif
238 
239 private:
240  wxPoint m_start; // start point of line/rect
241  wxPoint m_end; // end point
242 };
243 
244 
253 {
254 public:
255  DS_DRAW_ITEM_PAGE( int aPenWidth, double aMarkerSize ) :
256  DS_DRAW_ITEM_BASE( nullptr, 0, WSG_PAGE_T )
257  {
258  m_penWidth = aPenWidth;
259  m_markerSize = aMarkerSize;
260  }
261 
262  virtual wxString GetClass() const override { return wxT( "DS_DRAW_ITEM_PAGE" ); }
263 
264  void SetPageSize( const wxSize& aSize ) { m_pageSize = aSize; }
265  wxSize GetPageSize() const { return m_pageSize; }
266  const wxPoint& GetMarkerPos() const { return m_markerPos; }
267  void SetMarkerPos( const wxPoint& aPos ) { m_markerPos = aPos; }
268  double GetMarkerSize() const { return m_markerSize; }
269 
270  wxPoint GetPosition() const override { return wxPoint( 0, 0 ); }
271  void SetPosition( const wxPoint& aPos ) override { /* do nothing */ }
272 
273  void PrintWsItem( const RENDER_SETTINGS* , const wxPoint& ) override { /* do nothing */ }
274 
275  const EDA_RECT GetBoundingBox() const override;
276  bool HitTest( const wxPoint& aPosition, int aAccuracy = 0 ) const override { return false; }
277 
278  wxString GetSelectMenuText( EDA_UNITS aUnits ) const override;
279 
280 #if defined(DEBUG)
281  void Show( int nestLevel, std::ostream& os ) const override { ShowDummy( os ); }
282 #endif
283 
284 private:
285  wxPoint m_markerPos; // position of the marker
286  wxSize m_pageSize; // full size of the page
287  double m_markerSize;
288 };
289 
290 
298 {
299 public:
300  DS_DRAW_ITEM_TEXT( DS_DATA_ITEM* aPeer, int aIndex, const wxString& aText, const wxPoint& aPos,
301  const wxSize& aSize, int aPenWidth, bool aItalic = false,
302  bool aBold = false ) :
303  DS_DRAW_ITEM_BASE( aPeer, aIndex, WSG_TEXT_T),
304  EDA_TEXT( aText )
305  {
306  SetTextPos( aPos );
307  SetTextSize( aSize );
308  SetTextThickness( aPenWidth );
309  SetItalic( aItalic );
310  SetBold( aBold );
311  }
312 
313  virtual wxString GetClass() const override { return wxT( "DS_DRAW_ITEM_TEXT" ); }
314 
315  void PrintWsItem( const RENDER_SETTINGS* aSettings, const wxPoint& aOffset ) override;
316 
317  void SetTextAngle( double aAngle ) override;
318 
319  wxPoint GetPosition() const override { return GetTextPos(); }
320  void SetPosition( const wxPoint& aPos ) override { SetTextPos( aPos ); }
321 
322  const EDA_RECT GetBoundingBox() const override;
323  bool HitTest( const wxPoint& aPosition, int aAccuracy = 0 ) const override;
324  bool HitTest( const EDA_RECT& aRect, bool aContained, int aAccuracy = 0 ) const override;
325 
326  wxString GetSelectMenuText( EDA_UNITS aUnits ) const override;
327 
328 #if defined(DEBUG)
329  void Show( int nestLevel, std::ostream& os ) const override { ShowDummy( os ); }
330 #endif
331 };
332 
333 
338 {
339 public:
340  DS_DRAW_ITEM_BITMAP( DS_DATA_ITEM* aPeer, int aIndex, wxPoint aPos ) :
341  DS_DRAW_ITEM_BASE( aPeer, aIndex, WSG_BITMAP_T )
342  {
343  m_pos = aPos;
344  }
345 
347 
348  virtual wxString GetClass() const override { return wxT( "DS_DRAW_ITEM_BITMAP" ); }
349 
350  wxPoint GetPosition() const override { return m_pos; }
351  void SetPosition( const wxPoint& aPos ) override { m_pos = aPos; }
352 
353  void PrintWsItem( const RENDER_SETTINGS* aSettings, const wxPoint& aOffset ) override;
354 
355  bool HitTest( const wxPoint& aPosition, int aAccuracy = 0 ) const override;
356  bool HitTest( const EDA_RECT& aRect, bool aContained, int aAccuracy = 0 ) const override;
357  const EDA_RECT GetBoundingBox() const override;
358 
359  wxString GetSelectMenuText( EDA_UNITS aUnits ) const override;
360 
361 #if defined(DEBUG)
362  void Show( int nestLevel, std::ostream& os ) const override { ShowDummy( os ); }
363 #endif
364 
365 private:
366  wxPoint m_pos; // position of reference point
367 };
368 
369 
377 {
378 public:
380  {
381  m_idx = 0;
382  m_milsToIu = 1.0;
383  m_penSize = 1;
384  m_pageNumber = "1";
385  m_sheetCount = 1;
386  m_sheetLayer = nullptr;
387  m_titleBlock = nullptr;
388  m_paperFormat = nullptr;
389  m_project = nullptr;
390  m_isFirstPage = true;
391  }
392 
394  {
395  // Items in the m_graphicList are owned by their respective DS_DATA_ITEMs.
396  // for( DS_DRAW_ITEM_BASE* item : m_graphicList )
397  // delete item;
398  }
399 
400  void SetProject( const PROJECT* aProject ) { m_project = aProject; }
401 
405  void SetTitleBlock( const TITLE_BLOCK* aTblock ) { m_titleBlock = aTblock; }
406 
410  void SetPaperFormat( const wxString* aFormatName ) { m_paperFormat = aFormatName; }
411 
415  void SetFileName( const wxString& aFileName )
416  {
417  m_fileName = aFileName;
418  }
419 
423  void SetSheetName( const wxString& aSheetName )
424  {
425  m_sheetFullName = aSheetName;
426  }
427 
431  void SetSheetLayer( const wxString& aSheetLayer )
432  {
433  m_sheetLayer = &aSheetLayer;
434  }
435 
436  void SetDefaultPenSize( int aPenSize ) { m_penSize = aPenSize; }
437  int GetDefaultPenSize() const { return m_penSize; }
438 
442  void SetMilsToIUfactor( double aMils2Iu )
443  {
444  m_milsToIu = aMils2Iu;
445  }
446 
450  double GetMilsToIUfactor() { return m_milsToIu; }
451 
455  void SetPageNumber( const wxString& aPageNumber )
456  {
457  m_pageNumber = aPageNumber;
458  }
459 
463  void SetIsFirstPage( bool aIsFirstPage ) { m_isFirstPage = aIsFirstPage; }
464 
468  void SetSheetCount( int aSheetCount )
469  {
470  m_sheetCount = aSheetCount;
471  }
472 
473  void Append( DS_DRAW_ITEM_BASE* aItem )
474  {
475  m_graphicList.push_back( aItem );
476  }
477 
478  void Remove( DS_DRAW_ITEM_BASE* aItem )
479  {
480  auto newEnd = std::remove( m_graphicList.begin(), m_graphicList.end(), aItem );
481  m_graphicList.erase( newEnd, m_graphicList.end() );
482  }
483 
485  {
486  m_idx = 0;
487 
488  if( m_graphicList.size() )
489  return m_graphicList[0];
490  else
491  return nullptr;
492  }
493 
495  {
496  m_idx++;
497 
498  if( m_graphicList.size() > m_idx )
499  return m_graphicList[m_idx];
500  else
501  return nullptr;
502  }
503 
504  void GetAllItems( std::vector<DS_DRAW_ITEM_BASE*>* aList )
505  {
506  *aList = m_graphicList;
507  }
508 
512  void Print( const RENDER_SETTINGS* aSettings );
513 
530  void BuildDrawItemsList( const PAGE_INFO& aPageInfo, const TITLE_BLOCK& aTitleBlock );
531 
532  static void GetTextVars( wxArrayString* aVars );
533 
561  wxString BuildFullText( const wxString& aTextbase );
562 
563 protected:
564  std::vector <DS_DRAW_ITEM_BASE*> m_graphicList; // Items to draw/plot
565  unsigned m_idx; // for GetFirst, GetNext functions
566  double m_milsToIu; // the scalar to convert pages units ( mils)
567  // to draw/plot units.
568  int m_penSize; // The default line width for drawings.
569  // used when an item has a pen size = 0
572  // for basic inscriptions, in schematic
573  const TITLE_BLOCK* m_titleBlock; // for basic inscriptions
574  const wxString* m_paperFormat; // for basic inscriptions
575  wxString m_fileName; // for basic inscriptions
576  wxString m_sheetFullName; // for basic inscriptions
577  wxString m_pageNumber;
578  const wxString* m_sheetLayer; // for basic inscriptions
579  const PROJECT* m_project; // for project-based variable substitutions
580 };
581 
582 
583 #endif // DS_DRAW_ITEM_H
bool HitTest(const wxPoint &aPosition, int aAccuracy=0) const override
Test if aPosition is contained within or on the bounding box of an item.
Definition: ds_draw_item.h:276
virtual void PrintWsItem(const RENDER_SETTINGS *aSettings)
Definition: ds_draw_item.h:79
bool m_isFirstPage
Is this the first page or not.
Definition: ds_draw_item.h:570
void SetStart(const wxPoint &aPos)
Definition: ds_draw_item.h:220
const EDA_RECT GetBoundingBox() const override
Return the orthogonal bounding box of this object for display purposes.
void SetStart(const wxPoint &aPos)
Definition: ds_draw_item.h:134
void SetIsFirstPage(bool aIsFirstPage)
Set if the page is the first page.
Definition: ds_draw_item.h:463
virtual wxString GetClass() const override
Return the class name.
Definition: ds_draw_item.h:348
wxString GetSelectMenuText(EDA_UNITS aUnits) const override
Return the text to display to be used in the selection clarification context menu when multiple items...
void SetMarkerPos(const wxPoint &aPos)
Definition: ds_draw_item.h:267
Container for project specific data.
Definition: project.h:62
const TITLE_BLOCK * m_titleBlock
Definition: ds_draw_item.h:573
const wxPoint & GetMarkerPos() const
Definition: ds_draw_item.h:266
void SetMilsToIUfactor(double aMils2Iu)
Set the scalar to convert pages units (mils) to draw/plot units.
Definition: ds_draw_item.h:442
void SetPosition(const wxPoint &aPos) override
Definition: ds_draw_item.h:271
Container for all the knowledge about how graphical objects are drawn on any output surface/device.
wxString BuildFullText(const wxString &aTextbase)
Return the full text corresponding to the aTextbase, after replacing format symbols by the correspond...
Definition: ds_painter.cpp:104
void SetEnd(const wxPoint &aPos) override
Definition: ds_draw_item.h:222
wxPoint GetPosition() const override
Definition: ds_draw_item.h:350
void PrintWsItem(const RENDER_SETTINGS *aSettings, const wxPoint &aOffset) override
wxString GetSelectMenuText(EDA_UNITS aUnits) const override
Return the text to display to be used in the selection clarification context menu when multiple items...
void SetDefaultPenSize(int aPenSize)
Definition: ds_draw_item.h:436
const PROJECT * m_project
Definition: ds_draw_item.h:579
DS_DRAW_ITEM_LINE(DS_DATA_ITEM *aPeer, int aIndex, wxPoint aStart, wxPoint aEnd, int aPenWidth)
Definition: ds_draw_item.h:122
DS_DATA_ITEM * m_peer
Definition: ds_draw_item.h:112
void SetFileName(const wxString &aFileName)
Set the filename to draw/plot.
Definition: ds_draw_item.h:415
virtual ~DS_DRAW_ITEM_BASE()
Definition: ds_draw_item.h:61
void ViewGetLayers(int aLayers[], int &aCount) const override
Return the all the layers within the VIEW the object is painted on.
void SetItalic(bool isItalic)
Definition: eda_text.h:179
const EDA_RECT GetBoundingBox() const override
Return the orthogonal bounding box of this object for display purposes.
wxPoint GetPosition() const override
Definition: ds_draw_item.h:270
void SetTextPos(const wxPoint &aPoint)
Definition: eda_text.h:246
void PrintWsItem(const RENDER_SETTINGS *aSettings, const wxPoint &aOffset) override
const EDA_RECT GetBoundingBox() const override
Return the orthogonal bounding box of this object for display purposes.
void SetTextSize(const wxSize &aNewSize)
Definition: eda_text.h:237
void SetPosition(const wxPoint &aPos) override
Definition: ds_draw_item.h:320
virtual wxString GetClass() const override
Return the class name.
Definition: ds_draw_item.h:168
EDA_ITEM_FLAGS m_flags
Definition: eda_item.h:481
The base class for create windows for drawing purpose.
Hold the information shown in the lower right corner of a plot, printout, or editing view.
Definition: title_block.h:40
const wxPoint & GetStart() const
Definition: ds_draw_item.h:133
wxPoint GetPosition() const override
Definition: ds_draw_item.h:224
const wxPoint & GetStart() const
Definition: ds_draw_item.h:219
void SetPosition(const wxPoint &aPos) override
Definition: ds_draw_item.h:351
KICAD_T
The set of class identification values stored in EDA_ITEM::m_structType.
Definition: typeinfo.h:77
void PrintWsItem(const RENDER_SETTINGS *, const wxPoint &) override
Definition: ds_draw_item.h:273
void SetPaperFormat(const wxString *aFormatName)
Set the paper format name (mainly for drawing sheet editor)
Definition: ds_draw_item.h:410
void Print(const RENDER_SETTINGS *aSettings)
Draws the item list created by BuildDrawItemsList.
wxString GetSelectMenuText(EDA_UNITS aUnits) const override
Return the text to display to be used in the selection clarification context menu when multiple items...
A mix-in class (via multiple inheritance) that handles texts such as labels, parts,...
Definition: eda_text.h:119
virtual bool HitTest(const wxPoint &aPosition, int aAccuracy=0) const
Test if aPosition is contained within or on the bounding box of an item.
Definition: eda_item.h:225
bool HitTest(const wxPoint &aPosition, int aAccuracy=0) const override
Test if aPosition is contained within or on the bounding box of an item.
Base class to handle basic graphic items.
Definition: ds_draw_item.h:58
A graphic text.
Definition: ds_draw_item.h:297
void SetPageSize(const wxSize &aSize)
Definition: ds_draw_item.h:264
wxString m_pageNumber
The actual page number displayed in the title block.
Definition: ds_draw_item.h:577
SHAPE_POLY_SET & GetPolygons()
Definition: ds_draw_item.h:170
DS_DRAW_ITEM_BASE * GetNext()
Definition: ds_draw_item.h:494
int GetDefaultPenSize() const
Definition: ds_draw_item.h:437
void SetPosition(const wxPoint &aPos) override
Definition: ds_draw_item.h:225
virtual wxString GetClass() const override
Return the class name.
Definition: ds_draw_item.h:313
DS_DRAW_ITEM_BASE(DS_DATA_ITEM *aPeer, int aIndex, KICAD_T aType)
Definition: ds_draw_item.h:103
static void GetTextVars(wxArrayString *aVars)
Definition: ds_painter.cpp:89
Represent a set of closed polygons.
void SetPageNumber(const wxString &aPageNumber)
Set the value of the sheet number.
Definition: ds_draw_item.h:455
Describe the page size and margins of a paper page on which to eventually print or plot.
Definition: page_info.h:53
wxPoint GetPosition() const override
Definition: ds_draw_item.h:138
wxSize GetPageSize() const
Definition: ds_draw_item.h:265
void SetTextAngle(double aAngle) override
wxString GetSelectMenuText(EDA_UNITS aUnits) const override
Return the text to display to be used in the selection clarification context menu when multiple items...
virtual wxString GetClass() const override
Return the class name.
Definition: ds_draw_item.h:131
double GetMilsToIUfactor()
Get the scalar to convert pages units (mils) to draw/plot units.
Definition: ds_draw_item.h:450
const EDA_RECT GetBoundingBox() const override
Return the orthogonal bounding box of this object for display purposes.
int m_sheetCount
The number of sheets.
Definition: ds_draw_item.h:571
const EDA_RECT GetBoundingBox() const override
Return the orthogonal bounding box of this object for display purposes.
void PrintWsItem(const RENDER_SETTINGS *aSettings, const wxPoint &aOffset) override
DS_DRAW_ITEM_POLYPOLYGONS(DS_DATA_ITEM *aPeer, int aIndex, wxPoint aPos, int aPenWidth)
Definition: ds_draw_item.h:161
void GetMsgPanelInfo(EDA_DRAW_FRAME *aFrame, MSG_PANEL_ITEMS &aList) override
bool HitTest(const wxPoint &aPosition, int aAccuracy=0) const override
Test if aPosition is contained within or on the bounding box of an item.
A rectangle with thick segment showing the page limits and a marker showing the coordinate origin.
Definition: ds_draw_item.h:252
void SetSheetName(const wxString &aSheetName)
Set the sheet name to draw/plot.
Definition: ds_draw_item.h:423
wxString m_sheetFullName
Definition: ds_draw_item.h:576
EDA_UNITS
Definition: eda_units.h:38
Non filled rectangle with thick segment.
Definition: ds_draw_item.h:205
DS_DRAW_ITEM_BITMAP(DS_DATA_ITEM *aPeer, int aIndex, wxPoint aPos)
Definition: ds_draw_item.h:340
void BuildDrawItemsList(const PAGE_INFO &aPageInfo, const TITLE_BLOCK &aTitleBlock)
Drawing or plot the drawing sheet.
void Append(DS_DRAW_ITEM_BASE *aItem)
Definition: ds_draw_item.h:473
DS_DATA_ITEM * GetPeer() const
Definition: ds_draw_item.h:63
std::vector< DS_DRAW_ITEM_BASE * > m_graphicList
Definition: ds_draw_item.h:564
double GetMarkerSize() const
Definition: ds_draw_item.h:268
int GetIndexInPeer() const
Definition: ds_draw_item.h:64
virtual wxString GetClass() const override
Return the class name.
Definition: ds_draw_item.h:262
SHAPE_POLY_SET m_Polygons
The list of polygons.
Definition: ds_draw_item.h:193
virtual void SetEnd(const wxPoint &aPos)
Definition: ds_draw_item.h:68
DS_DRAW_ITEM_TEXT(DS_DATA_ITEM *aPeer, int aIndex, const wxString &aText, const wxPoint &aPos, const wxSize &aSize, int aPenWidth, bool aItalic=false, bool aBold=false)
Definition: ds_draw_item.h:300
void SetSheetLayer(const wxString &aSheetLayer)
Set the sheet layer to draw/plot.
Definition: ds_draw_item.h:431
Drawing sheet structure type definitions.
Definition: ds_data_item.h:95
const wxString * m_sheetLayer
Definition: ds_draw_item.h:578
wxPoint GetPosition() const override
Definition: ds_draw_item.h:171
const wxString * m_paperFormat
Definition: ds_draw_item.h:574
bool HitTest(const wxPoint &aPosition, int aAccuracy=0) const override
Test if aPosition is contained within or on the bounding box of an item.
Definition: ds_draw_item.h:91
Handle the component boundary box.
Definition: eda_rect.h:42
void SetProject(const PROJECT *aProject)
Definition: ds_draw_item.h:400
A base class for most all the KiCad significant classes used in schematics and boards.
Definition: eda_item.h:100
virtual wxString GetClass() const override
Return the class name.
Definition: ds_draw_item.h:217
std::vector< MSG_PANEL_ITEM > MSG_PANEL_ITEMS
Definition: msgpanel.h:97
void SetTitleBlock(const TITLE_BLOCK *aTblock)
Set the title block (mainly for drawing sheet editor)
Definition: ds_draw_item.h:405
void SetSheetCount(int aSheetCount)
Set the value of the count of sheets, for basic inscriptions.
Definition: ds_draw_item.h:468
wxString GetSelectMenuText(EDA_UNITS aUnits) const override
Return the text to display to be used in the selection clarification context menu when multiple items...
Store the list of graphic items: rect, lines, polygons and texts to draw/plot the title block and fra...
Definition: ds_draw_item.h:376
const wxPoint & GetTextPos() const
Definition: eda_text.h:247
const wxPoint & GetEnd() const
Definition: ds_draw_item.h:221
wxPoint GetPosition() const override
Definition: ds_draw_item.h:319
void SetTextThickness(int aWidth)
The TextThickness is that set by the user.
Definition: eda_text.h:159
virtual int GetPenWidth() const
Definition: ds_draw_item.h:70
void SetPosition(const wxPoint &aPos) override
Definition: ds_draw_item.h:139
void GetAllItems(std::vector< DS_DRAW_ITEM_BASE * > *aList)
Definition: ds_draw_item.h:504
bool HitTest(const wxPoint &aPosition, int aAccuracy=0) const override
Test if aPosition is contained within or on the bounding box of an item.
const EDA_RECT GetBoundingBox() const override=0
Return the orthogonal bounding box of this object for display purposes.
Message panel definition file.
DS_DRAW_ITEM_BASE * GetFirst()
Definition: ds_draw_item.h:484
bool HitTest(const wxPoint &aPosition, int aAccuracy=0) const override
Test if aPosition is contained within or on the bounding box of an item.
void SetBold(bool aBold)
Definition: eda_text.h:182
DS_DRAW_ITEM_RECT(DS_DATA_ITEM *aPeer, int aIndex, wxPoint aStart, wxPoint aEnd, int aPenWidth)
Definition: ds_draw_item.h:208
void PrintWsItem(const RENDER_SETTINGS *aSettings, const wxPoint &aOffset) override
const wxPoint & GetEnd() const
Definition: ds_draw_item.h:135
void Remove(DS_DRAW_ITEM_BASE *aItem)
Definition: ds_draw_item.h:478
wxString GetSelectMenuText(EDA_UNITS aUnits) const override
Return the text to display to be used in the selection clarification context menu when multiple items...
DS_DRAW_ITEM_PAGE(int aPenWidth, double aMarkerSize)
Definition: ds_draw_item.h:255
void PrintWsItem(const RENDER_SETTINGS *aSettings, const wxPoint &aOffset) override
const EDA_RECT GetBoundingBox() const override
Return the orthogonal bounding box of this object for display purposes.
bool HitTest(const wxPoint &aPosition, int aAccuracy=0) const override
Test if aPosition is contained within or on the bounding box of an item.
void SetEnd(const wxPoint &aPos) override
Definition: ds_draw_item.h:136
void SetPosition(const wxPoint &aPos) override