KiCad PCB EDA Suite
ws_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-2019 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 WS_DRAW_ITEM_H
26 #define WS_DRAW_ITEM_H
27 
28 #include <math/vector2d.h>
29 #include <eda_text.h>
30 #include <bitmap_base.h>
31 #include "msgpanel.h"
33 
34 #include <algorithm>
35 #include <vector>
36 
37 class WS_DATA_ITEM;
38 class TITLE_BLOCK;
39 class PAGE_INFO;
40 
41 /*
42  * Helper classes to handle basic graphic items used to draw/plot
43  * title blocks and frame references
44  * segments
45  * rect
46  * polygons (for logos)
47  * graphic texts
48  * bitmaps (also for logos, but they cannot be plot by SVG, GERBER or HPGL plotters
49  * where we just plot the bounding box)
50  */
51 class WS_DRAW_ITEM_BASE : public EDA_ITEM // This basic class, not directly usable.
52 {
53 protected:
54  WS_DATA_ITEM* m_peer; // the parent WS_DATA_ITEM item in the WS_DATA_MODEL
55  int m_index; // the index in the parent's repeat count
57 
58  WS_DRAW_ITEM_BASE( WS_DATA_ITEM* aPeer, int aIndex, KICAD_T aType ) :
59  EDA_ITEM( aType )
60  {
61  m_peer = aPeer;
62  m_index = aIndex;
63  m_penWidth = 0;
64  m_Flags = 0;
65  }
66 
67 public:
68  virtual ~WS_DRAW_ITEM_BASE() {}
69 
70  WS_DATA_ITEM* GetPeer() const { return m_peer; }
71  int GetIndexInPeer() const { return m_index; }
72 
73  void ViewGetLayers( int aLayers[], int& aCount ) const override;
74 
75  virtual void SetEnd( wxPoint aPos ) { /* not all types will need this */ }
76 
77  virtual int GetPenWidth() const
78  {
79  if( m_penWidth > 0 )
80  return m_penWidth;
81  else
82  return 1;
83  }
84 
85  // The function to print a WS_DRAW_ITEM
86  virtual void PrintWsItem( RENDER_SETTINGS* aSettings )
87  {
88  PrintWsItem( aSettings, wxPoint( 0, 0 ) );
89  }
90 
91  // More advanced version of DrawWsItem. This is what must be defined in the derived type.
92  virtual void PrintWsItem( RENDER_SETTINGS* aSettings, const wxPoint& aOffset ) = 0;
93 
94  // Derived types must define GetBoundingBox() as a minimum, and can then override the
95  // two HitTest() functions if they need something more specific.
96  const EDA_RECT GetBoundingBox() const override = 0;
97 
98  bool HitTest( const wxPoint& aPosition, int aAccuracy = 0 ) const override
99  {
100  // This is just here to prevent annoying compiler warnings about hidden overloaded
101  // virtual functions
102  return EDA_ITEM::HitTest( aPosition, aAccuracy );
103  }
104 
105  bool HitTest( const EDA_RECT& aRect, bool aContained, int aAccuracy = 0 ) const override;
106 
107  void GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, MSG_PANEL_ITEMS& aList ) override;
108 };
109 
110 
111 // This class draws a thick segment
113 {
114  wxPoint m_start; // start point of line/rect
115  wxPoint m_end; // end point
116 
117 public:
118  WS_DRAW_ITEM_LINE( WS_DATA_ITEM* aPeer, int aIndex, wxPoint aStart, wxPoint aEnd,
119  int aPenWidth ) :
120  WS_DRAW_ITEM_BASE( aPeer, aIndex, WSG_LINE_T )
121  {
122  m_start = aStart;
123  m_end = aEnd;
124  m_penWidth = aPenWidth;
125  }
126 
127  virtual wxString GetClass() const override { return wxT( "WS_DRAW_ITEM_LINE" ); }
128 
129  // Accessors:
130  const wxPoint& GetStart() const { return m_start; }
131  void SetStart( wxPoint aPos ) { m_start = aPos; }
132  const wxPoint& GetEnd() const { return m_end; }
133  void SetEnd( wxPoint aPos ) override { m_end = aPos; }
134 
135  wxPoint GetPosition() const override { return GetStart(); }
136  void SetPosition( const wxPoint& aPos ) override { SetStart( aPos ); }
137 
138  const EDA_RECT GetBoundingBox() const override;
139  bool HitTest( const wxPoint& aPosition, int aAccuracy = 0 ) const override;
140 
141  void PrintWsItem( RENDER_SETTINGS* aSettings, const wxPoint& aOffset ) override;
142 
143  wxString GetSelectMenuText( EDA_UNITS aUnits ) const override;
144 
145 #if defined(DEBUG)
146  void Show( int nestLevel, std::ostream& os ) const override { ShowDummy( os ); }
147 #endif
148 };
149 
150 // This class draws a polygon
152 {
153  wxPoint m_pos; // position of reference point, from the
154  // WS_DATA_ITEM_POLYGONS parent
155  // (used only in page layout editor to draw anchors)
156 
157 public:
162 
163 public:
164  WS_DRAW_ITEM_POLYPOLYGONS( WS_DATA_ITEM* aPeer, int aIndex, wxPoint aPos, int aPenWidth ) :
165  WS_DRAW_ITEM_BASE( aPeer, aIndex, WSG_POLY_T )
166  {
167  m_penWidth = aPenWidth;
168  m_pos = aPos;
169  }
170 
171  virtual wxString GetClass() const override { return wxT( "WS_DRAW_ITEM_POLYPOLYGONS" ); }
172 
173  // Accessors:
175  wxPoint GetPosition() const override { return m_pos; }
176  void SetPosition( const wxPoint& aPos ) override;
177 
178  const EDA_RECT GetBoundingBox() const override;
179  bool HitTest( const wxPoint& aPosition, int aAccuracy = 0 ) const override;
180  bool HitTest( const EDA_RECT& aRect, bool aContained, int aAccuracy = 0 ) const override;
181 
182  void PrintWsItem( RENDER_SETTINGS* aSettings, const wxPoint& aOffset ) override;
183 
184  wxString GetSelectMenuText( EDA_UNITS aUnits ) const override;
185 
186 #if defined(DEBUG)
187  void Show( int nestLevel, std::ostream& os ) const override { ShowDummy( os ); }
188 #endif
189 };
190 
191 // This class draws a not filled rectangle with thick segment
193 {
194  wxPoint m_start; // start point of line/rect
195  wxPoint m_end; // end point
196 
197 public:
198  WS_DRAW_ITEM_RECT( WS_DATA_ITEM* aPeer, int aIndex, wxPoint aStart, wxPoint aEnd,
199  int aPenWidth ) :
200  WS_DRAW_ITEM_BASE( aPeer, aIndex, WSG_RECT_T )
201  {
202  m_start = aStart;
203  m_end = aEnd;
204  m_penWidth = aPenWidth;
205  }
206 
207  virtual wxString GetClass() const override { return wxT( "WS_DRAW_ITEM_RECT" ); }
208 
209  // Accessors:
210  const wxPoint& GetStart() const { return m_start; }
211  void SetStart( wxPoint aPos ) { m_start = aPos; }
212  const wxPoint& GetEnd() const { return m_end; }
213  void SetEnd( wxPoint aPos ) override { m_end = aPos; }
214 
215  wxPoint GetPosition() const override { return GetStart(); }
216  void SetPosition( const wxPoint& aPos ) override { SetStart( aPos ); }
217 
218  void PrintWsItem( RENDER_SETTINGS* aSettings, const wxPoint& aOffset ) override;
219 
220  const EDA_RECT GetBoundingBox() const override;
221  bool HitTest( const wxPoint& aPosition, int aAccuracy = 0 ) const override;
222 
223  wxString GetSelectMenuText( EDA_UNITS aUnits ) const override;
224 
225 #if defined(DEBUG)
226  void Show( int nestLevel, std::ostream& os ) const override { ShowDummy( os ); }
227 #endif
228 };
229 
230 
231 // This class draws a rectangle with thick segment showing the page limits
232 // and a marker showing the coord origin. This only a draw item only.
233 // Therefore m_peer ( the parent WS_DATA_ITEM item in the WS_DATA_MODEL) is always a nullptr.
235 {
236  wxPoint m_markerPos; // position of the marker
237  wxSize m_pageSize; // full size of the page
238  double m_markerSize;
239 
240 public:
241  WS_DRAW_ITEM_PAGE( int aPenWidth, double aMarkerSize ) :
242  WS_DRAW_ITEM_BASE( nullptr, 0, WSG_PAGE_T )
243  {
244  m_penWidth = aPenWidth;
245  m_markerSize = aMarkerSize;
246  }
247 
248  virtual wxString GetClass() const override { return wxT( "WS_DRAW_ITEM_PAGE" ); }
249 
250  // Accessors:
251  void SetPageSize( wxSize aSize ) { m_pageSize = aSize; }
252  wxSize GetPageSize() const { return m_pageSize; }
253  const wxPoint& GetMarkerPos() const { return m_markerPos; }
254  void SetMarkerPos( wxPoint aPos ) { m_markerPos = aPos; }
255  double GetMarkerSize() const { return m_markerSize; }
256 
257  wxPoint GetPosition() const override { return wxPoint( 0, 0 ); }
258  void SetPosition( const wxPoint& aPos ) override { /* do nothing */ }
259 
260  void PrintWsItem( RENDER_SETTINGS* , const wxPoint& ) override { /* do nothing */ }
261 
262  const EDA_RECT GetBoundingBox() const override;
263  bool HitTest( const wxPoint& aPosition, int aAccuracy = 0 ) const override { return false; }
264 
265  wxString GetSelectMenuText( EDA_UNITS aUnits ) const override;
266 
267 #if defined(DEBUG)
268  void Show( int nestLevel, std::ostream& os ) const override { ShowDummy( os ); }
269 #endif
270 };
271 
272 // This class draws a graphic text.
273 // it is derived from an EDA_TEXT, so it handle all caracteristics
274 // of this graphic text (justification, rotation ... )
276 {
277 public:
278  WS_DRAW_ITEM_TEXT( WS_DATA_ITEM* aPeer, int aIndex, wxString& aText, wxPoint aPos,
279  wxSize aSize, int aPenWidth, bool aItalic = false,
280  bool aBold = false ) :
281  WS_DRAW_ITEM_BASE( aPeer, aIndex, WSG_TEXT_T),
282  EDA_TEXT( aText )
283  {
284  SetTextPos( aPos );
285  SetTextSize( aSize );
286  SetTextThickness( aPenWidth );
287  SetItalic( aItalic );
288  SetBold( aBold );
289  }
290 
291  virtual wxString GetClass() const override { return wxT( "WS_DRAW_ITEM_TEXT" ); }
292 
293  void PrintWsItem( RENDER_SETTINGS* aSettings, const wxPoint& aOffset ) override;
294 
295  void SetTextAngle( double aAngle ) override
296  {
298  }
299 
300  wxPoint GetPosition() const override { return GetTextPos(); }
301  void SetPosition( const wxPoint& aPos ) override { SetTextPos( aPos ); }
302 
303  const EDA_RECT GetBoundingBox() const override;
304  bool HitTest( const wxPoint& aPosition, int aAccuracy = 0 ) const override;
305  bool HitTest( const EDA_RECT& aRect, bool aContained, int aAccuracy = 0 ) const override;
306 
307  wxString GetSelectMenuText( EDA_UNITS aUnits ) const override;
308 
309 #if defined(DEBUG)
310  void Show( int nestLevel, std::ostream& os ) const override { ShowDummy( os ); }
311 #endif
312 };
313 
314 // This class draws a bitmap.
316 {
317  wxPoint m_pos; // position of reference point
318 
319 public:
320  WS_DRAW_ITEM_BITMAP( WS_DATA_ITEM* aPeer, int aIndex, wxPoint aPos ) :
321  WS_DRAW_ITEM_BASE( aPeer, aIndex, WSG_BITMAP_T )
322  {
323  m_pos = aPos;
324  }
325 
327 
328  virtual wxString GetClass() const override { return wxT( "WS_DRAW_ITEM_BITMAP" ); }
329 
330  wxPoint GetPosition() const override { return m_pos; }
331  void SetPosition( const wxPoint& aPos ) override { m_pos = aPos; }
332 
333  void PrintWsItem( RENDER_SETTINGS* aSettings, const wxPoint& aOffset ) override;
334 
335  bool HitTest( const wxPoint& aPosition, int aAccuracy = 0 ) const override;
336  bool HitTest( const EDA_RECT& aRect, bool aContained, int aAccuracy = 0 ) const override;
337  const EDA_RECT GetBoundingBox() const override;
338 
339  wxString GetSelectMenuText( EDA_UNITS aUnits ) const override;
340 
341 #if defined(DEBUG)
342  void Show( int nestLevel, std::ostream& os ) const override { ShowDummy( os ); }
343 #endif
344 };
345 
346 /*
347  * this class stores the list of graphic items:
348  * rect, lines, polygons and texts to draw/plot
349  * the title block and frame references, and parameters to
350  * draw/plot them
351  */
353 {
354 protected:
355  std::vector <WS_DRAW_ITEM_BASE*> m_graphicList; // Items to draw/plot
356  unsigned m_idx; // for GetFirst, GetNext functions
357  double m_milsToIu; // the scalar to convert pages units ( mils)
358  // to draw/plot units.
359  int m_penSize; // The default line width for drawings.
360  // used when an item has a pen size = 0
361  int m_sheetNumber; // the value of the sheet number, for basic inscriptions
362  int m_sheetCount; // the value of the number of sheets, in schematic
363  // for basic inscriptions, in schematic
364  const TITLE_BLOCK* m_titleBlock; // for basic inscriptions
365  const wxString* m_paperFormat; // for basic inscriptions
366  wxString m_fileName; // for basic inscriptions
367  wxString m_sheetFullName; // for basic inscriptions
368  const wxString* m_sheetLayer; // for basic inscriptions
369  const PROJECT* m_project; // for project-based variable substitutions
370 
371 public:
373  {
374  m_idx = 0;
375  m_milsToIu = 1.0;
376  m_penSize = 1;
377  m_sheetNumber = 1;
378  m_sheetCount = 1;
379  m_sheetLayer = nullptr;
380  m_titleBlock = nullptr;
381  m_paperFormat = nullptr;
382  m_project = nullptr;
383  }
384 
386  {
387  // Items in the m_graphicList are owned by their respective WORKSHEET_DATAITEMs.
388  // for( WS_DRAW_ITEM_BASE* item : m_graphicList )
389  // delete item;
390  }
391 
392  void SetProject( const PROJECT* aProject ) { m_project = aProject; }
393 
397  void SetTitleBlock( const TITLE_BLOCK* aTblock ) { m_titleBlock = aTblock; }
398 
402  void SetPaperFormat( const wxString* aFormatName ) { m_paperFormat = aFormatName; }
403 
407  void SetFileName( const wxString& aFileName )
408  {
409  m_fileName = aFileName;
410  }
411 
415  void SetSheetName( const wxString& aSheetName )
416  {
417  m_sheetFullName = aSheetName;
418  }
419 
423  void SetSheetLayer( const wxString& aSheetLayer )
424  {
425  m_sheetLayer = &aSheetLayer;
426  }
427 
428  void SetDefaultPenSize( int aPenSize ) { m_penSize = aPenSize; }
429  int GetDefaultPenSize() const { return m_penSize; }
430 
435  void SetMilsToIUfactor( double aScale )
436  {
437  m_milsToIu = aScale;
438  }
439 
444  void SetSheetNumber( int aSheetNumber )
445  {
446  m_sheetNumber = aSheetNumber;
447  }
448 
453  void SetSheetCount( int aSheetCount )
454  {
455  m_sheetCount = aSheetCount;
456  }
457 
458  void Append( WS_DRAW_ITEM_BASE* aItem )
459  {
460  m_graphicList.push_back( aItem );
461  }
462 
463  void Remove( WS_DRAW_ITEM_BASE* aItem )
464  {
465  auto newEnd = std::remove( m_graphicList.begin(), m_graphicList.end(), aItem );
466  m_graphicList.erase( newEnd, m_graphicList.end() );
467  }
468 
470  {
471  m_idx = 0;
472 
473  if( m_graphicList.size() )
474  return m_graphicList[0];
475  else
476  return NULL;
477  }
478 
480  {
481  m_idx++;
482 
483  if( m_graphicList.size() > m_idx )
484  return m_graphicList[m_idx];
485  else
486  return NULL;
487  }
488 
489  void GetAllItems( std::vector<WS_DRAW_ITEM_BASE*>* aList )
490  {
491  *aList = m_graphicList;
492  }
493 
497  void Print( RENDER_SETTINGS* aSettings );
498 
516  void BuildWorkSheetGraphicList( const PAGE_INFO& aPageInfo, const TITLE_BLOCK& aTitleBlock );
517 
518  static void GetTextVars( wxArrayString* aVars );
519 
548  wxString BuildFullText( const wxString& aTextbase );
549 };
550 
551 
552 #endif // WS_DRAW_ITEM_H
const wxPoint & GetStart() const
Definition: ws_draw_item.h:210
void PrintWsItem(RENDER_SETTINGS *aSettings, const wxPoint &aOffset) override
void SetPosition(const wxPoint &aPos) override
Definition: ws_draw_item.h:331
EDA_UNITS
Definition: common.h:198
WS_DATA_ITEM * GetPeer() const
Definition: ws_draw_item.h:70
const wxPoint & GetEnd() const
Definition: ws_draw_item.h:212
virtual ~WS_DRAW_ITEM_BASE()
Definition: ws_draw_item.h:68
void Remove(WS_DRAW_ITEM_BASE *aItem)
Definition: ws_draw_item.h:463
const wxString * m_paperFormat
Definition: ws_draw_item.h:365
WS_DRAW_ITEM_PAGE(int aPenWidth, double aMarkerSize)
Definition: ws_draw_item.h:241
void SetDefaultPenSize(int aPenSize)
Definition: ws_draw_item.h:428
bool HitTest(const wxPoint &aPosition, int aAccuracy=0) const override
Function HitTest tests if aPosition is contained within or on the bounding box of an item.
void SetFileName(const wxString &aFileName)
Set the filename to draw/plot.
Definition: ws_draw_item.h:407
const EDA_RECT GetBoundingBox() const override
Function GetBoundingBox returns the orthogonal, bounding box of this object for display purposes.
WS_DRAW_ITEM_POLYPOLYGONS(WS_DATA_ITEM *aPeer, int aIndex, wxPoint aPos, int aPenWidth)
Definition: ws_draw_item.h:164
void SetPosition(const wxPoint &aPos) override
Definition: ws_draw_item.h:136
const EDA_RECT GetBoundingBox() const override
Function GetBoundingBox returns the orthogonal, bounding box of this object for display purposes.
PROJECT holds project specific data.
Definition: project.h:61
virtual void PrintWsItem(RENDER_SETTINGS *aSettings)
Definition: ws_draw_item.h:86
void PrintWsItem(RENDER_SETTINGS *aSettings, const wxPoint &aOffset) override
Work sheet structure type definitions.
Definition: ws_data_item.h:93
RENDER_SETTINGS Contains all the knowledge about how graphical objects are drawn on any output surfac...
void SetPosition(const wxPoint &aPos) override
Definition: ws_draw_item.h:258
const wxPoint & GetEnd() const
Definition: ws_draw_item.h:132
void SetStart(wxPoint aPos)
Definition: ws_draw_item.h:131
virtual wxString GetClass() const override
Function GetClass returns the class name.
Definition: ws_draw_item.h:171
const EDA_RECT GetBoundingBox() const override
Function GetBoundingBox returns the orthogonal, bounding box of this object for display purposes.
SHAPE_POLY_SET & GetPolygons()
Definition: ws_draw_item.h:174
wxPoint GetPosition() const override
Definition: ws_draw_item.h:215
bool HitTest(const wxPoint &aPosition, int aAccuracy=0) const override
Function HitTest tests if aPosition is contained within or on the bounding box of an item.
WS_DRAW_ITEM_BASE * GetNext()
Definition: ws_draw_item.h:479
void SetItalic(bool isItalic)
Definition: eda_text.h:179
void GetAllItems(std::vector< WS_DRAW_ITEM_BASE * > *aList)
Definition: ws_draw_item.h:489
const PROJECT * m_project
Definition: ws_draw_item.h:369
void SetSheetLayer(const wxString &aSheetLayer)
Set the sheet layer to draw/plot.
Definition: ws_draw_item.h:423
void SetTextPos(const wxPoint &aPoint)
Definition: eda_text.h:247
void SetStart(wxPoint aPos)
Definition: ws_draw_item.h:211
void SetSheetName(const wxString &aSheetName)
Set the sheet name to draw/plot.
Definition: ws_draw_item.h:415
const TITLE_BLOCK * m_titleBlock
Definition: ws_draw_item.h:364
SHAPE_POLY_SET m_Polygons
The list of polygons.
Definition: ws_draw_item.h:161
WS_DRAW_ITEM_BASE * GetFirst()
Definition: ws_draw_item.h:469
void SetTextSize(const wxSize &aNewSize)
Definition: eda_text.h:238
const EDA_RECT GetBoundingBox() const override
Function GetBoundingBox returns the orthogonal, bounding box of this object for display purposes.
The base class for create windows for drawing purpose.
wxPoint GetPosition() const override
Definition: ws_draw_item.h:330
int GetIndexInPeer() const
Definition: ws_draw_item.h:71
TITLE_BLOCK holds the information shown in the lower right corner of a plot, printout,...
Definition: title_block.h:40
const wxString * m_sheetLayer
Definition: ws_draw_item.h:368
bool HitTest(const wxPoint &aPosition, int aAccuracy=0) const override
Function HitTest tests if aPosition is contained within or on the bounding box of an item.
void Append(WS_DRAW_ITEM_BASE *aItem)
Definition: ws_draw_item.h:458
KICAD_T
Enum KICAD_T is the set of class identification values, stored in EDA_ITEM::m_StructType.
Definition: typeinfo.h:78
void ViewGetLayers(int aLayers[], int &aCount) const override
Function ViewGetLayers() Returns the all the layers within the VIEW the object is painted on.
void SetPosition(const wxPoint &aPos) override
void SetTextAngle(double aAngle) override
Definition: ws_draw_item.h:295
virtual wxString GetClass() const override
Function GetClass returns the class name.
Definition: ws_draw_item.h:127
A mix-in class (via multiple inheritance) that handles texts such as labels, parts,...
Definition: eda_text.h:113
virtual bool HitTest(const wxPoint &aPosition, int aAccuracy=0) const
Function HitTest tests if aPosition is contained within or on the bounding box of an item.
Definition: base_struct.h:307
void SetMarkerPos(wxPoint aPos)
Definition: ws_draw_item.h:254
virtual wxString GetClass() const override
Function GetClass returns the class name.
Definition: ws_draw_item.h:291
WS_DRAW_ITEM_TEXT(WS_DATA_ITEM *aPeer, int aIndex, wxString &aText, wxPoint aPos, wxSize aSize, int aPenWidth, bool aItalic=false, bool aBold=false)
Definition: ws_draw_item.h:278
WS_DRAW_ITEM_LINE(WS_DATA_ITEM *aPeer, int aIndex, wxPoint aStart, wxPoint aEnd, int aPenWidth)
Definition: ws_draw_item.h:118
virtual wxString GetClass() const override
Function GetClass returns the class name.
Definition: ws_draw_item.h:248
wxString GetSelectMenuText(EDA_UNITS aUnits) const override
Function GetSelectMenuText returns the text to display to be used in the selection clarification cont...
void PrintWsItem(RENDER_SETTINGS *aSettings, const wxPoint &aOffset) override
const EDA_RECT GetBoundingBox() const override=0
Function GetBoundingBox returns the orthogonal, bounding box of this object for display purposes.
void SetEnd(wxPoint aPos) override
Definition: ws_draw_item.h:213
WS_DATA_ITEM * m_peer
Definition: ws_draw_item.h:54
#define NULL
void BuildWorkSheetGraphicList(const PAGE_INFO &aPageInfo, const TITLE_BLOCK &aTitleBlock)
Function BuildWorkSheetGraphicList is a core function for drawing or plotting the page layout with th...
void SetTitleBlock(const TITLE_BLOCK *aTblock)
Set the title block (mainly for page layout editor)
Definition: ws_draw_item.h:397
void SetSheetCount(int aSheetCount)
Function SetSheetCount Set the value of the count of sheets, for basic inscriptions.
Definition: ws_draw_item.h:453
WS_DRAW_ITEM_BITMAP(WS_DATA_ITEM *aPeer, int aIndex, wxPoint aPos)
Definition: ws_draw_item.h:320
SHAPE_POLY_SET.
PAGE_INFO describes the page size and margins of a paper page on which to eventually print or plot.
Definition: page_info.h:54
const wxPoint & GetStart() const
Definition: ws_draw_item.h:130
bool HitTest(const wxPoint &aPosition, int aAccuracy=0) const override
Function HitTest tests if aPosition is contained within or on the bounding box of an item.
Definition: ws_draw_item.h:98
void SetMilsToIUfactor(double aScale)
Function SetMilsToIUfactor Set the scalar to convert pages units (mils) to draw/plot units.
Definition: ws_draw_item.h:435
wxString GetSelectMenuText(EDA_UNITS aUnits) const override
Function GetSelectMenuText returns the text to display to be used in the selection clarification cont...
wxPoint GetPosition() const override
Definition: ws_draw_item.h:257
virtual void SetEnd(wxPoint aPos)
Definition: ws_draw_item.h:75
bool HitTest(const wxPoint &aPosition, int aAccuracy=0) const override
Function HitTest tests if aPosition is contained within or on the bounding box of an item.
void PrintWsItem(RENDER_SETTINGS *aSettings, const wxPoint &aOffset) override
virtual int GetPenWidth() const
Definition: ws_draw_item.h:77
wxString m_sheetFullName
Definition: ws_draw_item.h:367
void SetPageSize(wxSize aSize)
Definition: ws_draw_item.h:251
bool HitTest(const wxPoint &aPosition, int aAccuracy=0) const override
Function HitTest tests if aPosition is contained within or on the bounding box of an item.
Definition: ws_draw_item.h:263
WS_DRAW_ITEM_BASE(WS_DATA_ITEM *aPeer, int aIndex, KICAD_T aType)
Definition: ws_draw_item.h:58
void PrintWsItem(RENDER_SETTINGS *aSettings, const wxPoint &aOffset) override
WS_DRAW_ITEM_RECT(WS_DATA_ITEM *aPeer, int aIndex, wxPoint aStart, wxPoint aEnd, int aPenWidth)
Definition: ws_draw_item.h:198
wxSize GetPageSize() const
Definition: ws_draw_item.h:252
wxPoint GetPosition() const override
Definition: ws_draw_item.h:300
void Print(RENDER_SETTINGS *aSettings)
Draws the item list created by BuildWorkSheetGraphicList.
wxString GetSelectMenuText(EDA_UNITS aUnits) const override
Function GetSelectMenuText returns the text to display to be used in the selection clarification cont...
void SetSheetNumber(int aSheetNumber)
Function SetSheetNumber Set the value of the sheet number, for basic inscriptions.
Definition: ws_draw_item.h:444
virtual wxString GetClass() const override
Function GetClass returns the class name.
Definition: ws_draw_item.h:328
wxString BuildFullText(const wxString &aTextbase)
Function BuildFullText returns the full text corresponding to the aTextbase, after replacing format s...
Definition: ws_painter.cpp:117
wxPoint GetPosition() const override
Definition: ws_draw_item.h:135
STATUS_FLAGS m_Flags
Definition: base_struct.h:176
std::vector< WS_DRAW_ITEM_BASE * > m_graphicList
Definition: ws_draw_item.h:355
EDA_RECT handles the component boundary box.
Definition: eda_rect.h:44
const EDA_RECT GetBoundingBox() const override
Function GetBoundingBox returns the orthogonal, bounding box of this object for display purposes.
double GetMarkerSize() const
Definition: ws_draw_item.h:255
EDA_ITEM is a base class for most all the KiCad significant classes, used in schematics and boards.
Definition: base_struct.h:159
std::vector< MSG_PANEL_ITEM > MSG_PANEL_ITEMS
Definition: msgpanel.h:102
void SetPaperFormat(const wxString *aFormatName)
Set the paper format name (mainly for page layout editor)
Definition: ws_draw_item.h:402
const wxPoint & GetTextPos() const
Definition: eda_text.h:248
void GetMsgPanelInfo(EDA_DRAW_FRAME *aFrame, MSG_PANEL_ITEMS &aList) override
void SetPosition(const wxPoint &aPos) override
Definition: ws_draw_item.h:216
wxPoint GetPosition() const override
Definition: ws_draw_item.h:175
wxString GetSelectMenuText(EDA_UNITS aUnits) const override
Function GetSelectMenuText returns the text to display to be used in the selection clarification cont...
void SetTextThickness(int aWidth)
The TextThickness is that set by the user.
Definition: eda_text.h:158
void SetPosition(const wxPoint &aPos) override
Definition: ws_draw_item.h:301
bool HitTest(const wxPoint &aPosition, int aAccuracy=0) const override
Function HitTest tests if aPosition is contained within or on the bounding box of an item.
virtual void SetTextAngle(double aAngle)
Definition: eda_text.h:167
void PrintWsItem(RENDER_SETTINGS *, const wxPoint &) override
Definition: ws_draw_item.h:260
wxString GetSelectMenuText(EDA_UNITS aUnits) const override
Function GetSelectMenuText returns the text to display to be used in the selection clarification cont...
void SetProject(const PROJECT *aProject)
Definition: ws_draw_item.h:392
T NormalizeAngle360Min(T Angle)
Normalize angle to be > -360.0 and < 360.0 Angle equal to -360 or +360 are set to 0.
Definition: trigo.h:242
Message panel definition file.
const EDA_RECT GetBoundingBox() const override
Function GetBoundingBox returns the orthogonal, bounding box of this object for display purposes.
void SetBold(bool aBold)
Definition: eda_text.h:182
int GetDefaultPenSize() const
Definition: ws_draw_item.h:429
const wxPoint & GetMarkerPos() const
Definition: ws_draw_item.h:253
virtual wxString GetClass() const override
Function GetClass returns the class name.
Definition: ws_draw_item.h:207
void SetEnd(wxPoint aPos) override
Definition: ws_draw_item.h:133
static void GetTextVars(wxArrayString *aVars)
Definition: ws_painter.cpp:89
wxString GetSelectMenuText(EDA_UNITS aUnits) const override
Function GetSelectMenuText returns the text to display to be used in the selection clarification cont...