KiCad PCB EDA Suite
Loading...
Searching...
No Matches
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-2023 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
34class LINE_READER;
35class MSG_PANEL_ITEM;
36
37
40{
41 NO_SUFFIX, // 1234.0
42 BARE_SUFFIX, // 1234.0 mm
43 PAREN_SUFFIX // 1234.0 (mm)
44};
45
46enum class DIM_PRECISION
47{
48 X = 0, // 0
49 X_X, // 0.0
50 X_XX, // 0.00
51 X_XXX, // 0.000
52 X_XXXX, // 0.0000
53 X_XXXXX, // 0.00000
54 V_VV, // 0.00 / 0 / 0.0
55 V_VVV, // 0.000 / 0 / 0.00
56 V_VVVV, // 0.0000 / 0.0 / 0.000
57 V_VVVVV // 0.00000 / 0.00 / 0.0000
58};
59
62{
63 OUTSIDE,
64 INLINE,
65 MANUAL
66};
67
72{
73 INCHES,
74 MILS,
77};
78
83{
84 NONE,
86 CIRCLE,
88};
89
110{
111public:
113
119 virtual const VECTOR2I& GetStart() const { return m_start; }
120 virtual void SetStart( const VECTOR2I& aPoint ) { m_start = aPoint; }
121
122 virtual const VECTOR2I& GetEnd() const { return m_end; }
123 virtual void SetEnd( const VECTOR2I& aPoint ) { m_end = aPoint; }
124
125 VECTOR2I GetPosition() const override { return m_start; }
126 void SetPosition( const VECTOR2I& aPos ) override { m_start = aPos; }
127
129 void SetOverrideTextEnabled( bool aOverride ) { m_overrideTextEnabled = aOverride; }
130
131 wxString GetOverrideText() const { return m_valueString; }
132 void SetOverrideText( const wxString& aValue ) { m_valueString = aValue; }
133
134 void ChangeOverrideText( const wxString& aValue )
135 {
137 SetOverrideText( aValue );
138 Update();
139 }
140
141 int GetMeasuredValue() const { return m_measuredValue; }
142
143 // KiCad normally calculates the measured value but some importers need to set it.
144 void SetMeasuredValue( int aValue ) { m_measuredValue = aValue; }
145
149 wxString GetValueText() const;
150
158 void Update()
159 {
160 // Calls updateText internally
162 }
163
165 {
167 Update();
168 }
169
170 wxString GetPrefix() const { return m_prefix; }
171 void SetPrefix( const wxString& aPrefix );
172
173 void ChangePrefix( const wxString& aPrefix )
174 {
175 SetPrefix( aPrefix );
176 Update();
177 }
178
179 wxString GetSuffix() const { return m_suffix; }
180 void SetSuffix( const wxString& aSuffix );
181
182 void ChangeSuffix( const wxString& aSuffix )
183 {
184 SetSuffix( aSuffix );
185 Update();
186 }
187
188 EDA_UNITS GetUnits() const { return m_units; }
189 void SetUnits( EDA_UNITS aUnits );
190
192 void SetUnitsMode( DIM_UNITS_MODE aMode );
193
195 {
196 SetUnitsMode( aMode );
197 Update();
198 }
199
200 void SetAutoUnits( bool aAuto = true ) { m_autoUnits = aAuto; }
201
203 void SetUnitsFormat( const DIM_UNITS_FORMAT aFormat ) { m_unitsFormat = aFormat; }
204
206 {
207 SetUnitsFormat( aFormat );
208 Update();
209 }
210
212 void SetPrecision( DIM_PRECISION aPrecision ) { m_precision = aPrecision; }
213
215 {
216 SetPrecision( aPrecision );
217 Update();
218 }
219
220 bool GetSuppressZeroes() const { return m_suppressZeroes; }
221 void SetSuppressZeroes( bool aSuppress ) { m_suppressZeroes = aSuppress; }
222
223 void ChangeSuppressZeroes( bool aSuppress )
224 {
225 SetSuppressZeroes( aSuppress );
226 Update();
227 }
228
229 bool GetKeepTextAligned() const { return m_keepTextAligned; }
230 void SetKeepTextAligned( bool aKeepAligned ) { m_keepTextAligned = aKeepAligned; }
231
232 double GetTextAngleDegreesProp() const { return GetTextAngleDegrees(); }
233 void ChangeTextAngleDegrees( double aDegrees );
234 void ChangeKeepTextAligned( bool aKeepAligned );
235
238
239 int GetArrowLength() const { return m_arrowLength; }
240 void SetArrowLength( int aLength ) { m_arrowLength = aLength; }
241
242 void SetExtensionOffset( int aOffset ) { m_extensionOffset = aOffset; }
243 int GetExtensionOffset() const { return m_extensionOffset; }
244
245 int GetLineThickness() const { return m_lineThickness; }
246 void SetLineThickness( int aWidth ) { m_lineThickness = aWidth; }
247
251 const std::vector<std::shared_ptr<SHAPE>>& GetShapes() const { return m_shapes; }
252
253 // BOARD_ITEM overrides
254
255 void Move( const VECTOR2I& offset ) override;
256 void Rotate( const VECTOR2I& aRotCentre, const EDA_ANGLE& aAngle ) override;
257 void Flip( const VECTOR2I& aCentre, bool aFlipLeftRight ) override;
258
267 virtual void Mirror( const VECTOR2I& axis_pos, bool aMirrorLeftRight = false );
268
269 void GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList ) override;
270
271 bool HitTest( const VECTOR2I& aPosition, int aAccuracy ) const override;
272 bool HitTest( const BOX2I& aRect, bool aContained, int aAccuracy = 0 ) const override;
273
274 const BOX2I GetBoundingBox() const override;
275
276 std::shared_ptr<SHAPE> GetEffectiveShape( PCB_LAYER_ID aLayer,
277 FLASHING aFlash = FLASHING::DEFAULT ) const override;
278
279 wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const override;
280
281 const BOX2I ViewBBox() const override;
282
283 void ClearRenderCache() override;
284
285 void TransformShapeToPolygon( SHAPE_POLY_SET& aBuffer, PCB_LAYER_ID aLayer, int aClearance,
286 int aError, ERROR_LOC aErrorLoc,
287 bool aIgnoreLineWidth = false ) const override;
288
289 double Similarity( const BOARD_ITEM& aOther ) const override;
290
291 bool operator==( const PCB_DIMENSION_BASE& aOther ) const;
292 bool operator==( const BOARD_ITEM& aBoardItem ) const override;
293
294#if defined(DEBUG)
295 virtual void Show( int nestLevel, std::ostream& os ) const override { ShowDummy( os ); }
296#endif
297
298protected:
299
303 virtual void updateGeometry() = 0;
304
311 virtual void updateText();
312
313 template<typename ShapeType>
314 void addShape( const ShapeType& aShape );
315
324 static OPT_VECTOR2I segPolyIntersection( const SHAPE_POLY_SET& aPoly, const SEG& aSeg,
325 bool aStart = true );
326 static OPT_VECTOR2I segCircleIntersection( CIRCLE& aCircle, SEG& aSeg, bool aStart = true );
327
328 // Value format
330 wxString m_valueString;
331 wxString m_prefix;
332 wxString m_suffix;
338
339 // Geometry
345
346 // Internal
350
352 std::vector<std::shared_ptr<SHAPE>> m_shapes;
353
355};
356
357
386{
387public:
389
390 // Do not create a copy constructor & operator=.
391 // The ones generated by the compiler are adequate.
392
393 ~PCB_DIM_ALIGNED() = default;
394
395 static inline bool ClassOf( const EDA_ITEM* aItem )
396 {
397 return aItem && aItem->Type() == PCB_DIM_ALIGNED_T;
398 }
399
400 EDA_ITEM* Clone() const override;
401
402 void Mirror( const VECTOR2I& axis_pos, bool aMirrorLeftRight = false ) override;
403
404 BITMAPS GetMenuImage() const override;
405
406 const VECTOR2I& GetCrossbarStart() const { return m_crossBarStart; }
407
408 const VECTOR2I& GetCrossbarEnd() const { return m_crossBarEnd; }
409
415 void SetHeight( int aHeight ) { m_height = aHeight; }
416 int GetHeight() const { return m_height; }
417
418 void ChangeHeight( int aHeight )
419 {
420 SetHeight( aHeight );
421 Update();
422 }
423
429 void UpdateHeight( const VECTOR2I& aCrossbarStart, const VECTOR2I& aCrossbarEnd );
430
431 void SetExtensionHeight( int aHeight ) { m_extensionHeight = aHeight; }
432 int GetExtensionHeight() const { return m_extensionHeight; }
433
434 void ChangeExtensionHeight( int aHeight )
435 {
436 SetExtensionHeight( aHeight );
437 Update();
438 }
439
445 double GetAngle() const
446 {
448
449 return atan2( (double)delta.y, (double)delta.x );
450 }
451
452 wxString GetClass() const override
453 {
454 return wxT( "PCB_DIM_ALIGNED" );
455 }
456
457 void GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList ) override;
458
459protected:
460 virtual void swapData( BOARD_ITEM* aImage ) override;
461
462 void updateGeometry() override;
463
464 void updateText() override;
465
466 // Geometry
469
472
473};
474
475
481{
482public:
483 enum class DIR
484 {
485 HORIZONTAL, // Aligned with x-axis
486 VERTICAL // Aligned with y-axis
487 };
488
489 PCB_DIM_ORTHOGONAL( BOARD_ITEM* aParent );
490
492
493 static inline bool ClassOf( const EDA_ITEM* aItem )
494 {
495 return aItem && aItem->Type() == PCB_DIM_ORTHOGONAL_T;
496 }
497
498 EDA_ITEM* Clone() const override;
499
500 BITMAPS GetMenuImage() const override;
501
507 void SetOrientation( DIR aOrientation ) { m_orientation = aOrientation; }
508 DIR GetOrientation() const { return m_orientation; }
509
510 wxString GetClass() const override
511 {
512 return wxT( "PCB_DIM_ORTHOGONAL" );
513 }
514 void Rotate( const VECTOR2I& aRotCentre, const EDA_ANGLE& aAngle ) override;
515
516protected:
517 void swapData( BOARD_ITEM* aImage ) override;
518
519 void updateGeometry() override;
520
521 void updateText() override;
522
523private:
524 // Geometry
526
527};
528
529
551{
552public:
553 PCB_DIM_RADIAL( BOARD_ITEM* aParent );
554
555 static inline bool ClassOf( const EDA_ITEM* aItem )
556 {
557 return aItem && aItem->Type() == PCB_DIM_RADIAL_T;
558 }
559
560 EDA_ITEM* Clone() const override;
561
562 void SetLeaderLength( int aLength ) { m_leaderLength = aLength; }
563 int GetLeaderLength() const { return m_leaderLength; }
564
565 void ChangeLeaderLength( int aLength )
566 {
567 SetLeaderLength( aLength );
568 Update();
569 }
570
571 // Returns the point (c).
572 VECTOR2I GetKnee() const;
573
574 BITMAPS GetMenuImage() const override;
575
576 wxString GetClass() const override
577 {
578 return wxT( "PCB_DIM_RADIAL" );
579 }
580
581protected:
582 virtual void swapData( BOARD_ITEM* aImage ) override;
583
584 void updateText() override;
585 void updateGeometry() override;
586
587private:
590};
591
592
607{
608public:
609 PCB_DIM_LEADER( BOARD_ITEM* aParent );
610
611 static inline bool ClassOf( const EDA_ITEM* aItem )
612 {
613 return aItem && aItem->Type() == PCB_DIM_LEADER_T;
614 }
615
616 EDA_ITEM* Clone() const override;
617
618 BITMAPS GetMenuImage() const override;
619
620 wxString GetClass() const override
621 {
622 return wxT( "PCB_DIM_LEADER" );
623 }
624
625 void SetTextBorder( DIM_TEXT_BORDER aBorder ) { m_textBorder = aBorder; }
627
629 {
630 SetTextBorder( aBorder );
631 Update();
632 }
633
634 void GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList ) override;
635
636protected:
637 virtual void swapData( BOARD_ITEM* aImage ) override;
638
639 void updateText() override;
640 void updateGeometry() override;
641
642private:
644};
645
646
654{
655public:
656 PCB_DIM_CENTER( BOARD_ITEM* aParent );
657
658 static inline bool ClassOf( const EDA_ITEM* aItem )
659 {
660 return aItem && aItem->Type() == PCB_DIM_CENTER_T;
661 }
662
663 EDA_ITEM* Clone() const override;
664
665 BITMAPS GetMenuImage() const override;
666
667 wxString GetClass() const override
668 {
669 return wxT( "PCB_DIM_CENTER" );
670 }
671
672 const BOX2I GetBoundingBox() const override;
673
674 const BOX2I ViewBBox() const override;
675
676protected:
677 virtual void swapData( BOARD_ITEM* aImage ) override;
678
679 void updateGeometry() override;
680};
681
682#endif // DIMENSION_H
BITMAPS
A list of all bitmap identifiers.
Definition: bitmaps_list.h:33
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
Definition: board_item.h:79
Represent basic circle geometry with utility geometry functions.
Definition: circle.h:33
The base class for create windows for drawing purpose.
A base class for most all the KiCad significant classes used in schematics and boards.
Definition: eda_item.h:89
KICAD_T Type() const
Returns the type of object.
Definition: eda_item.h:101
double GetTextAngleDegrees() const
Definition: eda_text.h:137
An abstract class from which implementation specific LINE_READERs may be derived to read single lines...
Definition: richio.h:93
EDA_MSG_PANEL items for displaying messages.
Definition: msgpanel.h:54
Abstract dimension API.
EDA_UNITS GetUnits() const
bool m_autoUnits
If true, follow the currently selected UI units.
void Update()
Update the dimension's cached text and geometry.
void ChangeSuffix(const wxString &aSuffix)
wxString GetOverrideText() const
wxString GetSuffix() const
std::vector< std::shared_ptr< SHAPE > > m_shapes
double Similarity(const BOARD_ITEM &aOther) const override
Return a measure of how likely the other object is to represent the same object.
void TransformShapeToPolygon(SHAPE_POLY_SET &aBuffer, PCB_LAYER_ID aLayer, int aClearance, int aError, ERROR_LOC aErrorLoc, bool aIgnoreLineWidth=false) const override
Convert the item shape to a closed polygon.
virtual void updateGeometry()=0
Update the cached geometry of the dimension after changing any of its properties.
void Flip(const VECTOR2I &aCentre, bool aFlipLeftRight) override
Flip this object, i.e.
void ClearRenderCache() override
int m_lineThickness
Thickness used for all graphics in the dimension.
void Move(const VECTOR2I &offset) override
Move this object.
void SetUnitsFormat(const DIM_UNITS_FORMAT aFormat)
bool m_suppressZeroes
Suppress trailing zeroes.
wxString GetItemDescription(UNITS_PROVIDER *aUnitsProvider, bool aFull) const override
Return a user-visible description string of this item.
void SetMeasuredValue(int aValue)
int GetLineThickness() const
void SetUnits(EDA_UNITS aUnits)
DIM_PRECISION m_precision
Number of digits to display after decimal.
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.
static OPT_VECTOR2I segCircleIntersection(CIRCLE &aCircle, SEG &aSeg, bool aStart=true)
void addShape(const ShapeType &aShape)
void SetPrefix(const wxString &aPrefix)
wxString m_suffix
String appended to the value.
const BOX2I GetBoundingBox() const override
Return the orthogonal bounding box of this object for display purposes.
void ChangeOverrideText(const wxString &aValue)
void SetExtensionOffset(int aOffset)
void SetSuppressZeroes(bool aSuppress)
bool m_inClearRenderCache
re-entrancy guard
int m_extensionOffset
Distance from feature points to extension line start.
DIM_TEXT_POSITION GetTextPositionMode() const
bool GetKeepTextAligned() const
void ChangeTextAngleDegrees(double aDegrees)
bool m_keepTextAligned
Calculate text orientation to match dimension.
DIM_PRECISION GetPrecision() const
wxString GetPrefix() const
void SetOverrideTextEnabled(bool aOverride)
void SetSuffix(const wxString &aSuffix)
bool operator==(const PCB_DIMENSION_BASE &aOther) const
const std::vector< std::shared_ptr< SHAPE > > & GetShapes() const
DIM_UNITS_MODE GetUnitsMode() const
void SetTextPositionMode(DIM_TEXT_POSITION aMode)
virtual void updateText()
Update the text field value from the current geometry (called by updateGeometry normally).
bool HitTest(const VECTOR2I &aPosition, int aAccuracy) const override
Test if aPosition is inside or on the boundary of this item.
EDA_UNITS m_units
0 = inches, 1 = mm
int m_measuredValue
value of PCB dimensions
DIM_UNITS_FORMAT GetUnitsFormat() const
void SetLineThickness(int aWidth)
void SetArrowLength(int aLength)
virtual const VECTOR2I & GetStart() const
The dimension's origin is the first feature point for the dimension.
wxString m_valueString
Displayed value when m_overrideValue = true.
void ChangePrecision(DIM_PRECISION aPrecision)
virtual void SetEnd(const VECTOR2I &aPoint)
void SetPrecision(DIM_PRECISION aPrecision)
bool m_overrideTextEnabled
Manually specify the displayed measurement value.
virtual void SetStart(const VECTOR2I &aPoint)
void SetAutoUnits(bool aAuto=true)
DIM_UNITS_FORMAT m_unitsFormat
How to render the units suffix.
int GetMeasuredValue() const
bool GetSuppressZeroes() const
const BOX2I ViewBBox() const override
Return the bounding box of the item covering all its layers.
DIM_TEXT_POSITION m_textPosition
How to position the text.
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.
void SetOverrideText(const wxString &aValue)
wxString GetValueText() const
int GetExtensionOffset() const
void ChangePrefix(const wxString &aPrefix)
wxString m_prefix
String prepended to the value.
void Rotate(const VECTOR2I &aRotCentre, const EDA_ANGLE &aAngle) override
Rotate this object.
void SetPosition(const VECTOR2I &aPos) override
void ChangeKeepTextAligned(bool aKeepAligned)
void ChangeUnitsFormat(const DIM_UNITS_FORMAT aFormat)
void ChangeSuppressZeroes(bool aSuppress)
int GetArrowLength() const
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.
virtual void Mirror(const VECTOR2I &axis_pos, bool aMirrorLeftRight=false)
Mirror the dimension relative to a given horizontal axis.
double GetTextAngleDegreesProp() const
bool GetOverrideTextEnabled() const
void SetUnitsMode(DIM_UNITS_MODE aMode)
int m_arrowLength
Length of arrow shapes.
virtual const VECTOR2I & GetEnd() const
VECTOR2I m_end
Internal cache of drawn shapes.
void ChangeUnitsMode(DIM_UNITS_MODE aMode)
void SetKeepTextAligned(bool aKeepAligned)
VECTOR2I GetPosition() const override
For better understanding of the points that make a dimension:
int GetHeight() const
const VECTOR2I & GetCrossbarStart() const
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.
int m_height
Perpendicular distance from features to crossbar.
void ChangeExtensionHeight(int aHeight)
wxString GetClass() const override
Return the class name.
void updateText() override
Update the text field value from the current geometry (called by updateGeometry normally).
void SetExtensionHeight(int aHeight)
const VECTOR2I & GetCrossbarEnd() const
~PCB_DIM_ALIGNED()=default
VECTOR2I m_crossBarStart
Crossbar start control point.
void UpdateHeight(const VECTOR2I &aCrossbarStart, const VECTOR2I &aCrossbarEnd)
Update the stored height basing on points coordinates.
virtual void swapData(BOARD_ITEM *aImage) override
int m_extensionHeight
Length of extension lines past the crossbar.
double GetAngle() const
Return the angle of the crossbar.
void SetHeight(int aHeight)
Set the distance from the feature points to the crossbar line.
static bool ClassOf(const EDA_ITEM *aItem)
VECTOR2I m_crossBarEnd
Crossbar end control point.
void Mirror(const VECTOR2I &axis_pos, bool aMirrorLeftRight=false) override
Mirror the dimension relative to a given horizontal axis.
void ChangeHeight(int aHeight)
void updateGeometry() override
Update the cached geometry of the dimension after changing any of its properties.
int GetExtensionHeight() const
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.
Mark the center of a circle or arc with a cross shape.
EDA_ITEM * Clone() const override
Create a duplicate of this item with linked list members set to NULL.
const BOX2I GetBoundingBox() const override
Return the orthogonal bounding box of this object for display purposes.
void updateGeometry() override
Update the cached geometry of the dimension after changing any of its properties.
wxString GetClass() const override
Return the class name.
const BOX2I ViewBBox() const override
Return the bounding box of the item covering all its layers.
virtual void swapData(BOARD_ITEM *aImage) override
BITMAPS GetMenuImage() const override
Return a pointer to an image to be used in menus.
static bool ClassOf(const EDA_ITEM *aItem)
A leader is a dimension-like object pointing to a specific 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.
DIM_TEXT_BORDER m_textBorder
BITMAPS GetMenuImage() const override
Return a pointer to an image to be used in menus.
DIM_TEXT_BORDER GetTextBorder() const
virtual void swapData(BOARD_ITEM *aImage) override
static bool ClassOf(const EDA_ITEM *aItem)
void updateGeometry() override
Update the cached geometry of the dimension after changing any of its properties.
void updateText() override
Update the text field value from the current geometry (called by updateGeometry normally).
void SetTextBorder(DIM_TEXT_BORDER aBorder)
EDA_ITEM * Clone() const override
Create a duplicate of this item with linked list members set to NULL.
void ChangeTextBorder(DIM_TEXT_BORDER aBorder)
wxString GetClass() const override
Return the class name.
An orthogonal dimension is like an aligned dimension, but the extension lines are locked to the X or ...
void swapData(BOARD_ITEM *aImage) override
wxString GetClass() const override
Return the class name.
static bool ClassOf(const EDA_ITEM *aItem)
void updateText() override
Update the text field value from the current geometry (called by updateGeometry normally).
void SetOrientation(DIR aOrientation)
Set the orientation of the dimension line (so, perpendicular to the feature lines).
void updateGeometry() override
Update the cached geometry of the dimension after changing any of its properties.
BITMAPS GetMenuImage() const override
Return a pointer to an image to be used in menus.
~PCB_DIM_ORTHOGONAL()=default
EDA_ITEM * Clone() const override
Create a duplicate of this item with linked list members set to NULL.
DIR m_orientation
What axis to lock the dimension line to.
void Rotate(const VECTOR2I &aRotCentre, const EDA_ANGLE &aAngle) override
Rotate this object.
DIR GetOrientation() const
A radial dimension indicates either the radius or diameter of an arc or circle.
int GetLeaderLength() const
EDA_ITEM * Clone() const override
Create a duplicate of this item with linked list members set to NULL.
void updateText() override
Update the text field value from the current geometry (called by updateGeometry normally).
virtual void swapData(BOARD_ITEM *aImage) override
void SetLeaderLength(int aLength)
wxString GetClass() const override
Return the class name.
void updateGeometry() override
Update the cached geometry of the dimension after changing any of its properties.
void ChangeLeaderLength(int aLength)
static bool ClassOf(const EDA_ITEM *aItem)
VECTOR2I GetKnee() const
BITMAPS GetMenuImage() const override
Return a pointer to an image to be used in menus.
Definition: seg.h:42
Represent a set of closed polygons.
EDA_UNITS
Definition: eda_units.h:46
ERROR_LOC
When approximating an arc or circle, should the error be placed on the outside or inside of the curve...
FLASHING
Enum used during connectivity building to ensure we do not query connectivity while building the data...
Definition: layer_ids.h:149
PCB_LAYER_ID
A quick note on layer IDs:
Definition: layer_ids.h:60
DIM_TEXT_POSITION
Where to place the text on a dimension.
Definition: pcb_dimension.h:62
@ OUTSIDE
Text appears outside the dimension line (default)
@ MANUAL
Text placement is manually set by the user.
@ INLINE
Text appears in line with the dimension line.
DIM_UNITS_FORMAT
How to display the units in a dimension's text.
Definition: pcb_dimension.h:40
DIM_UNITS_MODE
Used for storing the units selection in the file because EDA_UNITS alone doesn't cut it.
Definition: pcb_dimension.h:72
DIM_TEXT_BORDER
Frame to show around dimension text.
Definition: pcb_dimension.h:83
DIM_PRECISION
Definition: pcb_dimension.h:47
std::optional< VECTOR2I > OPT_VECTOR2I
Definition: seg.h:39
constexpr int delta
KICAD_T
The set of class identification values stored in EDA_ITEM::m_structType.
Definition: typeinfo.h:78
@ PCB_DIM_ORTHOGONAL_T
class PCB_DIM_ORTHOGONAL, a linear dimension constrained to x/y
Definition: typeinfo.h:105
@ PCB_DIM_LEADER_T
class PCB_DIM_LEADER, a leader dimension (graphic item)
Definition: typeinfo.h:102
@ PCB_DIM_CENTER_T
class PCB_DIM_CENTER, a center point marking (graphic item)
Definition: typeinfo.h:103
@ PCB_DIM_ALIGNED_T
class PCB_DIM_ALIGNED, a linear dimension (graphic item)
Definition: typeinfo.h:101
@ PCB_DIMENSION_T
class PCB_DIMENSION_BASE: abstract dimension meta-type
Definition: typeinfo.h:100
@ PCB_DIM_RADIAL_T
class PCB_DIM_RADIAL, a radius or diameter dimension
Definition: typeinfo.h:104