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, [email protected]
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,
246  FLASHING aFlash = FLASHING::DEFAULT ) const override;
247 
248  wxString GetSelectMenuText( EDA_UNITS aUnits ) const override;
249 
250  const BOX2I ViewBBox() const override;
251 
253  int aClearance, int aError, ERROR_LOC aErrorLoc,
254  bool aIgnoreLineWidth ) const override;
255 
256 #if defined(DEBUG)
257  virtual void Show( int nestLevel, std::ostream& os ) const override { ShowDummy( os ); }
258 #endif
259 
260 protected:
261 
265  virtual void updateGeometry() = 0;
266 
270  virtual void updateText();
271 
272  template<typename ShapeType>
273  void addShape( const ShapeType& aShape );
274 
283  static OPT_VECTOR2I segPolyIntersection( const SHAPE_POLY_SET& aPoly, const SEG& aSeg,
284  bool aStart = true );
285  static OPT_VECTOR2I segCircleIntersection( CIRCLE& aCircle, SEG& aSeg, bool aStart = true );
286 
287  // Value format
289  wxString m_valueString;
290  wxString m_prefix;
291  wxString m_suffix;
293  bool m_autoUnits;
297 
298  // Geometry
304 
305  // Internal
308  wxPoint m_start;
309  wxPoint m_end;
310 
312  std::vector<std::shared_ptr<SHAPE>> m_shapes;
313 
314  static constexpr float s_arrowAngle = 27.5;
315 };
316 
317 
346 {
347 public:
349 
350  // Do not create a copy constructor & operator=.
351  // The ones generated by the compiler are adequate.
352 
353  ~PCB_DIM_ALIGNED() = default;
354 
355  static inline bool ClassOf( const EDA_ITEM* aItem )
356  {
357  return aItem && PCB_DIM_ALIGNED_T == aItem->Type();
358  }
359 
360  EDA_ITEM* Clone() const override;
361 
362  virtual void SwapData( BOARD_ITEM* aImage ) override;
363 
364  BITMAPS GetMenuImage() const override;
365 
366  const wxPoint& GetCrossbarStart() const { return m_crossBarStart; }
367 
368  const wxPoint& GetCrossbarEnd() const { return m_crossBarEnd; }
369 
375  void SetHeight( int aHeight ) { m_height = aHeight; }
376  int GetHeight() const { return m_height; }
377 
383  void UpdateHeight( const wxPoint& aCrossbarStart, const wxPoint& aCrossbarEnd );
384 
385  void SetExtensionHeight( int aHeight ) { m_extensionHeight = aHeight; }
386  int GetExtensionHeight() const { return m_extensionHeight; }
387 
393  double GetAngle() const
394  {
395  wxPoint delta( m_end - m_start );
396 
397  return atan2( (double)delta.y, (double)delta.x );
398  }
399 
400  wxString GetClass() const override
401  {
402  return wxT( "PCB_DIM_ALIGNED" );
403  }
404 
405  void GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList ) override;
406 
407 protected:
408  void updateGeometry() override;
409 
410  void updateText() override;
411 
412  // Geometry
413  int m_height;
415 
416  wxPoint m_crossBarStart;
417  wxPoint m_crossBarEnd;
418 
419 };
420 
421 
427 {
428 public:
429  enum class DIR
430  {
431  HORIZONTAL, // Aligned with x-axis
432  VERTICAL // Aligned with y-axis
433  };
434 
435  PCB_DIM_ORTHOGONAL( BOARD_ITEM* aParent );
436 
437  ~PCB_DIM_ORTHOGONAL() = default;
438 
439  static inline bool ClassOf( const EDA_ITEM* aItem )
440  {
441  return aItem && PCB_DIM_ORTHOGONAL_T == aItem->Type();
442  }
443 
444  EDA_ITEM* Clone() const override;
445 
446  void SwapData( BOARD_ITEM* aImage ) override;
447 
448  BITMAPS GetMenuImage() const override;
449 
455  void SetOrientation( DIR aOrientation ) { m_orientation = aOrientation; }
456  DIR GetOrientation() const { return m_orientation; }
457 
458  wxString GetClass() const override
459  {
460  return wxT( "PCB_DIM_ORTHOGONAL" );
461  }
462  void Rotate( const wxPoint& aRotCentre, double aAngle ) override;
463 
464 protected:
465  void updateGeometry() override;
466 
467  void updateText() override;
468 
469 private:
470  // Geometry
472 
473 };
474 
475 
491 {
492 public:
493  PCB_DIM_LEADER( BOARD_ITEM* aParent );
494 
495  static inline bool ClassOf( const EDA_ITEM* aItem )
496  {
497  return aItem && PCB_DIM_LEADER_T == aItem->Type();
498  }
499 
500  EDA_ITEM* Clone() const override;
501 
502  virtual void SwapData( BOARD_ITEM* aImage ) override;
503 
504  BITMAPS GetMenuImage() const override;
505 
506  wxString GetClass() const override
507  {
508  return wxT( "PCB_DIM_LEADER" );
509  }
510 
511  void SetTextFrame( DIM_TEXT_FRAME aFrame ) { m_textFrame = aFrame; }
513 
514  void GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList ) override;
515 
516 protected:
517  void updateGeometry() override;
518 
519 private:
521 };
522 
523 
531 {
532 public:
533  PCB_DIM_CENTER( BOARD_ITEM* aParent );
534 
535  static inline bool ClassOf( const EDA_ITEM* aItem )
536  {
537  return aItem && PCB_DIM_CENTER_T == aItem->Type();
538  }
539 
540  EDA_ITEM* Clone() const override;
541 
542  virtual void SwapData( BOARD_ITEM* aImage ) override;
543 
544  BITMAPS GetMenuImage() const override;
545 
546  wxString GetClass() const override
547  {
548  return wxT( "PCB_DIM_CENTER" );
549  }
550 
551  const EDA_RECT GetBoundingBox() const override;
552 
553  const BOX2I ViewBBox() const override;
554 
555 protected:
556  void updateGeometry() override;
557 };
558 
559 #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)
std::shared_ptr< SHAPE > GetEffectiveShape(PCB_LAYER_ID aLayer, FLASHING aFlash=FLASHING::DEFAULT) const override
Some pad shapes can be complex (rounded/chamfered rectangle), even without considering custom shapes.
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:258
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:182
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.
FLASHING
Enum used during connectivity building to ensure we do not query connectivity while building the data...
Definition: layer_ids.h:153
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:99
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
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 inside or on the boundary of this 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:112
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.