KiCad PCB EDA Suite
ws_draw_item.cpp
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) 1992-2013 Jean-Pierre Charras <jp.charras at wanadoo.fr>.
5  * Copyright (C) 1992-2019 KiCad Developers, see AUTHORS.txt for contributors.
6  *
7  *
8  * This program is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU General Public License
10  * as published by the Free Software Foundation; either version 2
11  * of the License, or (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, you may find one here:
20  * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
21  * or you may search the http://www.gnu.org website for the version 2 license,
22  * or you may write to the Free Software Foundation, Inc.,
23  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
24  */
25 
26 /*
27  * the class WS_DATA_ITEM (and WS_DATA_ITEM_TEXT) defines
28  * a basic shape of a page layout ( frame references and title block )
29  * Basic shapes are line, rect and texts
30  * the WS_DATA_ITEM coordinates units is the mm, and are relative to
31  * one of 4 page corners.
32  *
33  * These items cannot be drawn or plot "as this". they should be converted
34  * to a "draw list" (WS_DRAW_ITEM_BASE and derived items)
35 
36  * The list of these items is stored in a WS_DATA_MODEL instance.
37  *
38  * When building the draw list:
39  * the WS_DATA_MODEL is used to create a WS_DRAW_ITEM_LIST
40  * coordinates are converted to draw/plot coordinates.
41  * texts are expanded if they contain format symbols.
42  * Items with m_RepeatCount > 1 are created m_RepeatCount times
43  *
44  * the WS_DATA_MODEL is created only once.
45  * the WS_DRAW_ITEM_LIST is created each time the page layout is plotted/drawn
46  *
47  * the WS_DATA_MODEL instance is created from a S expression which
48  * describes the page layout (can be the default page layout or a custom file).
49  */
50 
51 #include <fctsys.h>
52 #include <eda_rect.h>
53 #include <gr_text.h>
54 #include <ws_draw_item.h>
55 #include <ws_data_model.h>
56 #include <base_units.h>
57 #include <page_info.h>
59 
60 // ============================ BASE CLASS ==============================
61 
62 void WS_DRAW_ITEM_BASE::ViewGetLayers( int aLayers[], int& aCount ) const
63 {
64  aCount = 1;
65 
66  WS_DATA_ITEM* dataItem = GetPeer();
67 
68  if( !dataItem ) // No peer: this item is like a WS_DRAW_ITEM_PAGE
69  {
70  aLayers[0] = LAYER_WORKSHEET;
71  return;
72  }
73 
74  if( dataItem->GetPage1Option() == FIRST_PAGE_ONLY )
75  aLayers[0] = LAYER_WORKSHEET_PAGE1;
76  else if( dataItem->GetPage1Option() == SUBSEQUENT_PAGES )
77  aLayers[0] = LAYER_WORKSHEET_PAGEn;
78  else
79  aLayers[0] = LAYER_WORKSHEET;
80 }
81 
82 
83 // A generic HitTest that can be used by some, but not all, sub-classes.
84 bool WS_DRAW_ITEM_BASE::HitTest( const EDA_RECT& aRect, bool aContained, int aAccuracy ) const
85 {
86  EDA_RECT sel = aRect;
87 
88  if ( aAccuracy )
89  sel.Inflate( aAccuracy );
90 
91  if( aContained )
92  return sel.Contains( GetBoundingBox() );
93 
94  return sel.Intersects( GetBoundingBox() );
95 }
96 
97 
99 {
100  wxString msg;
101  WS_DATA_ITEM* dataItem = GetPeer();
102 
103  if( dataItem == nullptr ) // Is only a pure graphic item used in page layout editor
104  // to handle the page limits
105  return;
106 
107  switch( dataItem->GetType() )
108  {
110  aList.push_back( MSG_PANEL_ITEM( _( "Line" ), msg, DARKCYAN ) );
111  break;
112 
114  aList.push_back( MSG_PANEL_ITEM( _( "Rectangle" ), msg, DARKCYAN ) );
115  break;
116 
118  msg = static_cast<WS_DRAW_ITEM_TEXT*>( this )->GetShownText();
119  aList.push_back( MSG_PANEL_ITEM( _( "Text" ), msg, DARKCYAN ) );
120  break;
121 
123  aList.push_back( MSG_PANEL_ITEM( _( "Imported Shape" ), msg, DARKCYAN ) );
124  break;
125 
127  aList.push_back( MSG_PANEL_ITEM( _( "Image" ), msg, DARKCYAN ) );
128  break;
129  }
130 
131  switch( dataItem->GetPage1Option() )
132  {
133  case FIRST_PAGE_ONLY: msg = _( "First Page Only" ); break;
134  case SUBSEQUENT_PAGES: msg = _( "Subsequent Pages" ); break;
135  default: msg = _( "All Pages" ); break;
136  }
137 
138  aList.push_back( MSG_PANEL_ITEM( _( "First Page Option" ), msg, BROWN ) );
139 
141  aList.push_back( MSG_PANEL_ITEM( _( "Repeat Count" ), msg, BLUE ) );
142 
144  aList.push_back( MSG_PANEL_ITEM( _( "Repeat Label Increment" ), msg, DARKGRAY ) );
145 
146  msg.Printf( wxT( "(%s, %s)" ),
147  MessageTextFromValue( aUnits, dataItem->m_IncrementVector.x ),
148  MessageTextFromValue( aUnits, dataItem->m_IncrementVector.y ) );
149 
150  aList.push_back( MSG_PANEL_ITEM( _( "Repeat Position Increment" ), msg, RED ) );
151 
152  aList.push_back( MSG_PANEL_ITEM( _( "Comment" ), dataItem->m_Info, MAGENTA ) );
153 }
154 
155 
156 // ============================ TEXT ==============================
157 
158 void WS_DRAW_ITEM_TEXT::PrintWsItem( wxDC* aDC, const wxPoint& aOffset, COLOR4D aColor )
159 {
160  Print( aDC, aOffset, aColor, FILLED );
161 }
162 
163 
165 {
166  return EDA_TEXT::GetTextBox( -1 );
167 }
168 
169 
170 bool WS_DRAW_ITEM_TEXT::HitTest( const wxPoint& aPosition, int aAccuracy ) const
171 {
172  return EDA_TEXT::TextHitTest( aPosition, aAccuracy );
173 }
174 
175 
176 bool WS_DRAW_ITEM_TEXT::HitTest( const EDA_RECT& aRect, bool aContains, int aAccuracy ) const
177 {
178  return EDA_TEXT::TextHitTest( aRect, aContains, aAccuracy );
179 }
180 
181 
183 {
184  return wxString::Format( _( "Text %s at (%s, %s)" ),
185  GetShownText(),
186  MessageTextFromValue( aUnits, GetTextPos().x ),
187  MessageTextFromValue( aUnits, GetTextPos().y ) );
188 }
189 
190 
191 // ============================ POLYGON =================================
192 
193 void WS_DRAW_ITEM_POLYPOLYGONS::PrintWsItem( wxDC* aDC, const wxPoint& aOffset, COLOR4D aColor )
194 {
195  std::vector<wxPoint> points_moved;
196 
197  for( int idx = 0; idx < m_Polygons.OutlineCount(); ++idx )
198  {
199  points_moved.clear();
200  SHAPE_LINE_CHAIN& outline = m_Polygons.Outline( idx );
201 
202  for( int ii = 0; ii < outline.PointCount(); ii++ )
203  points_moved.push_back( wxPoint( outline.Point( ii ).x + aOffset.x,
204  outline.Point( ii ).y + aOffset.y ) );
205 
206  GRPoly( nullptr, aDC, points_moved.size(), &points_moved[0], FILLED_SHAPE,
207  GetPenWidth(), aColor, aColor );
208  }
209 }
210 
211 
213 {
214  // Note: m_pos is the anchor point of the shape.
215  wxPoint move_vect = aPos - m_pos;
216  m_pos = aPos;
217 
218  // Move polygon corners to the new position:
219  m_Polygons.Move( move_vect );
220 }
221 
222 
224 {
225  EDA_RECT rect;
226  BOX2I box = m_Polygons.BBox();
227 
228  rect.SetX( box.GetX() );
229  rect.SetY( box.GetY() );
230  rect.SetWidth( box.GetWidth() );
231  rect.SetHeight( box.GetHeight() );
232 
233  return rect;
234 }
235 
236 
237 bool WS_DRAW_ITEM_POLYPOLYGONS::HitTest( const wxPoint& aPosition, int aAccuracy ) const
238 {
239  return m_Polygons.Collide( aPosition, aAccuracy );
240 }
241 
242 
243 bool WS_DRAW_ITEM_POLYPOLYGONS::HitTest( const EDA_RECT& aRect, bool aContained, int aAccuracy ) const
244 {
245  EDA_RECT sel = aRect;
246 
247  if ( aAccuracy )
248  sel.Inflate( aAccuracy );
249 
250  if( aContained )
251  return sel.Contains( GetBoundingBox() );
252 
253  // Fast test: if rect is outside the polygon bounding box, then they cannot intersect
254  if( !sel.Intersects( GetBoundingBox() ) )
255  return false;
256 
257  for( int idx = 0; idx < m_Polygons.OutlineCount(); ++idx )
258  {
259  const SHAPE_LINE_CHAIN& outline = m_Polygons.COutline( idx );
260 
261  for( int ii = 0; ii < outline.PointCount(); ii++ )
262  {
263  wxPoint corner( outline.CPoint( ii ).x, outline.CPoint( ii ).y );
264 
265  // Test if the point is within aRect
266  if( sel.Contains( corner ) )
267  return true;
268 
269  // Test if this edge intersects aRect
270  int ii_next = (ii+1) % outline.PointCount();
271  wxPoint next_corner( outline.CPoint( ii_next ).x, outline.CPoint( ii_next ).y );
272 
273  if( sel.Intersects( corner, next_corner ) )
274  return true;
275  }
276  }
277 
278  return false;
279 }
280 
281 
283 {
284  return wxString::Format( _( "Imported shape at (%s, %s)" ),
285  MessageTextFromValue( aUnits, GetPosition().x ),
286  MessageTextFromValue( aUnits, GetPosition().y ) );
287 }
288 
289 
290 // ============================ RECT ==============================
291 
292 void WS_DRAW_ITEM_RECT::PrintWsItem( wxDC* aDC, const wxPoint& aOffset, COLOR4D aColor )
293 {
294  GRRect( nullptr, aDC, GetStart().x + aOffset.x, GetStart().y + aOffset.y,
295  GetEnd().x + aOffset.x, GetEnd().y + aOffset.y, GetPenWidth(), aColor );
296 }
297 
298 
300 {
301  return EDA_RECT( GetStart(), wxSize( GetEnd().x - GetStart().x, GetEnd().y - GetStart().y ) );
302 }
303 
304 
305 bool WS_DRAW_ITEM_RECT::HitTest( const wxPoint& aPosition, int aAccuracy ) const
306 {
307  int dist = aAccuracy + ( GetPenWidth() / 2 );
308  wxPoint start = GetStart();
309  wxPoint end;
310  end.x = GetEnd().x;
311  end.y = start.y;
312 
313  // Upper line
314  if( TestSegmentHit( aPosition, start, end, dist ) )
315  return true;
316 
317  // Right line
318  start = end;
319  end.y = GetEnd().y;
320  if( TestSegmentHit( aPosition, start, end, dist ) )
321  return true;
322 
323  // lower line
324  start = end;
325  end.x = GetStart().x;
326  if( TestSegmentHit( aPosition, start, end, dist ) )
327  return true;
328 
329  // left line
330  start = end;
331  end = GetStart();
332  if( TestSegmentHit( aPosition, start, end, dist ) )
333  return true;
334 
335  return false;
336 }
337 
338 
340 {
341  return wxString::Format( _( "Rectangle from (%s, %s) to (%s, %s)" ),
342  MessageTextFromValue( aUnits, GetStart().x ),
343  MessageTextFromValue( aUnits, GetStart().y ),
344  MessageTextFromValue( aUnits, GetEnd().x ),
345  MessageTextFromValue( aUnits, GetEnd().y ) );
346 }
347 
348 
349 // ============================ LINE ==============================
350 
351 void WS_DRAW_ITEM_LINE::PrintWsItem( wxDC* aDC, const wxPoint& aOffset, COLOR4D aColor )
352 {
353  GRLine( nullptr, aDC, GetStart() + aOffset, GetEnd() + aOffset, GetPenWidth(), aColor );
354 }
355 
356 
358 {
359  return EDA_RECT( GetStart(), wxSize( GetEnd().x - GetStart().x, GetEnd().y - GetStart().y ) );
360 }
361 
362 
363 bool WS_DRAW_ITEM_LINE::HitTest( const wxPoint& aPosition, int aAccuracy ) const
364 {
365  int mindist = aAccuracy + ( GetPenWidth() / 2 );
366  return TestSegmentHit( aPosition, GetStart(), GetEnd(), mindist );
367 }
368 
369 
371 {
372  return wxString::Format( _( "Line from (%s, %s) to (%s, %s)" ),
373  MessageTextFromValue( aUnits, GetStart().x ),
374  MessageTextFromValue( aUnits, GetStart().y ),
375  MessageTextFromValue( aUnits, GetEnd().x ),
376  MessageTextFromValue( aUnits, GetEnd().y ) );
377 }
378 
379 
380 // ============== BITMAP ================
381 
382 void WS_DRAW_ITEM_BITMAP::PrintWsItem( wxDC* aDC, const wxPoint& aOffset, COLOR4D aColor )
383 {
385 
386  if( bitmap->m_ImageBitmap )
387  bitmap->m_ImageBitmap->DrawBitmap( aDC, m_pos + aOffset );
388 }
389 
390 
392 {
393  auto* bitmap = static_cast<const WS_DATA_ITEM_BITMAP*>( m_peer );
394  wxSize bm_size = bitmap->m_ImageBitmap->GetSize();
395 
396  // Size is in mils, convert to iu (0.001 mm)
397  bm_size.x *= 25.4;
398  bm_size.y *= 25.4;
399 
400  EDA_RECT bbox;
401  bbox.SetSize( bm_size );
402  bbox.SetOrigin( m_pos.x - bm_size.x/2, m_pos.y - bm_size.y/2 );
403 
404  return bbox;
405 }
406 
407 
408 bool WS_DRAW_ITEM_BITMAP::HitTest( const wxPoint& aPosition, int aAccuracy ) const
409 {
410  EDA_RECT bbox = GetBoundingBox();
411  bbox.Inflate( aAccuracy );
412 
413  return bbox.Contains( aPosition );
414 }
415 
416 
417 bool WS_DRAW_ITEM_BITMAP::HitTest( const EDA_RECT& aRect, bool aContains, int aAccuracy ) const
418 {
419  return WS_DRAW_ITEM_BASE::HitTest( aRect, aContains, aAccuracy );
420 }
421 
422 
424 {
425  return wxString::Format( _( "Image at (%s, %s)" ),
426  MessageTextFromValue( aUnits, GetPosition().x ),
427  MessageTextFromValue( aUnits, GetPosition().y ) );
428 }
429 
430 
432 {
433  wxString txt( "Page limits" );
434  return txt;
435 }
436 
437 
439 {
440  EDA_RECT dummy;
441 
442  // We want this graphic item alway visible. So gives the max size to the
443  // bounding box to avoid any clamping:
445  return dummy;
446 }
447 
448 // ====================== WS_DRAW_ITEM_LIST ==============================
449 
451  const TITLE_BLOCK& aTitleBlock )
452 {
454 
455  m_titleBlock = &aTitleBlock;
456  m_paperFormat = &aPageInfo.GetType();
457 
458  // Build the basic layout shape, if the layout list is empty
459  if( model.GetCount() == 0 && !model.VoidListAllowed() )
460  model.SetPageLayout();
461 
462  model.SetupDrawEnvironment( aPageInfo, m_milsToIu );
463 
464  for( WS_DATA_ITEM* wsItem : model.GetItems() )
465  {
466  // Generate it only if the page option allows this
467  if( wsItem->GetPage1Option() == FIRST_PAGE_ONLY && m_sheetNumber != 1 )
468  continue;
469  else if( wsItem->GetPage1Option() == SUBSEQUENT_PAGES && m_sheetNumber == 1 )
470  continue;
471 
472  wsItem->SyncDrawItems( this, nullptr );
473  }
474 }
475 
476 
477 /* Print the item list created by BuildWorkSheetGraphicList
478  * aDC = the current Device Context
479  * The not selected items are drawn first (most of items)
480  * The selected items are drawn after (usually 0 or 1)
481  * to be sure they are seen, even for overlapping items
482  */
483 void WS_DRAW_ITEM_LIST::Print( wxDC* aDC, COLOR4D aColor )
484 {
485  for( WS_DRAW_ITEM_BASE* item = GetFirst(); item; item = GetNext() )
486  item->PrintWsItem( aDC, aColor );
487 }
488 
489 
const wxPoint & GetStart() const
Definition: ws_draw_item.h:206
Definition: colors.h:57
WS_DATA_MODEL handles the graphic items list to draw/plot the frame and title block.
Definition: ws_data_model.h:39
WS_DATA_ITEM * GetPeer() const
Definition: ws_draw_item.h:66
const wxPoint & GetEnd() const
Definition: ws_draw_item.h:208
void PrintWsItem(wxDC *aDC, const wxPoint &aOffset, COLOR4D aColor) override
const wxString * m_paperFormat
Definition: ws_draw_item.h:365
void GRPoly(EDA_RECT *ClipBox, wxDC *DC, int n, wxPoint Points[], bool Fill, int width, COLOR4D Color, COLOR4D BgColor)
Definition: gr_basic.cpp:546
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.
const EDA_RECT GetBoundingBox() const override
Function GetBoundingBox returns the orthogonal, bounding box of this object for display purposes.
int OutlineCount() const
Returns the number of outlines in the set
const EDA_RECT GetBoundingBox() const override
Function GetBoundingBox returns the orthogonal, bounding box of this object for display purposes.
for pageLayout editor previewing
static const int dist[10][10]
Definition: ar_matrix.cpp:320
Work sheet structure type definitions.
Definition: ws_data_item.h:93
const wxPoint & GetEnd() const
Definition: ws_draw_item.h:124
Implementation of conversion functions that require both schematic and board internal units.
coord_type GetX() const
Definition: box2.h:188
const EDA_RECT GetBoundingBox() const override
Function GetBoundingBox returns the orthogonal, bounding box of this object for display purposes.
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
Definition: colors.h:61
const wxPoint GetPosition() const override
Definition: ws_draw_item.h:169
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
void SetOrigin(const wxPoint &pos)
Definition: eda_rect.h:131
BITMAP_BASE * m_ImageBitmap
Definition: ws_data_item.h:366
void SetPageLayout(const wxString &aFullFileName=wxEmptyString, bool Append=false)
Populates the list with a custom layout, or the default layout, if no custom layout available.
wxString GetSelectMenuText(EDA_UNITS_T aUnits) const override
Function GetSelectMenuText returns the text to display to be used in the selection clarification cont...
const wxString & GetType() const
Definition: page_info.h:97
std::vector< WS_DATA_ITEM * > & GetItems()
WS_DRAW_ITEM_BASE * GetFirst()
Definition: ws_draw_item.h:466
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 PointCount() const
Function PointCount()
wxString m_Info
Definition: ws_data_item.h:113
Class TITLE_BLOCK holds the information shown in the lower right corner of a plot,...
Definition: title_block.h:40
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.
bool Contains(const wxPoint &aPoint) const
Function Contains.
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.
static WS_DATA_MODEL & GetTheInstance()
static function: returns the instance of WS_DATA_MODEL used in the application
wxString MessageTextFromValue(EDA_UNITS_T aUnits, int aValue, bool aUseMils)
Definition: base_units.cpp:125
const VECTOR2I & CPoint(int aIndex) const
Function CPoint()
void GRRect(EDA_RECT *aClipBox, wxDC *aDC, int x1, int y1, int x2, int y2, COLOR4D aColor)
Definition: gr_basic.cpp:848
const EDA_RECT GetBoundingBox() const override=0
Function GetBoundingBox returns the orthogonal, bounding box of this object for display purposes.
WS_DATA_ITEM * m_peer
Definition: ws_draw_item.h:52
EDA_RECT GetTextBox(int aLine=-1, int aThickness=-1, bool aInvertY=false) const
Function GetTextBox useful in multiline texts to calculate the full text or a line area (for zones fi...
Definition: eda_text.cpp:199
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 Move(const VECTOR2I &aVector) override
void SetHeight(int val)
Definition: eda_rect.h:186
SHAPE_LINE_CHAIN & Outline(int aIndex)
Returns the reference to aIndex-th outline in the 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
coord_type GetWidth() const
Definition: box2.h:195
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 GetMsgPanelInfo(EDA_UNITS_T aUnits, MSG_PANEL_ITEMS &aList) override
wxString GetSelectMenuText(EDA_UNITS_T aUnits) const override
Function GetSelectMenuText returns the text to display to be used in the selection clarification cont...
void SetX(int val)
Definition: eda_rect.h:168
Definition: colors.h:60
bool Collide(const VECTOR2I &aP, int aClearance=0) const override
Function Collide Checks whether the point aP collides with the inside of the polygon set; if the poin...
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 SetWidth(int val)
Definition: eda_rect.h:180
void GRLine(EDA_RECT *ClipBox, wxDC *DC, int x1, int y1, int x2, int y2, int width, COLOR4D Color, wxPenStyle aStyle)
Definition: gr_basic.cpp:230
#define _(s)
DPOINT m_IncrementVector
Definition: ws_data_item.h:119
void SetY(int val)
Definition: eda_rect.h:174
void Print(wxDC *aDC, const wxPoint &aOffset, COLOR4D aColor, EDA_DRAW_MODE_T aDisplay_mode=FILLED)
Function Print.
Definition: eda_text.cpp:376
WS_ITEM_TYPE GetType() const
Definition: ws_data_item.h:147
void PrintWsItem(wxDC *aDC, const wxPoint &aOffset, COLOR4D aColor) override
void PrintWsItem(wxDC *aDC, const wxPoint &aOffset, COLOR4D aColor) override
void SetupDrawEnvironment(const PAGE_INFO &aPageInfo, double aMilsToIU)
coord_type GetY() const
Definition: box2.h:189
static ptrdiff_t bm_size(const potrace_bitmap_t *bm)
Definition: bitmap.h:76
void SetSize(const wxSize &size)
Definition: eda_rect.h:144
Board layer functions and definitions.
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, CPTREE &aTree)
Function Format outputs a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition: ptree.cpp:205
static LIB_PART * dummy()
Used to draw a dummy shape when a LIB_PART is not found in library.
#define max(a, b)
Definition: auxiliary.h:86
bool VoidListAllowed()
const wxPoint GetPosition() const override
Definition: ws_draw_item.h:330
Class SHAPE_LINE_CHAIN.
wxString GetSelectMenuText(EDA_UNITS_T aUnits) const override
Function GetSelectMenuText returns the text to display to be used in the selection clarification cont...
const SHAPE_LINE_CHAIN & COutline(int aIndex) const
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
virtual bool TextHitTest(const wxPoint &aPoint, int aAccuracy=0) const
Function TextHitTest Test if aPoint is within the bounds of this object.
Definition: eda_text.cpp:351
const EDA_RECT GetBoundingBox() const override
Function GetBoundingBox returns the orthogonal, bounding box of this object for display purposes.
coord_type GetHeight() const
Definition: box2.h:196
std::vector< MSG_PANEL_ITEM > MSG_PANEL_ITEMS
Definition: msgpanel.h:102
bool Intersects(const EDA_RECT &aRect) const
Function Intersects tests for a common area between rectangles.
void PrintWsItem(wxDC *aDC, const wxPoint &aOffset, COLOR4D aColor) override
void DrawBitmap(wxDC *aDC, const wxPoint &aPos)
const wxPoint & GetTextPos() const
Definition: eda_text.h:232
VECTOR2I & Point(int aIndex)
Function Point()
int m_IncrementLabel
Definition: ws_data_item.h:121
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 wxString GetShownText() const
Returns the string actually shown after processing of the base text.
Definition: eda_text.h:129
Class EDA_MSG_ITEM is used EDA_MSG_PANEL as the item type for displaying messages.
Definition: msgpanel.h:53
bool TestSegmentHit(const wxPoint &aRefPoint, wxPoint aStart, wxPoint aEnd, int aDist)
Function TestSegmentHit test for hit on line segment i.e.
Definition: trigo.cpp:127
void Print(wxDC *aDC, COLOR4D aColor)
Draws the item list created by BuildWorkSheetGraphicList.
void SetPosition(wxPoint aPos) override
for pageLayout editor previewing
const EDA_RECT GetBoundingBox() const override
Function GetBoundingBox returns the orthogonal, bounding box of this object for display purposes.
const BOX2I BBox(int aClearance=0) const override
Function BBox()
PAGE_OPTION GetPage1Option() const
Definition: ws_data_item.h:153
wxString GetSelectMenuText(EDA_UNITS_T aUnits) const override
Function GetSelectMenuText returns the text to display to be used in the selection clarification cont...
EDA_UNITS_T
Definition: common.h:133
EDA_RECT & Inflate(wxCoord dx, wxCoord dy)
Function Inflate inflates the rectangle horizontally by dx and vertically by dy.
unsigned GetCount() const
Class COLOR4D is the color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:39
Definition: colors.h:62