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 <eda_text.h>
31 #include <bitmap_base.h>
32 #include "msgpanel.h"
34 
35 class WS_DATA_ITEM;
36 class TITLE_BLOCK;
37 class PAGE_INFO;
38 
39 /*
40  * Helper classes to handle basic graphic items used to draw/plot
41  * title blocks and frame references
42  * segments
43  * rect
44  * polygons (for logos)
45  * graphic texts
46  * bitmaps (also for logos, but they cannot be plot by SVG, GERBER or HPGL plotters
47  * where we just plot the bounding box)
48  */
49 class WS_DRAW_ITEM_BASE : public EDA_ITEM // This basic class, not directly usable.
50 {
51 protected:
52  WS_DATA_ITEM* m_peer; // the parent WS_DATA_ITEM item in the WS_DATA_MODEL
53  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_Flags = 0;
61  }
62 
63 public:
64  virtual ~WS_DRAW_ITEM_BASE() {}
65 
66  WS_DATA_ITEM* GetPeer() const { return m_peer; }
67  int GetIndexInPeer() const { return m_index; }
68 
69  void ViewGetLayers( int aLayers[], int& aCount ) const override;
70 
71  virtual const wxPoint GetPosition() const = 0;
72  virtual void SetPosition( wxPoint aPos ) = 0;
73  virtual void SetEnd( wxPoint aPos ) { /* not all types will need this */ }
74 
75  // The function to print a WS_DRAW_ITEM
76  virtual void PrintWsItem( wxDC* aDC, COLOR4D aColor )
77  {
78  PrintWsItem( aDC, wxPoint( 0, 0 ), aColor );
79  }
80 
81  // More advanced version of DrawWsItem. This is what must be defined in the derived type.
82  virtual void PrintWsItem( wxDC* aDC, const wxPoint& aOffset, COLOR4D aColor ) = 0;
83 
84  // Derived types must define GetBoundingBox() as a minimum, and can then override the
85  // two HitTest() functions if they need something more specific.
86  const EDA_RECT GetBoundingBox() const override = 0;
87 
88  bool HitTest( const wxPoint& aPosition, int aAccuracy = 0 ) const override
89  {
90  // This is just here to prevent annoying compiler warnings about hidden overloaded
91  // virtual functions
92  return EDA_ITEM::HitTest( aPosition, aAccuracy );
93  }
94 
95  bool HitTest( const EDA_RECT& aRect, bool aContained, int aAccuracy = 0 ) const override;
96 
97  void GetMsgPanelInfo( EDA_UNITS_T aUnits, MSG_PANEL_ITEMS& aList ) override;
98 };
99 
100 
101 // This class draws a thick segment
103 {
104  wxPoint m_start; // start point of line/rect
105  wxPoint m_end; // end point
107 
108 public:
109  WS_DRAW_ITEM_LINE( WS_DATA_ITEM* aPeer, int aIndex, wxPoint aStart, wxPoint aEnd,
110  int aPenWidth ) :
111  WS_DRAW_ITEM_BASE( aPeer, aIndex, WSG_LINE_T )
112  {
113  m_start = aStart;
114  m_end = aEnd;
115  m_penWidth = aPenWidth;
116  }
117 
118  virtual wxString GetClass() const override { return wxT( "WS_DRAW_ITEM_LINE" ); }
119 
120  // Accessors:
121  int GetPenWidth() const { return m_penWidth; }
122  const wxPoint& GetStart() const { return m_start; }
123  void SetStart( wxPoint aPos ) { m_start = aPos; }
124  const wxPoint& GetEnd() const { return m_end; }
125  void SetEnd( wxPoint aPos ) override { m_end = aPos; }
126 
127  const wxPoint GetPosition() const override { return GetStart(); }
128  void SetPosition( wxPoint aPos ) override { SetStart( aPos ); }
129 
130  const EDA_RECT GetBoundingBox() const override;
131  bool HitTest( const wxPoint& aPosition, int aAccuracy = 0 ) const override;
132 
133  void PrintWsItem( wxDC* aDC, const wxPoint& aOffset, COLOR4D aColor ) override;
134 
135  wxString GetSelectMenuText( EDA_UNITS_T aUnits ) const override;
136 
137 #if defined(DEBUG)
138  void Show( int nestLevel, std::ostream& os ) const override { ShowDummy( os ); }
139 #endif
140 };
141 
142 // This class draws a polygon
144 {
145  wxPoint m_pos; // position of reference point, from the
146  // WS_DATA_ITEM_POLYGONS parent
147  // (used only in page layout editor to draw anchors)
149 
150 public:
155 
156 public:
157  WS_DRAW_ITEM_POLYPOLYGONS( WS_DATA_ITEM* aPeer, int aIndex, wxPoint aPos, int aPenWidth ) :
158  WS_DRAW_ITEM_BASE( aPeer, aIndex, WSG_POLY_T )
159  {
160  m_penWidth = aPenWidth;
161  m_pos = aPos;
162  }
163 
164  virtual wxString GetClass() const override { return wxT( "WS_DRAW_ITEM_POLYPOLYGONS" ); }
165 
166  // Accessors:
168  int GetPenWidth() const { return m_penWidth; }
169  const wxPoint GetPosition() const override { return m_pos; }
170  void SetPosition( wxPoint aPos ) override;
171 
172  const EDA_RECT GetBoundingBox() const override;
173  bool HitTest( const wxPoint& aPosition, int aAccuracy = 0 ) const override;
174  bool HitTest( const EDA_RECT& aRect, bool aContained, int aAccuracy = 0 ) const override;
175 
176  void PrintWsItem( wxDC* aDC, const wxPoint& aOffset, COLOR4D aColor ) override;
177 
178  wxString GetSelectMenuText( EDA_UNITS_T aUnits ) const override;
179 
180 #if defined(DEBUG)
181  void Show( int nestLevel, std::ostream& os ) const override { ShowDummy( os ); }
182 #endif
183 };
184 
185 // This class draws a not filled rectangle with thick segment
187 {
188  wxPoint m_start; // start point of line/rect
189  wxPoint m_end; // end point
191 
192 public:
193  WS_DRAW_ITEM_RECT( WS_DATA_ITEM* aPeer, int aIndex, wxPoint aStart, wxPoint aEnd,
194  int aPenWidth ) :
195  WS_DRAW_ITEM_BASE( aPeer, aIndex, WSG_RECT_T )
196  {
197  m_start = aStart;
198  m_end = aEnd;
199  m_penWidth = aPenWidth;
200  }
201 
202  virtual wxString GetClass() const override { return wxT( "WS_DRAW_ITEM_RECT" ); }
203 
204  // Accessors:
205  int GetPenWidth() const { return m_penWidth; }
206  const wxPoint& GetStart() const { return m_start; }
207  void SetStart( wxPoint aPos ) { m_start = aPos; }
208  const wxPoint& GetEnd() const { return m_end; }
209  void SetEnd( wxPoint aPos ) override { m_end = aPos; }
210 
211  const wxPoint GetPosition() const override { return GetStart(); }
212  void SetPosition( wxPoint aPos ) override { SetStart( aPos ); }
213 
214  void PrintWsItem( wxDC* aDC, const wxPoint& aOffset, COLOR4D aColor ) override;
215 
216  const EDA_RECT GetBoundingBox() const override;
217  bool HitTest( const wxPoint& aPosition, int aAccuracy = 0 ) const override;
218 
219  wxString GetSelectMenuText( EDA_UNITS_T aUnits ) const override;
220 
221 #if defined(DEBUG)
222  void Show( int nestLevel, std::ostream& os ) const override { ShowDummy( os ); }
223 #endif
224 };
225 
226 
227 // This class draws a rectangle with thick segment showing the page limits
228 // and a marker showing the coord origin. This only a draw item only.
229 // Therefore m_peer ( the parent WS_DATA_ITEM item in the WS_DATA_MODEL) is always a nullptr.
231 {
232  wxPoint m_markerPos; // position of the marker
233  wxSize m_pageSize; // full size of the page
235  double m_markerSize;
236 
237 public:
238  WS_DRAW_ITEM_PAGE( int aPenWidth, double aMarkerSize ) :
239  WS_DRAW_ITEM_BASE( nullptr, 0, WSG_PAGE_T )
240  {
241  m_penWidth = aPenWidth;
242  m_markerSize = aMarkerSize;
243  }
244 
245  virtual wxString GetClass() const override { return wxT( "WS_DRAW_ITEM_PAGE" ); }
246 
247  // Accessors:
248  int GetPenWidth() const { return m_penWidth; }
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( wxDC* aDC, const wxPoint& aOffset, COLOR4D aColor ) 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_T 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, bool aBold = false ) :
278  WS_DRAW_ITEM_BASE( aPeer, aIndex, WSG_TEXT_T),
279  EDA_TEXT( aText )
280  {
281  SetTextPos( aPos );
282  SetTextSize( aSize );
283  SetThickness( aPenWidth );
284  SetItalic( aItalic );
285  SetBold( aBold );
286  }
287 
288  virtual wxString GetClass() const override { return wxT( "WS_DRAW_ITEM_TEXT" ); }
289 
290  void PrintWsItem( wxDC* aDC, const wxPoint& aOffset, COLOR4D aColor ) override;
291 
292  // Accessors:
293  int GetPenWidth() { return GetThickness(); }
294 
295  void SetTextAngle( double aAngle )
296  {
298  }
299 
300  const wxPoint GetPosition() const override { return GetTextPos(); }
301  void SetPosition( 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_T 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  const wxPoint GetPosition() const override { return m_pos; }
331  void SetPosition( wxPoint aPos ) override { m_pos = aPos; }
332 
333  void PrintWsItem( wxDC* aDC, const wxPoint& aOffset, COLOR4D aColor ) 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_T 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 
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  }
383 
385  {
386  // Items in the m_graphicList are owned by their respective WORKSHEET_DATAITEMs.
387  // for( WS_DRAW_ITEM_BASE* item : m_graphicList )
388  // delete item;
389  }
390 
394  void SetTitleBlock( const TITLE_BLOCK* aTblock ) { m_titleBlock = aTblock; }
395 
399  void SetPaperFormat( const wxString* aFormatName ) { m_paperFormat = aFormatName; }
400 
404  void SetFileName( const wxString& aFileName )
405  {
406  m_fileName = aFileName;
407  }
408 
412  void SetSheetName( const wxString& aSheetName )
413  {
414  m_sheetFullName = aSheetName;
415  }
416 
420  void SetSheetLayer( const wxString& aSheetLayer )
421  {
422  m_sheetLayer = &aSheetLayer;
423  }
424 
425  void SetDefaultPenSize( int aPenSize ) { m_penSize = aPenSize; }
426  int GetDefaultPenSize() const { return m_penSize; }
427 
432  void SetMilsToIUfactor( double aScale )
433  {
434  m_milsToIu = aScale;
435  }
436 
441  void SetSheetNumber( int aSheetNumber )
442  {
443  m_sheetNumber = aSheetNumber;
444  }
445 
450  void SetSheetCount( int aSheetCount )
451  {
452  m_sheetCount = aSheetCount;
453  }
454 
455  void Append( WS_DRAW_ITEM_BASE* aItem )
456  {
457  m_graphicList.push_back( aItem );
458  }
459 
460  void Remove( WS_DRAW_ITEM_BASE* aItem )
461  {
462  auto newEnd = std::remove( m_graphicList.begin(), m_graphicList.end(), aItem );
463  m_graphicList.erase( newEnd, m_graphicList.end() );
464  }
465 
467  {
468  m_idx = 0;
469 
470  if( m_graphicList.size() )
471  return m_graphicList[0];
472  else
473  return NULL;
474  }
475 
477  {
478  m_idx++;
479 
480  if( m_graphicList.size() > m_idx )
481  return m_graphicList[m_idx];
482  else
483  return NULL;
484  }
485 
486  void GetAllItems( std::vector<WS_DRAW_ITEM_BASE*>* aList )
487  {
488  *aList = m_graphicList;
489  }
490 
495  void Print( wxDC* aDC, COLOR4D aColor );
496 
514  void BuildWorkSheetGraphicList( const PAGE_INFO& aPageInfo, const TITLE_BLOCK& aTitleBlock );
515 
544  wxString BuildFullText( const wxString& aTextbase );
545 };
546 
547 
548 #endif // WS_DRAW_ITEM_H
const wxPoint & GetStart() const
Definition: ws_draw_item.h:206
void SetTextAngle(double aAngle)
Definition: eda_text.h:150
WS_DATA_ITEM * GetPeer() const
Definition: ws_draw_item.h:66
const wxPoint & GetEnd() const
Definition: ws_draw_item.h:208
virtual ~WS_DRAW_ITEM_BASE()
Definition: ws_draw_item.h:64
void PrintWsItem(wxDC *aDC, const wxPoint &aOffset, COLOR4D aColor) override
void Remove(WS_DRAW_ITEM_BASE *aItem)
Definition: ws_draw_item.h:460
const wxString * m_paperFormat
Definition: ws_draw_item.h:365
WS_DRAW_ITEM_PAGE(int aPenWidth, double aMarkerSize)
Definition: ws_draw_item.h:238
void SetDefaultPenSize(int aPenSize)
Definition: ws_draw_item.h:425
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:404
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:157
const EDA_RECT GetBoundingBox() const override
Function GetBoundingBox returns the orthogonal, bounding box of this object for display purposes.
void SetPosition(wxPoint aPos) override
Definition: ws_draw_item.h:212
Work sheet structure type definitions.
Definition: ws_data_item.h:93
const wxPoint & GetEnd() const
Definition: ws_draw_item.h:124
void SetStart(wxPoint aPos)
Definition: ws_draw_item.h:123
virtual wxString GetClass() const override
Function GetClass returns the class name.
Definition: ws_draw_item.h:164
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:167
int GetPenWidth() const
Definition: ws_draw_item.h:205
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:476
const wxPoint GetPosition() const override
Definition: ws_draw_item.h:255
void SetItalic(bool isItalic)
Definition: eda_text.h:163
virtual void SetPosition(wxPoint aPos)=0
const wxPoint GetPosition() const override
Definition: ws_draw_item.h:169
void GetAllItems(std::vector< WS_DRAW_ITEM_BASE * > *aList)
Definition: ws_draw_item.h:486
void SetSheetLayer(const wxString &aSheetLayer)
Set the sheet layer to draw/plot.
Definition: ws_draw_item.h:420
void SetTextPos(const wxPoint &aPoint)
Definition: eda_text.h:231
void SetStart(wxPoint aPos)
Definition: ws_draw_item.h:207
void SetSheetName(const wxString &aSheetName)
Set the sheet name to draw/plot.
Definition: ws_draw_item.h:412
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:154
int GetThickness() const
Function GetThickness returns pen width.
Definition: eda_text.h:148
wxString GetSelectMenuText(EDA_UNITS_T aUnits) const override
Function GetSelectMenuText returns the text to display to be used in the selection clarification cont...
WS_DRAW_ITEM_BASE * GetFirst()
Definition: ws_draw_item.h:466
void SetTextSize(const wxSize &aNewSize)
Definition: eda_text.h:222
void SetPosition(wxPoint aPos) override
Definition: ws_draw_item.h:128
void PrintWsItem(wxDC *aDC, const wxPoint &aOffset, COLOR4D aColor) override
const EDA_RECT GetBoundingBox() const override
Function GetBoundingBox returns the orthogonal, bounding box of this object for display purposes.
int GetIndexInPeer() const
Definition: ws_draw_item.h:67
void PrintWsItem(wxDC *aDC, const wxPoint &aOffset, COLOR4D aColor) override
Definition: ws_draw_item.h:258
Class TITLE_BLOCK holds the information shown in the lower right corner of a plot,...
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:455
KICAD_T
Enum KICAD_T is the set of class identification values, stored in EDA_ITEM::m_StructType.
Definition: typeinfo.h:78
wxString GetSelectMenuText(EDA_UNITS_T aUnits) const override
Function GetSelectMenuText returns the text to display to be used in the selection clarification cont...
void ViewGetLayers(int aLayers[], int &aCount) const override
Function ViewGetLayers() Returns the all the layers within the VIEW the object is painted on.
virtual wxString GetClass() const override
Function GetClass returns the class name.
Definition: ws_draw_item.h:118
Class EDA_TEXT is a mix-in class (via multiple inheritance) that handles texts such as labels,...
Definition: eda_text.h:109
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:340
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:288
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:109
virtual wxString GetClass() const override
Function GetClass returns the class name.
Definition: ws_draw_item.h:245
void SetPosition(wxPoint aPos) override
Definition: ws_draw_item.h:301
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:209
WS_DATA_ITEM * m_peer
Definition: ws_draw_item.h:52
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:394
void SetSheetCount(int aSheetCount)
Function SetSheetCount Set the value of the count of sheets, for basic inscriptions.
Definition: ws_draw_item.h:450
WS_DRAW_ITEM_BITMAP(WS_DATA_ITEM *aPeer, int aIndex, wxPoint aPos)
Definition: ws_draw_item.h:320
Class SHAPE_POLY_SET.
Class PAGE_INFO describes the page size and margins of a paper page on which to eventually print or p...
Definition: page_info.h:54
const wxPoint & GetStart() const
Definition: ws_draw_item.h:122
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:88
int GetPenWidth() const
Definition: ws_draw_item.h:121
void SetMilsToIUfactor(double aScale)
Function SetMilsToIUfactor Set the scalar to convert pages units (mils) to draw/plot units.
Definition: ws_draw_item.h:432
void GetMsgPanelInfo(EDA_UNITS_T aUnits, MSG_PANEL_ITEMS &aList) override
int GetPenWidth() const
Definition: ws_draw_item.h:248
wxString GetSelectMenuText(EDA_UNITS_T 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 SetPosition(wxPoint aPos) override
Definition: ws_draw_item.h:256
wxString m_sheetFullName
Definition: ws_draw_item.h:367
void SetPageSize(wxSize aSize)
Definition: ws_draw_item.h:249
void SetTextAngle(double aAngle)
Definition: ws_draw_item.h:295
const wxPoint GetPosition() const override
Definition: ws_draw_item.h:127
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
void PrintWsItem(wxDC *aDC, const wxPoint &aOffset, COLOR4D aColor) override
WS_DRAW_ITEM_BASE(WS_DATA_ITEM *aPeer, int aIndex, KICAD_T aType)
Definition: ws_draw_item.h:55
void PrintWsItem(wxDC *aDC, const wxPoint &aOffset, COLOR4D aColor) override
void SetPosition(wxPoint aPos) override
Definition: ws_draw_item.h:331
WS_DRAW_ITEM_RECT(WS_DATA_ITEM *aPeer, int aIndex, wxPoint aStart, wxPoint aEnd, int aPenWidth)
Definition: ws_draw_item.h:193
wxSize GetPageSize() const
Definition: ws_draw_item.h:250
void SetSheetNumber(int aSheetNumber)
Function SetSheetNumber Set the value of the sheet number, for basic inscriptions.
Definition: ws_draw_item.h:441
virtual wxString GetClass() const override
Function GetClass returns the class name.
Definition: ws_draw_item.h:328
virtual const wxPoint GetPosition() const =0
wxString BuildFullText(const wxString &aTextbase)
Function BuildFullText returns the full text corresponding to the aTextbase, after replacing format s...
Definition: ws_painter.cpp:75
const wxPoint GetPosition() const override
Definition: ws_draw_item.h:330
wxString GetSelectMenuText(EDA_UNITS_T aUnits) const override
Function GetSelectMenuText returns the text to display to be used in the selection clarification cont...
STATUS_FLAGS m_Flags
Flag bits for editing and other uses.
Definition: base_struct.h:187
virtual void PrintWsItem(wxDC *aDC, COLOR4D aColor)
Definition: ws_draw_item.h:76
std::vector< WS_DRAW_ITEM_BASE * > m_graphicList
Definition: ws_draw_item.h:355
wxString GetSelectMenuText(EDA_UNITS_T aUnits) const override
Function GetSelectMenuText returns the text to display to be used in the selection clarification cont...
Class 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
Class EDA_ITEM is a base class for most all the KiCad significant classes, used in schematics and boa...
Definition: base_struct.h:163
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:399
void PrintWsItem(wxDC *aDC, const wxPoint &aOffset, COLOR4D aColor) override
const wxPoint GetPosition() const override
Definition: ws_draw_item.h:211
const wxPoint & GetTextPos() const
Definition: eda_text.h:232
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 Print(wxDC *aDC, COLOR4D aColor)
Draws the item list created by BuildWorkSheetGraphicList.
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:233
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:166
wxString GetSelectMenuText(EDA_UNITS_T aUnits) const override
Function GetSelectMenuText returns the text to display to be used in the selection clarification cont...
int GetDefaultPenSize() const
Definition: ws_draw_item.h:426
EDA_UNITS_T
Definition: common.h:133
const wxPoint & GetMarkerPos() const
Definition: ws_draw_item.h:251
const wxPoint GetPosition() const override
Definition: ws_draw_item.h:300
void SetThickness(int aNewThickness)
Function SetThickness sets pen width.
Definition: eda_text.h:142
virtual wxString GetClass() const override
Function GetClass returns the class name.
Definition: ws_draw_item.h:202
void SetEnd(wxPoint aPos) override
Definition: ws_draw_item.h:125
Class COLOR4D is the color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:39