KiCad PCB EDA Suite
pcb_dimension.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) 2004 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com
5  * Copyright (C) 1992-2021 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 PCB_DIMENSION_H
26 #define PCB_DIMENSION_H
27 
28 
29 #include <board_item.h>
30 #include <pcb_text.h>
31 #include <geometry/shape.h>
32 #include <geometry/circle.h>
33 
34 class LINE_READER;
35 class MSG_PANEL_ITEM;
36 
37 
39 enum class DIM_UNITS_FORMAT
40 {
41  NO_SUFFIX, // 1234.0
42  BARE_SUFFIX, // 1234.0 mm
43  PAREN_SUFFIX // 1234.0 (mm)
44 };
45 
48 {
49  OUTSIDE,
50  INLINE,
51  MANUAL
52 };
53 
57 enum class DIM_UNITS_MODE
58 {
59  INCHES,
60  MILS,
62  AUTOMATIC
63 };
64 
68 enum class DIM_TEXT_FRAME
69 {
70  NONE,
71  RECTANGLE,
72  CIRCLE,
73  ROUNDRECT
74 };
75 
96 {
97 public:
99 
100  bool IsType( const KICAD_T aScanTypes[] ) const override
101  {
102  if( BOARD_ITEM::IsType( aScanTypes ) )
103  return true;
104 
105  for( const KICAD_T* p = aScanTypes; *p != EOT; ++p )
106  {
107  if( *p == PCB_LOCATE_GRAPHIC_T )
108  return true;
109  }
110 
111  return false;
112  }
113 
114  void SetParent( EDA_ITEM* aParent ) override;
115 
121  virtual const wxPoint& GetStart() const { return m_start; }
122  virtual void SetStart( const wxPoint& aPoint ) { m_start = aPoint; }
123 
124  virtual const wxPoint& GetEnd() const { return m_end; }
125  virtual void SetEnd( const wxPoint& aPoint ) { m_end = aPoint; }
126 
127  wxPoint GetPosition() const override { return m_start; }
128  void SetPosition( const wxPoint& aPos ) override { m_start = aPos; }
129 
131  void SetOverrideTextEnabled( bool aOverride ) { m_overrideTextEnabled = aOverride; }
132 
133  wxString GetOverrideText() const { return m_valueString; }
134  void SetOverrideText( const wxString& aValue ) { m_valueString = aValue; }
135 
136  int GetMeasuredValue() const { return m_measuredValue; }
137 
138  // KiCad normally calculates the measured value but some importers need to set it.
139  void SetMeasuredValue( int aValue ) { m_measuredValue = aValue; }
140 
144  wxString GetValueText() const;
145 
149  void Update()
150  {
151  updateGeometry();
152  updateText();
153  }
154 
155  wxString GetPrefix() const { return m_prefix; }
156  void SetPrefix( const wxString& aPrefix );
157 
158  wxString GetSuffix() const { return m_suffix; }
159  void SetSuffix( const wxString& aSuffix );
160 
161  void GetUnits( EDA_UNITS& aUnits ) const { aUnits = m_units; }
162  void SetUnits( EDA_UNITS aUnits );
163 
165  void SetUnitsMode( DIM_UNITS_MODE aMode );
166 
167  void SetAutoUnits( bool aAuto = true ) { m_autoUnits = aAuto; }
168 
170  void SetUnitsFormat( const DIM_UNITS_FORMAT aFormat ) { m_unitsFormat = aFormat; }
171 
172  int GetPrecision() const { return m_precision; }
173  void SetPrecision( int aPrecision ) { m_precision = aPrecision; }
174 
175  bool GetSuppressZeroes() const { return m_suppressZeroes; }
176  void SetSuppressZeroes( bool aSuppress ) { m_suppressZeroes = aSuppress; }
177 
178  bool GetKeepTextAligned() const { return m_keepTextAligned; }
179  void SetKeepTextAligned( bool aKeepAligned ) { m_keepTextAligned = aKeepAligned; }
180 
183 
184  int GetArrowLength() const { return m_arrowLength; }
185  void SetArrowLength( int aLength ) { m_arrowLength = aLength; }
186 
187  void SetExtensionOffset( int aOffset ) { m_extensionOffset = aOffset; }
188  int GetExtensionOffset() const { return m_extensionOffset; }
189 
190  int GetLineThickness() const { return m_lineThickness; }
191  void SetLineThickness( int aWidth ) { m_lineThickness = aWidth; }
192 
193  void SetLayer( PCB_LAYER_ID aLayer ) override;
194 
195  void SetTextSize( const wxSize& aTextSize )
196  {
197  m_text.SetTextSize( aTextSize );
198  }
199 
205  void SetText( const wxString& aNewText );
206 
212  const wxString GetText() const;
213 
214  PCB_TEXT& Text() { return m_text; }
215  const PCB_TEXT& Text() const { return m_text; }
216 
220  const std::vector<std::shared_ptr<SHAPE>>& GetShapes() const { return m_shapes; }
221 
222  // BOARD_ITEM overrides
223 
224  void Move( const wxPoint& offset ) override;
225  void Rotate( const wxPoint& aRotCentre, double aAngle ) override;
226  void Flip( const wxPoint& aCentre, bool aFlipLeftRight ) override;
227 
236  void Mirror( const wxPoint& axis_pos, bool aMirrorLeftRight = false );
237 
238  void GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList ) override;
239 
240  bool HitTest( const wxPoint& aPosition, int aAccuracy ) const override;
241  bool HitTest( const EDA_RECT& aRect, bool aContained, int aAccuracy = 0 ) const override;
242 
243  const EDA_RECT GetBoundingBox() const override;
244 
245  std::shared_ptr<SHAPE> GetEffectiveShape( PCB_LAYER_ID aLayer ) const override;
246 
247  wxString GetSelectMenuText( EDA_UNITS aUnits ) const override;
248 
249  const BOX2I ViewBBox() const override;
250 
252  int aClearance, int aError, ERROR_LOC aErrorLoc,
253  bool aIgnoreLineWidth ) const override;
254 
255 #if defined(DEBUG)
256  virtual void Show( int nestLevel, std::ostream& os ) const override { ShowDummy( os ); }
257 #endif
258 
259 protected:
260 
264  virtual void updateGeometry() = 0;
265 
269  virtual void updateText();
270 
271  template<typename ShapeType>
272  void addShape( const ShapeType& aShape );
273 
282  static OPT_VECTOR2I segPolyIntersection( const SHAPE_POLY_SET& aPoly, const SEG& aSeg,
283  bool aStart = true );
284  static OPT_VECTOR2I segCircleIntersection( CIRCLE& aCircle, SEG& aSeg, bool aStart = true );
285 
286  // Value format
288  wxString m_valueString;
289  wxString m_prefix;
290  wxString m_suffix;
292  bool m_autoUnits;
296 
297  // Geometry
303 
304  // Internal
307  wxPoint m_start;
308  wxPoint m_end;
309 
311  std::vector<std::shared_ptr<SHAPE>> m_shapes;
312 
313  static constexpr float s_arrowAngle = 27.5;
314 };
315 
316 
345 {
346 public:
348 
349  // Do not create a copy constructor & operator=.
350  // The ones generated by the compiler are adequate.
351 
352  ~PCB_DIM_ALIGNED() = default;
353 
354  static inline bool ClassOf( const EDA_ITEM* aItem )
355  {
356  return aItem && PCB_DIM_ALIGNED_T == aItem->Type();
357  }
358 
359  EDA_ITEM* Clone() const override;
360 
361  virtual void SwapData( BOARD_ITEM* aImage ) override;
362 
363  BITMAPS GetMenuImage() const override;
364 
365  const wxPoint& GetCrossbarStart() const { return m_crossBarStart; }
366 
367  const wxPoint& GetCrossbarEnd() const { return m_crossBarEnd; }
368 
374  void SetHeight( int aHeight ) { m_height = aHeight; }
375  int GetHeight() const { return m_height; }
376 
382  void UpdateHeight( const wxPoint& aCrossbarStart, const wxPoint& aCrossbarEnd );
383 
384  void SetExtensionHeight( int aHeight ) { m_extensionHeight = aHeight; }
385  int GetExtensionHeight() const { return m_extensionHeight; }
386 
392  double GetAngle() const
393  {
394  wxPoint delta( m_end - m_start );
395 
396  return atan2( (double)delta.y, (double)delta.x );
397  }
398 
399  wxString GetClass() const override
400  {
401  return wxT( "PCB_DIM_ALIGNED" );
402  }
403 
404  void GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList ) override;
405 
406 protected:
407  void updateGeometry() override;
408 
409  void updateText() override;
410 
411  // Geometry
412  int m_height;
414 
415  wxPoint m_crossBarStart;
416  wxPoint m_crossBarEnd;
417 
418 };
419 
420 
426 {
427 public:
428  enum class DIR
429  {
430  HORIZONTAL, // Aligned with x-axis
431  VERTICAL // Aligned with y-axis
432  };
433 
434  PCB_DIM_ORTHOGONAL( BOARD_ITEM* aParent );
435 
436  ~PCB_DIM_ORTHOGONAL() = default;
437 
438  static inline bool ClassOf( const EDA_ITEM* aItem )
439  {
440  return aItem && PCB_DIM_ORTHOGONAL_T == aItem->Type();
441  }
442 
443  EDA_ITEM* Clone() const override;
444 
445  void SwapData( BOARD_ITEM* aImage ) override;
446 
447  BITMAPS GetMenuImage() const override;
448 
454  void SetOrientation( DIR aOrientation ) { m_orientation = aOrientation; }
455  DIR GetOrientation() const { return m_orientation; }
456 
457  wxString GetClass() const override
458  {
459  return wxT( "PCB_DIM_ORTHOGONAL" );
460  }
461  void Rotate( const wxPoint& aRotCentre, double aAngle ) override;
462 
463 protected:
464  void updateGeometry() override;
465 
466  void updateText() override;
467 
468 private:
469  // Geometry
471 
472 };
473 
474 
490 {
491 public:
492  PCB_DIM_LEADER( BOARD_ITEM* aParent );
493 
494  static inline bool ClassOf( const EDA_ITEM* aItem )
495  {
496  return aItem && PCB_DIM_LEADER_T == aItem->Type();
497  }
498 
499  EDA_ITEM* Clone() const override;
500 
501  virtual void SwapData( BOARD_ITEM* aImage ) override;
502 
503  BITMAPS GetMenuImage() const override;
504 
505  wxString GetClass() const override
506  {
507  return wxT( "PCB_DIM_LEADER" );
508  }
509 
510  void SetTextFrame( DIM_TEXT_FRAME aFrame ) { m_textFrame = aFrame; }
512 
513  void GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList ) override;
514 
515 protected:
516  void updateGeometry() override;
517 
518 private:
520 };
521 
522 
530 {
531 public:
532  PCB_DIM_CENTER( BOARD_ITEM* aParent );
533 
534  static inline bool ClassOf( const EDA_ITEM* aItem )
535  {
536  return aItem && PCB_DIM_CENTER_T == aItem->Type();
537  }
538 
539  EDA_ITEM* Clone() const override;
540 
541  virtual void SwapData( BOARD_ITEM* aImage ) override;
542 
543  BITMAPS GetMenuImage() const override;
544 
545  wxString GetClass() const override
546  {
547  return wxT( "PCB_DIM_CENTER" );
548  }
549 
550  const EDA_RECT GetBoundingBox() const override;
551 
552  const BOX2I ViewBBox() const override;
553 
554 protected:
555  void updateGeometry() override;
556 };
557 
558 #endif // DIMENSION_H
wxString m_prefix
String prepended to the value.
bool GetKeepTextAligned() const
double GetAngle() const
Return the angle of the crossbar.
static OPT_VECTOR2I segCircleIntersection(CIRCLE &aCircle, SEG &aSeg, bool aStart=true)
DIM_UNITS_FORMAT GetUnitsFormat() const
void SetUnits(EDA_UNITS aUnits)
int GetHeight() const
DIM_TEXT_POSITION
Where to place the text on a dimension.
Definition: pcb_dimension.h:47
virtual void SwapData(BOARD_ITEM *aImage) override
Swap data between aItem and aImage.
An abstract class from which implementation specific LINE_READERs may be derived to read single lines...
Definition: richio.h:80
static bool ClassOf(const EDA_ITEM *aItem)
class PCB_DIM_ALIGNED, a linear dimension (graphic item)
Definition: typeinfo.h:100
~PCB_DIM_ALIGNED()=default
class PCB_DIM_LEADER, a leader dimension (graphic item)
Definition: typeinfo.h:101
wxString GetValueText() const
const wxPoint & GetCrossbarStart() const
void SetHeight(int aHeight)
Set the distance from the feature points to the crossbar line.
const BOX2I ViewBBox() const override
Return the bounding box of the item covering all its layers.
DIR m_orientation
What axis to lock the dimension line to.
void SetUnitsFormat(const DIM_UNITS_FORMAT aFormat)
wxString GetSelectMenuText(EDA_UNITS aUnits) const override
Return the text to display to be used in the selection clarification context menu when multiple items...
std::vector< std::shared_ptr< SHAPE > > m_shapes
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
Definition: board_item.h:49
const EDA_RECT GetBoundingBox() const override
Return the orthogonal bounding box of this object for display purposes.
void updateText() override
Update the text field value from the current geometry (called by updateGeometry normally).
void SetOverrideText(const wxString &aValue)
int m_precision
Number of digits to display after decimal.
void SetKeepTextAligned(bool aKeepAligned)
EDA_ITEM * Clone() const override
Create a duplicate of this item with linked list members set to NULL.
PCB_TEXT & Text()
int GetExtensionOffset() const
void Mirror(const wxPoint &axis_pos, bool aMirrorLeftRight=false)
Mirror the dimension relative to a given horizontal axis.
class PCB_DIM_CENTER, a center point marking (graphic item)
Definition: typeinfo.h:102
const wxString GetText() const
Retrieve the value text or override text, not including prefix or suffix.
bool m_autoUnits
If true, follow the currently selected UI units.
const PCB_TEXT & Text() const
wxString GetClass() const override
Return the class name.
void SetText(const wxString &aNewText)
Set the override text - has no effect if m_overrideValue == false.
virtual void SwapData(BOARD_ITEM *aImage) override
Swap data between aItem and aImage.
const wxPoint & GetCrossbarEnd() const
const std::vector< std::shared_ptr< SHAPE > > & GetShapes() const
~PCB_DIM_ORTHOGONAL()=default
Text appears outside the dimension line (default)
bool GetOverrideTextEnabled() const
Abstract dimension API.
Definition: pcb_dimension.h:95
void SetTextSize(const wxSize &aNewSize)
Definition: eda_text.h:237
wxPoint m_crossBarEnd
Crossbar end control point.
void GetMsgPanelInfo(EDA_DRAW_FRAME *aFrame, std::vector< MSG_PANEL_ITEM > &aList) override
Populate aList of MSG_PANEL_ITEM objects with it's internal state for display purposes.
PCB_DIM_LEADER(BOARD_ITEM *aParent)
wxPoint m_end
Internal cache of drawn shapes.
void SetSuppressZeroes(bool aSuppress)
The base class for create windows for drawing purpose.
void updateText() override
Update the text field value from the current geometry (called by updateGeometry normally).
wxString m_suffix
String appended to the value.
void SetExtensionOffset(int aOffset)
PCB_TEXT m_text
The actual text object.
An orthogonal dimension is like an aligned dimension, but the extension lines are locked to the X or ...
int GetPrecision() const
search types array terminator (End Of Types)
Definition: typeinfo.h:81
KICAD_T
The set of class identification values stored in EDA_ITEM::m_structType.
Definition: typeinfo.h:77
wxPoint m_crossBarStart
Crossbar start control point.
ERROR_LOC
When approximating an arc or circle, should the error be placed on the outside or inside of the curve...
static bool ClassOf(const EDA_ITEM *aItem)
void SetLineThickness(int aWidth)
DIM_UNITS_MODE GetUnitsMode() const
For better understanding of the points that make a dimension:
void SwapData(BOARD_ITEM *aImage) override
Swap data between aItem and aImage.
Text appears in line with the dimension line.
EDA_UNITS m_units
0 = inches, 1 = mm
wxString GetPrefix() const
void SetLayer(PCB_LAYER_ID aLayer) override
Set the layer this item is on.
DIM_TEXT_FRAME GetTextFrame() const
virtual const wxPoint & GetStart() const
The dimension's origin is the first feature point for the dimension.
PCB_DIMENSION_BASE(BOARD_ITEM *aParent, KICAD_T aType=PCB_DIMENSION_T)
int GetExtensionHeight() const
EDA_ITEM * Clone() const override
Create a duplicate of this item with linked list members set to NULL.
void SetOverrideTextEnabled(bool aOverride)
void GetMsgPanelInfo(EDA_DRAW_FRAME *aFrame, std::vector< MSG_PANEL_ITEM > &aList) override
Populate aList of MSG_PANEL_ITEM objects with it's internal state for display purposes.
DIM_UNITS_MODE
Used for storing the units selection in the file because EDA_UNITS alone doesn't cut it.
Definition: pcb_dimension.h:57
void updateGeometry() override
Update the cached geometry of the dimension after changing any of its properties.
DIR GetOrientation() const
wxString GetClass() const override
Return the class name.
void SetTextSize(const wxSize &aTextSize)
int GetArrowLength() const
virtual void updateGeometry()=0
Update the cached geometry of the dimension after changing any of its properties.
OPT< VECTOR2I > OPT_VECTOR2I
Definition: seg.h:38
wxString GetSuffix() const
void updateGeometry() override
Update the cached geometry of the dimension after changing any of its properties.
Represent a set of closed polygons.
virtual void SetEnd(const wxPoint &aPoint)
void updateGeometry() override
Update the cached geometry of the dimension after changing any of its properties.
void SetPosition(const wxPoint &aPos) override
BITMAPS GetMenuImage() const override
Return a pointer to an image to be used in menus.
DIM_UNITS_FORMAT
How to display the units in a dimension's text.
Definition: pcb_dimension.h:39
bool GetSuppressZeroes() const
wxPoint GetPosition() const override
void SetParent(EDA_ITEM *aParent) override
static bool ClassOf(const EDA_ITEM *aItem)
void SetPrefix(const wxString &aPrefix)
Mark the center of a circle or arc with a cross shape.
void SetExtensionHeight(int aHeight)
void Move(const wxPoint &offset) override
Move this object.
const BOX2I ViewBBox() const override
Return the bounding box of the item covering all its layers.
int m_extensionHeight
Length of extension lines past the crossbar.
void SetArrowLength(int aLength)
void Rotate(const wxPoint &aRotCentre, double aAngle) override
Rotate this object.
void SetAutoUnits(bool aAuto=true)
bool m_keepTextAligned
Calculate text orientation to match dimension.
virtual bool IsType(const KICAD_T aScanTypes[]) const
Check whether the item is one of the listed types.
Definition: eda_item.h:183
void SetSuffix(const wxString &aSuffix)
Represent basic circle geometry with utility geometry functions.
Definition: circle.h:32
void GetMsgPanelInfo(EDA_DRAW_FRAME *aFrame, std::vector< MSG_PANEL_ITEM > &aList) override
Populate aList of MSG_PANEL_ITEM objects with it's internal state for display purposes.
bool IsType(const KICAD_T aScanTypes[]) const override
Check whether the item is one of the listed types.
void SetPrecision(int aPrecision)
void SetOrientation(DIR aOrientation)
Set the orientation of the dimension line (so, perpendicular to the feature lines).
int GetMeasuredValue() const
class PCB_DIMENSION_BASE: abstract dimension meta-type
Definition: typeinfo.h:99
void SetMeasuredValue(int aValue)
void Flip(const wxPoint &aCentre, bool aFlipLeftRight) override
Flip this object, i.e.
BITMAPS GetMenuImage() const override
Return a pointer to an image to be used in menus.
bool m_suppressZeroes
Suppress trailing zeroes.
PCB_DIM_ORTHOGONAL(BOARD_ITEM *aParent)
static constexpr float s_arrowAngle
Definition: seg.h:40
EDA_UNITS
Definition: eda_units.h:38
void TransformShapeWithClearanceToPolygon(SHAPE_POLY_SET &aCornerBuffer, PCB_LAYER_ID aLayer, int aClearance, int aError, ERROR_LOC aErrorLoc, bool aIgnoreLineWidth) const override
Convert the item shape to a closed polygon.
void UpdateHeight(const wxPoint &aCrossbarStart, const wxPoint &aCrossbarEnd)
Update the stored height basing on points coordinates.
wxString GetClass() const override
Return the class name.
DIM_UNITS_FORMAT m_unitsFormat
How to render the units suffix.
EDA_ITEM * Clone() const override
Create a duplicate of this item with linked list members set to NULL.
BITMAPS GetMenuImage() const override
Return a pointer to an image to be used in menus.
BITMAPS
A list of all bitmap identifiers.
Definition: bitmaps_list.h:32
BITMAPS GetMenuImage() const override
Return a pointer to an image to be used in menus.
bool m_overrideTextEnabled
Manually specify the displayed measurement value.
void Rotate(const wxPoint &aRotCentre, double aAngle) override
Rotate this object.
PCB_LAYER_ID
A quick note on layer IDs:
Definition: layer_ids.h:65
wxString m_valueString
Displayed value when m_overrideValue = true.
void GetUnits(EDA_UNITS &aUnits) const
void addShape(const ShapeType &aShape)
const EDA_RECT GetBoundingBox() const override
Return the orthogonal bounding box of this object for display purposes.
Handle the component boundary box.
Definition: eda_rect.h:42
virtual void SetStart(const wxPoint &aPoint)
PCB_DIM_CENTER(BOARD_ITEM *aParent)
A base class for most all the KiCad significant classes used in schematics and boards.
Definition: eda_item.h:100
int m_lineThickness
Thickness used for all graphics in the dimension.
void SetTextFrame(DIM_TEXT_FRAME aFrame)
DIM_TEXT_FRAME m_textFrame
A leader is a dimension-like object pointing to a specific point.
constexpr int delta
class PCB_DIM_ORTHOGONAL, a linear dimension constrained to x/y
Definition: typeinfo.h:103
wxString GetClass() const override
Return the class name.
virtual const wxPoint & GetEnd() const
static OPT_VECTOR2I segPolyIntersection(const SHAPE_POLY_SET &aPoly, const SEG &aSeg, bool aStart=true)
Find the intersection between a given segment and polygon outline.
int m_extensionOffset
Distance from feature points to extension line start.
EDA_MSG_PANEL items for displaying messages.
Definition: msgpanel.h:53
int m_height
Perpendicular distance from features to crossbar.
PCB_DIM_ALIGNED(BOARD_ITEM *aParent, KICAD_T aType=PCB_DIM_ALIGNED_T)
Text placement is manually set by the user.
void SetUnitsMode(DIM_UNITS_MODE aMode)
DIM_TEXT_POSITION GetTextPositionMode() const
std::shared_ptr< SHAPE > GetEffectiveShape(PCB_LAYER_ID aLayer) const override
Some pad shapes can be complex (rounded/chamfered rectangle), even without considering custom shapes.
virtual void SwapData(BOARD_ITEM *aImage) override
Swap data between aItem and aImage.
EDA_ITEM * Clone() const override
Create a duplicate of this item with linked list members set to NULL.
int GetLineThickness() const
wxString GetOverrideText() const
int m_measuredValue
value of PCB dimensions
DIM_TEXT_POSITION m_textPosition
How to position the text.
DIM_TEXT_FRAME
Frame to show around dimension text.
Definition: pcb_dimension.h:68
void SetTextPositionMode(DIM_TEXT_POSITION aMode)
static bool ClassOf(const EDA_ITEM *aItem)
bool HitTest(const wxPoint &aPosition, int aAccuracy) const override
Test if aPosition is contained within or on the bounding box of an item.
virtual void updateText()
Update the text field value from the current geometry (called by updateGeometry normally).
KICAD_T Type() const
Returns the type of object.
Definition: eda_item.h:113
void updateGeometry() override
Update the cached geometry of the dimension after changing any of its properties.
int m_arrowLength
Length of arrow shapes.
void Update()
Update the dimension's cached text and geometry.