KiCad PCB EDA Suite
class_dimension.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) 2012 Jean-Pierre Charras, jean-pierre.charras@ujf-grenoble.fr
5  * Copyright (C) 2012 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
6  * Copyright (C) 2012 Wayne Stambaugh <stambaughw@verizon.net>
7  * Copyright (C) 1992-2012 KiCad Developers, see AUTHORS.txt for contributors.
8  *
9  * This program is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU General Public License
11  * as published by the Free Software Foundation; either version 2
12  * of the License, or (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program; if not, you may find one here:
21  * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
22  * or you may search the http://www.gnu.org website for the version 2 license,
23  * or you may write to the Free Software Foundation, Inc.,
24  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
25  */
26 
31 #include <fctsys.h>
32 #include <macros.h>
33 #include <gr_basic.h>
34 #include <trigo.h>
35 #include <wxstruct.h>
36 #include <class_drawpanel.h>
37 #include <kicad_string.h>
38 #include <richio.h>
39 #include <bitmaps.h>
40 #include <wxPcbStruct.h>
41 
42 #include <class_board.h>
43 #include <class_pcb_text.h>
44 #include <class_dimension.h>
45 #include <base_units.h>
46 
47 
49  BOARD_ITEM( aParent, PCB_DIMENSION_T ),
50  m_Width( Millimeter2iu( 0.2 ) ), m_Unit( INCHES ), m_Value( 0 ), m_Height( 0 ), m_Text( this )
51 {
53  m_Shape = 0;
54 }
55 
56 
58 {
59 }
60 
61 
62 void DIMENSION::SetPosition( const wxPoint& aPos )
63 {
64  m_Text.SetTextPos( aPos );
65 }
66 
67 
69 {
70  return m_Text.GetTextPos();
71 }
72 
73 
74 void DIMENSION::SetText( const wxString& aNewText )
75 {
76  m_Text.SetText( aNewText );
77 }
78 
79 
80 const wxString DIMENSION::GetText() const
81 {
82  return m_Text.GetText();
83 }
84 
85 
87 {
88  m_Layer = aLayer;
89  m_Text.SetLayer( aLayer );
90 }
91 
92 
93 void DIMENSION::Move( const wxPoint& offset )
94 {
95  m_Text.Offset( offset );
96 
97  m_crossBarO += offset;
98  m_crossBarF += offset;
99  m_featureLineGO += offset;
100  m_featureLineGF += offset;
101  m_featureLineDO += offset;
102  m_featureLineDF += offset;
103  m_arrowG1F += offset;
104  m_arrowG2F += offset;
105  m_arrowD1F += offset;
106  m_arrowD2F += offset;
107 }
108 
109 
110 void DIMENSION::Rotate( const wxPoint& aRotCentre, double aAngle )
111 {
112  wxPoint tmp = m_Text.GetTextPos();
113  RotatePoint( &tmp, aRotCentre, aAngle );
114  m_Text.SetTextPos( tmp );
115 
116  double newAngle = m_Text.GetTextAngle() + aAngle;
117 
118  if( newAngle >= 3600 )
119  newAngle -= 3600;
120 
121  if( newAngle > 900 && newAngle < 2700 )
122  newAngle -= 1800;
123 
124  m_Text.SetTextAngle( newAngle );
125 
126  RotatePoint( &m_crossBarO, aRotCentre, aAngle );
127  RotatePoint( &m_crossBarF, aRotCentre, aAngle );
128  RotatePoint( &m_featureLineGO, aRotCentre, aAngle );
129  RotatePoint( &m_featureLineGF, aRotCentre, aAngle );
130  RotatePoint( &m_featureLineDO, aRotCentre, aAngle );
131  RotatePoint( &m_featureLineDF, aRotCentre, aAngle );
132  RotatePoint( &m_arrowG1F, aRotCentre, aAngle );
133  RotatePoint( &m_arrowG2F, aRotCentre, aAngle );
134  RotatePoint( &m_arrowD1F, aRotCentre, aAngle );
135  RotatePoint( &m_arrowD2F, aRotCentre, aAngle );
136 }
137 
138 
139 void DIMENSION::Flip( const wxPoint& aCentre )
140 {
141  Mirror( aCentre );
142 
143  // DIMENSION items are not usually on copper layers, so
144  // copper layers count is not taken in accoun in Flip transform
145  SetLayer( FlipLayer( GetLayer() ) );
146 }
147 
148 
149 void DIMENSION::Mirror( const wxPoint& axis_pos )
150 {
151  wxPoint newPos = m_Text.GetTextPos();
152 
153 #define INVERT( pos ) (pos) = axis_pos.y - ( (pos) - axis_pos.y )
154  INVERT( newPos.y );
155 
156  m_Text.SetTextPos( newPos );
157 
158  // invert angle
160 
161  INVERT( m_crossBarO.y );
162  INVERT( m_crossBarF.y );
167  INVERT( m_arrowG1F.y );
168  INVERT( m_arrowG2F.y );
169  INVERT( m_arrowD1F.y );
170  INVERT( m_arrowD2F.y );
171 }
172 
173 
174 void DIMENSION::SetOrigin( const wxPoint& aOrigin )
175 {
176  m_featureLineGO = aOrigin;
177 
179 }
180 
181 
182 void DIMENSION::SetEnd( const wxPoint& aEnd )
183 {
184  m_featureLineDO = aEnd;
185 
187 }
188 
189 
190 void DIMENSION::SetHeight( int aHeight )
191 {
192  m_Height = aHeight;
193 
195 }
196 
197 
199 {
200  VECTOR2D featureLine( m_crossBarO - m_featureLineGO );
202 
203  if( featureLine.Cross( crossBar ) > 0 )
204  m_Height = -featureLine.EuclideanNorm();
205  else
206  m_Height = featureLine.EuclideanNorm();
207 }
208 
209 
210 void DIMENSION::AdjustDimensionDetails( bool aDoNotChangeText )
211 {
212  const int arrowz = Mils2iu( 50 ); // size of arrows
213  int ii;
214  int measure, deltax, deltay; // value of the measure on X and Y axes
215  int arrow_up_X = 0, arrow_up_Y = 0; // coordinates of arrow line /
216  int arrow_dw_X = 0, arrow_dw_Y = 0; // coordinates of arrow line '\'
217  int hx, hy; // dimension line interval
218  double angle, angle_f;
219  wxString msg;
220 
221  // Init layer :
222  m_Text.SetLayer( GetLayer() );
223 
224  // calculate the size of the dimension (text + line above the text)
225  ii = m_Text.GetTextHeight() + m_Text.GetThickness() + (m_Width * 3);
226 
227  deltax = m_featureLineDO.x - m_featureLineGO.x;
228  deltay = m_featureLineDO.y - m_featureLineGO.y;
229 
230  // Calculate dimension value
231  measure = KiROUND( hypot( deltax, deltay ) );
232 
233  angle = atan2( (double)deltay, (double)deltax );
234 
235  // Calculation of parameters X and Y dimensions of the arrows and lines.
236  hx = hy = ii;
237 
238  // Taking into account the slope of the side lines.
239  if( measure )
240  {
241  hx = abs( KiROUND( ( (double) deltay * hx ) / measure ) );
242  hy = abs( KiROUND( ( (double) deltax * hy ) / measure ) );
243 
245  hx = -hx;
246 
247  if( m_featureLineGO.x == m_crossBarO.x )
248  hx = 0;
249 
251  hy = -hy;
252 
253  if( m_featureLineGO.y == m_crossBarO.y )
254  hy = 0;
255 
256  angle_f = angle + DEG2RAD( 27.5 );
257  arrow_up_X = wxRound( arrowz * cos( angle_f ) );
258  arrow_up_Y = wxRound( arrowz * sin( angle_f ) );
259  angle_f = angle - DEG2RAD( 27.5 );
260  arrow_dw_X = wxRound( arrowz * cos( angle_f ) );
261  arrow_dw_Y = wxRound( arrowz * sin( angle_f ) );
262  }
263 
264  int dx = KiROUND( m_Height * cos( angle + M_PI / 2 ) );
265  int dy = KiROUND( m_Height * sin( angle + M_PI / 2 ) );
270 
271  m_arrowG1F.x = m_crossBarO.x + arrow_up_X;
272  m_arrowG1F.y = m_crossBarO.y + arrow_up_Y;
273 
274  m_arrowG2F.x = m_crossBarO.x + arrow_dw_X;
275  m_arrowG2F.y = m_crossBarO.y + arrow_dw_Y;
276 
277  /* The right arrow is symmetrical to the left.
278  * / = -\ and \ = -/
279  */
280  m_arrowD1F.x = m_crossBarF.x - arrow_dw_X;
281  m_arrowD1F.y = m_crossBarF.y - arrow_dw_Y;
282 
283  m_arrowD2F.x = m_crossBarF.x - arrow_up_X;
284  m_arrowD2F.y = m_crossBarF.y - arrow_up_Y;
285 
288 
291 
292  // Calculate the better text position and orientation:
293  wxPoint textPos;
294  textPos.x = (m_crossBarF.x + m_featureLineGF.x) / 2;
295  textPos.y = (m_crossBarF.y + m_featureLineGF.y) / 2;
296  m_Text.SetTextPos( textPos );
297 
298  double newAngle = -RAD2DECIDEG( angle );
299 
300  NORMALIZE_ANGLE_POS( newAngle );
301 
302  if( newAngle > 900 && newAngle < 2700 )
303  newAngle -= 1800;
304 
305  m_Text.SetTextAngle( newAngle );
306 
307  if( !aDoNotChangeText )
308  {
309  m_Value = measure;
310  msg = ::CoordinateToString( m_Value );
311  SetText( msg );
312  }
313 }
314 
315 
316 void DIMENSION::Draw( EDA_DRAW_PANEL* panel, wxDC* DC, GR_DRAWMODE mode_color,
317  const wxPoint& offset )
318 {
319  BOARD* brd = GetBoard();
320 
321  if( brd->IsLayerVisible( m_Layer ) == false )
322  return;
323 
324  m_Text.Draw( panel, DC, mode_color, offset );
325 
326  auto frame = static_cast<PCB_EDIT_FRAME*> ( panel->GetParent() );
327  auto gcolor = frame->Settings().Colors().GetLayerColor( m_Layer );
328 
329  GRSetDrawMode( DC, mode_color );
330  DISPLAY_OPTIONS* displ_opts = (DISPLAY_OPTIONS*)panel->GetDisplayOptions();
331  bool filled = displ_opts ? displ_opts->m_DisplayDrawItemsFill : FILLED;
332  int width = m_Width;
333 
334  if( filled )
335  {
336  GRLine( panel->GetClipBox(), DC, m_crossBarO + offset,
337  m_crossBarF + offset, width, gcolor );
338  GRLine( panel->GetClipBox(), DC, m_featureLineGO + offset,
339  m_featureLineGF + offset, width, gcolor );
340  GRLine( panel->GetClipBox(), DC, m_featureLineDO + offset,
341  m_featureLineDF + offset, width, gcolor );
342  GRLine( panel->GetClipBox(), DC, m_crossBarF + offset,
343  m_arrowD1F + offset, width, gcolor );
344  GRLine( panel->GetClipBox(), DC, m_crossBarF + offset,
345  m_arrowD2F + offset, width, gcolor );
346  GRLine( panel->GetClipBox(), DC, m_crossBarO + offset,
347  m_arrowG1F + offset, width, gcolor );
348  GRLine( panel->GetClipBox(), DC, m_crossBarO + offset,
349  m_arrowG2F + offset, width, gcolor );
350  }
351  else
352  {
353  GRCSegm( panel->GetClipBox(), DC, m_crossBarO + offset,
354  m_crossBarF + offset, width, gcolor );
355  GRCSegm( panel->GetClipBox(), DC, m_featureLineGO + offset,
356  m_featureLineGF + offset, width, gcolor );
357  GRCSegm( panel->GetClipBox(), DC, m_featureLineDO + offset,
358  m_featureLineDF + offset, width, gcolor );
359  GRCSegm( panel->GetClipBox(), DC, m_crossBarF + offset,
360  m_arrowD1F + offset, width, gcolor );
361  GRCSegm( panel->GetClipBox(), DC, m_crossBarF + offset,
362  m_arrowD2F + offset, width, gcolor );
363  GRCSegm( panel->GetClipBox(), DC, m_crossBarO + offset,
364  m_arrowG1F + offset, width, gcolor );
365  GRCSegm( panel->GetClipBox(), DC, m_crossBarO + offset,
366  m_arrowG2F + offset, width, gcolor );
367  }
368 }
369 
370 
371 // see class_cotation.h
372 void DIMENSION::GetMsgPanelInfo( std::vector< MSG_PANEL_ITEM >& aList )
373 {
374  // for now, display only the text within the DIMENSION using class TEXTE_PCB.
375  m_Text.GetMsgPanelInfo( aList );
376 }
377 
378 
379 bool DIMENSION::HitTest( const wxPoint& aPosition ) const
380 {
381  if( m_Text.TextHitTest( aPosition ) )
382  return true;
383 
384  int dist_max = m_Width / 2;
385 
386  // Locate SEGMENTS
387 
388  if( TestSegmentHit( aPosition, m_crossBarO, m_crossBarF, dist_max ) )
389  return true;
390 
391  if( TestSegmentHit( aPosition, m_featureLineGO, m_featureLineGF, dist_max ) )
392  return true;
393 
394  if( TestSegmentHit( aPosition, m_featureLineDO, m_featureLineDF, dist_max ) )
395  return true;
396 
397  if( TestSegmentHit( aPosition, m_crossBarF, m_arrowD1F, dist_max ) )
398  return true;
399 
400  if( TestSegmentHit( aPosition, m_crossBarF, m_arrowD2F, dist_max ) )
401  return true;
402 
403  if( TestSegmentHit( aPosition, m_crossBarO, m_arrowG1F, dist_max ) )
404  return true;
405 
406  if( TestSegmentHit( aPosition, m_crossBarO, m_arrowG2F, dist_max ) )
407  return true;
408 
409  return false;
410 }
411 
412 
413 bool DIMENSION::HitTest( const EDA_RECT& aRect, bool aContained, int aAccuracy ) const
414 {
415  EDA_RECT arect = aRect;
416  arect.Inflate( aAccuracy );
417 
418  EDA_RECT rect = GetBoundingBox();
419  if( aAccuracy )
420  rect.Inflate( aAccuracy );
421 
422  if( aContained )
423  return arect.Contains( rect );
424 
425  return arect.Intersects( rect );
426 }
427 
428 
430 {
431  EDA_RECT bBox;
432  int xmin, xmax, ymin, ymax;
433 
434  bBox = m_Text.GetTextBox( -1 );
435  xmin = bBox.GetX();
436  xmax = bBox.GetRight();
437  ymin = bBox.GetY();
438  ymax = bBox.GetBottom();
439 
440  xmin = std::min( xmin, m_crossBarO.x );
441  xmin = std::min( xmin, m_crossBarF.x );
442  ymin = std::min( ymin, m_crossBarO.y );
443  ymin = std::min( ymin, m_crossBarF.y );
444  xmax = std::max( xmax, m_crossBarO.x );
445  xmax = std::max( xmax, m_crossBarF.x );
446  ymax = std::max( ymax, m_crossBarO.y );
447  ymax = std::max( ymax, m_crossBarF.y );
448 
449  xmin = std::min( xmin, m_featureLineGO.x );
450  xmin = std::min( xmin, m_featureLineGF.x );
451  ymin = std::min( ymin, m_featureLineGO.y );
452  ymin = std::min( ymin, m_featureLineGF.y );
453  xmax = std::max( xmax, m_featureLineGO.x );
454  xmax = std::max( xmax, m_featureLineGF.x );
455  ymax = std::max( ymax, m_featureLineGO.y );
456  ymax = std::max( ymax, m_featureLineGF.y );
457 
458  xmin = std::min( xmin, m_featureLineDO.x );
459  xmin = std::min( xmin, m_featureLineDF.x );
460  ymin = std::min( ymin, m_featureLineDO.y );
461  ymin = std::min( ymin, m_featureLineDF.y );
462  xmax = std::max( xmax, m_featureLineDO.x );
463  xmax = std::max( xmax, m_featureLineDF.x );
464  ymax = std::max( ymax, m_featureLineDO.y );
465  ymax = std::max( ymax, m_featureLineDF.y );
466 
467  bBox.SetX( xmin );
468  bBox.SetY( ymin );
469  bBox.SetWidth( xmax - xmin + 1 );
470  bBox.SetHeight( ymax - ymin + 1 );
471 
472  bBox.Normalize();
473 
474  return bBox;
475 }
476 
477 
479 {
480  wxString text;
481  text.Printf( _( "Dimension \"%s\" on %s" ),
482  GetChars( GetText() ), GetChars( GetLayerName() ) );
483 
484  return text;
485 }
486 
487 
489 {
490  return add_dimension_xpm;
491 }
492 
493 
495 {
496  BOX2I dimBBox = BOX2I( VECTOR2I( GetBoundingBox().GetPosition() ),
497  VECTOR2I( GetBoundingBox().GetSize() ) );
498  dimBBox.Merge( m_Text.ViewBBox() );
499 
500  return dimBBox;
501 }
502 
503 
505 {
506  return new DIMENSION( *this );
507 }
wxString CoordinateToString(int aValue, bool aConvertToMils)
Function CoordinateToString is a helper to convert the integer coordinate aValue to a string in inche...
Definition: base_units.cpp:117
void Offset(const wxPoint &aOffset)
Definition: eda_text.h:229
BOX2< VECTOR2I > BOX2I
Definition: box2.h:468
void SetTextAngle(double aAngle)
void Mirror(const wxPoint &axis_pos)
Function Mirror Mirror the Dimension , relative to a given horizontal axis the text is not mirrored...
void SetPosition(const wxPoint &aPos) override
PNG memory record (file in memory).
Definition: bitmap_types.h:38
TEXTE_PCB class definition.
void SetText(const wxString &NewText)
void GRSetDrawMode(wxDC *DC, GR_DRAWMODE draw_mode)
Definition: gr_basic.cpp:290
const wxPoint & GetTextPos() const
Definition: eda_text.h:224
static int KiROUND(double v)
KiROUND rounds a floating point number to an int using "round halfway cases away from zero"...
Definition: common.h:107
virtual void SetLayer(PCB_LAYER_ID aLayer)
Function SetLayer sets the layer this item is on.
Implementation of conversion functions that require both schematic and board internal units...
wxPoint m_crossBarF
int m_Height
length of feature lines
Class BOARD_ITEM is a base class for any item which can be embedded within the BOARD container class...
wxPoint m_arrowD1F
bool Contains(const wxPoint &aPoint) const
Function Contains.
void GRLine(EDA_RECT *ClipBox, wxDC *DC, int x1, int y1, int x2, int y2, int width, COLOR4D Color)
Definition: gr_basic.cpp:352
DIMENSION(BOARD_ITEM *aParent)
Class BOARD to handle a board.
void Flip(const wxPoint &aCentre) override
Function Flip Flip this object, i.e.
PCB_LAYER_ID FlipLayer(PCB_LAYER_ID aLayerId, int aCopperLayersCount)
Function FlippedLayerNumber.
Definition: lset.cpp:445
const wxString GetText() const
void Draw(EDA_DRAW_PANEL *panel, wxDC *DC, GR_DRAWMODE aDrawMode, const wxPoint &offset=ZeroOffset) override
Function Draw BOARD_ITEMs have their own color information.
void SetTextPos(const wxPoint &aPoint)
Definition: eda_text.h:223
virtual const BOX2I ViewBBox() const override
Function ViewBBox() returns the bounding box of the item covering all its layers. ...
void Draw(EDA_DRAW_PANEL *panel, wxDC *DC, GR_DRAWMODE aColorMode, const wxPoint &offset=ZeroOffset) override
Function Draw BOARD_ITEMs have their own color information.
double RAD2DECIDEG(double rad)
Definition: trigo.h:196
TEXTE_PCB m_Text
void GRCSegm(EDA_RECT *ClipBox, wxDC *DC, int x1, int y1, int x2, int y2, int width, int aPenSize, COLOR4D Color)
Definition: gr_basic.cpp:481
int m_Shape
Currently always 0.
wxPoint m_featureLineDF
void RotatePoint(int *pX, int *pY, double angle)
Definition: trigo.cpp:317
void NORMALIZE_ANGLE_POS(T &Angle)
Definition: trigo.h:222
VECTOR2< int > VECTOR2I
Definition: vector2d.h:590
bool HitTest(const wxPoint &aPosition) const override
Function HitTest tests if aPosition is contained within or on the bounding area of an item...
#define abs(a)
Definition: auxiliary.h:84
wxString GetLayerName() const
Function GetLayerName returns the name of the PCB layer on which the item resides.
void SetLayer(PCB_LAYER_ID aLayer) override
Function SetLayer sets the layer this item is on.
double GetTextAngle() const
Definition: eda_text.h:164
int GetThickness() const
Function GetThickness returns pen width.
Definition: eda_text.h:154
This file contains miscellaneous commonly used macros and functions.
wxPoint m_featureLineGO
PCB_LAYER_ID m_Layer
DIMENSION class definition.
PCB_LAYER_ID
A quick note on layer IDs:
EDA_ITEM * Clone() const override
Function Clone creates a duplicate of this item with linked list members set to NULL.
void SetOrigin(const wxPoint &aOrigin)
Function SetOrigin Sets a new origin of the crossbar line.
const EDA_RECT GetBoundingBox() const override
Function GetBoundingBox returns the orthogonal, bounding box of this object for display purposes...
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:115
T EuclideanNorm() const
Destructor.
Definition: vector2d.h:295
void SetHeight(int val)
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:267
GR_DRAWMODE
Drawmode. Compositing mode plus a flag or two.
Definition: gr_basic.h:41
Base window classes and related definitions.
PCB_GENERAL_SETTINGS & Settings()
const wxString & GetText() const
Function GetText returns the string associated with the text object.
Definition: eda_text.h:130
void SetEnd(const wxPoint &aEnd)
Function SetEnd Sets a new end of the crossbar line.
Definition: common.h:145
wxPoint m_arrowG1F
wxPoint m_arrowD2F
wxPoint m_arrowG2F
bool m_DisplayDrawItemsFill
Definition: pcbstruct.h:84
EDA_RECT * GetClipBox()
void SetX(int val)
EDA_DRAW_FRAME * GetParent() const
Definition: draw_panel.cpp:175
wxString GetSelectMenuText() const override
Function GetSelectMenuText returns the text to display to be used in the selection clarification cont...
int GetBottom() const
BOX2< Vec > & Merge(const BOX2< Vec > &aRect)
Function Merge modifies the position and size of the rectangle in order to contain aRect...
Definition: box2.h:350
int GetRight() const
void SetWidth(int val)
class DIMENSION, a dimension (graphic item)
Definition: typeinfo.h:112
COLORS_DESIGN_SETTINGS & Colors()
void SetY(int val)
void AdjustDimensionDetails(bool aDoNotChangeText=false)
Function AdjustDimensionDetails Calculate coordinates of segments used to draw the dimension...
Class DISPLAY_OPTIONS handles display options like enable/disable some optional drawings.
Definition: pcbstruct.h:62
extended_type Cross(const VECTOR2< T > &aVector) const
Function Cross() computes cross product of self with aVector.
Definition: vector2d.h:480
int m_Width
Line width.
void Normalize()
Function Normalize ensures that the height ant width are positive.
#define INVERT(pos)
bool Intersects(const EDA_RECT &aRect) const
Function Intersects tests for a common area between rectangles.
PCB_LAYER_ID GetLayer() const
Function GetLayer returns the primary layer this item is on.
BITMAP_DEF GetMenuImage() const override
Function GetMenuImage returns a pointer to an image to be used in menus.
static const wxChar * GetChars(const wxString &s)
Function GetChars returns a wxChar* to the actual wxChar* data within a wxString, and is helpful for ...
Definition: macros.h:92
void GetMsgPanelInfo(std::vector< MSG_PANEL_ITEM > &aList) override
Function GetMsgPanelInfo populates aList of MSG_PANEL_ITEM objects with it's internal state for displ...
double DEG2RAD(double deg)
Definition: trigo.h:191
#define max(a, b)
Definition: auxiliary.h:86
Class BOARD holds information pertinent to a Pcbnew printed circuit board.
Definition: class_board.h:169
void GetMsgPanelInfo(std::vector< MSG_PANEL_ITEM > &aList) override
Function GetMsgPanelInfo populates aList of MSG_PANEL_ITEM objects with it's internal state for displ...
void Move(const wxPoint &offset) override
Function Move.
void SetHeight(int aHeight)
Function SetHeight Sets the length of feature lines.
static DIRECTION_45::AngleType angle(const VECTOR2I &a, const VECTOR2I &b)
Class EDA_RECT handles the component boundary box.
int GetX() const
Class EDA_ITEM is a base class for most all the KiCad significant classes, used in schematics and boa...
Definition: base_struct.h:151
COLOR4D GetLayerColor(LAYER_NUM aLayer) const
Function GetLayerColor.
int GetY() const
int GetTextHeight() const
Definition: eda_text.h:221
virtual BOARD * GetBoard() const
Function GetBoard returns the BOARD in which this BOARD_ITEM resides, or NULL if none.
wxPoint m_crossBarO
void * GetDisplayOptions()
Function GetDisplayOptions A way to pass info to draw functions.
Definition: draw_panel.cpp:182
bool TestSegmentHit(const wxPoint &aRefPoint, wxPoint aStart, wxPoint aEnd, int aDist)
Function TestSegmentHit test for hit on line segment i.e.
Definition: trigo.cpp:142
const wxPoint & GetPosition() const override
void UpdateHeight()
Function UpdateHeight Updates stored height basing on points coordinates.
virtual const BOX2I ViewBBox() const override
Function ViewBBox() returns the bounding box of the item covering all its layers. ...
wxPoint m_featureLineDO
int m_Value
value of PCB dimensions.
void Rotate(const wxPoint &aRotCentre, double aAngle) override
Function Rotate Rotate this object.
EDA_RECT & Inflate(wxCoord dx, wxCoord dy)
Function Inflate inflates the rectangle horizontally by dx and vertically by dy.
#define min(a, b)
Definition: auxiliary.h:85
bool IsLayerVisible(PCB_LAYER_ID aLayer) const
Function IsLayerVisible is a proxy function that calls the correspondent function in m_BoardSettings ...
Definition: class_board.h:443
virtual void SetText(const wxString &aText)
Definition: eda_text.h:141
wxPoint m_featureLineGF