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