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-2022 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
48{
49 OUTSIDE,
50 INLINE,
51 MANUAL
52};
53
58{
59 INCHES,
60 MILS,
63};
64
69{
70 NONE,
72 CIRCLE,
74};
75
96{
97public:
99
100 bool IsType( const std::vector<KICAD_T>& aScanTypes ) const override
101 {
102 if( BOARD_ITEM::IsType( aScanTypes ) )
103 return true;
104
105 for( KICAD_T scanType : aScanTypes )
106 {
107 if( scanType == 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 VECTOR2I& GetStart() const { return m_start; }
122 virtual void SetStart( const VECTOR2I& aPoint ) { m_start = aPoint; }
123
124 virtual const VECTOR2I& GetEnd() const { return m_end; }
125 virtual void SetEnd( const VECTOR2I& aPoint ) { m_end = aPoint; }
126
127 VECTOR2I GetPosition() const override { return m_start; }
128 void SetPosition( const VECTOR2I& 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 {
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 EDA_UNITS GetUnits() const { return 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 VECTOR2I& offset ) override;
225 void Rotate( const VECTOR2I& aRotCentre, const EDA_ANGLE& aAngle ) override;
226 void Flip( const VECTOR2I& aCentre, bool aFlipLeftRight ) override;
227
236 virtual void Mirror( const VECTOR2I& 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 VECTOR2I& aPosition, int aAccuracy ) const override;
241 bool HitTest( const BOX2I& aRect, bool aContained, int aAccuracy = 0 ) const override;
242
243 const BOX2I 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( UNITS_PROVIDER* aUnitsProvider ) const override;
249
250 const BOX2I ViewBBox() const override;
251
253 int aClearance, int aError, ERROR_LOC aErrorLoc,
254 bool aIgnoreLineWidth = false ) const override;
255
256#if defined(DEBUG)
257 virtual void Show( int nestLevel, std::ostream& os ) const override { ShowDummy( os ); }
258#endif
259
260protected:
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;
297
298 // Geometry
304
305 // Internal
310
312 std::vector<std::shared_ptr<SHAPE>> m_shapes;
313};
314
315
344{
345public:
346 PCB_DIM_ALIGNED( BOARD_ITEM* aParent, KICAD_T aType );
347
348 // Do not create a copy constructor & operator=.
349 // The ones generated by the compiler are adequate.
350
351 ~PCB_DIM_ALIGNED() = default;
352
353 static inline bool ClassOf( const EDA_ITEM* aItem )
354 {
355 return aItem && ( aItem->Type() == PCB_DIM_ALIGNED_T
356 || aItem->Type() == PCB_FP_DIM_ALIGNED_T );
357 }
358
359 EDA_ITEM* Clone() const override;
360
361 virtual void SwapData( BOARD_ITEM* aImage ) override;
362
363 void Mirror( const VECTOR2I& axis_pos, bool aMirrorLeftRight = false ) override;
364
365 BITMAPS GetMenuImage() const override;
366
367 const VECTOR2I& GetCrossbarStart() const { return m_crossBarStart; }
368
369 const VECTOR2I& GetCrossbarEnd() const { return m_crossBarEnd; }
370
376 void SetHeight( int aHeight ) { m_height = aHeight; }
377 int GetHeight() const { return m_height; }
378
384 void UpdateHeight( const VECTOR2I& aCrossbarStart, const VECTOR2I& aCrossbarEnd );
385
386 void SetExtensionHeight( int aHeight ) { m_extensionHeight = aHeight; }
387 int GetExtensionHeight() const { return m_extensionHeight; }
388
394 double GetAngle() const
395 {
397
398 return atan2( (double)delta.y, (double)delta.x );
399 }
400
401 wxString GetClass() const override
402 {
403 return wxT( "PCB_DIM_ALIGNED" );
404 }
405
406 void GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList ) override;
407
408protected:
409 void updateGeometry() override;
410
411 void updateText() override;
412
413 // Geometry
416
419
420};
421
422
428{
429public:
430 enum class DIR
431 {
432 HORIZONTAL, // Aligned with x-axis
433 VERTICAL // Aligned with y-axis
434 };
435
436 PCB_DIM_ORTHOGONAL( BOARD_ITEM* aParent, bool aInFP = false );
437
439
440 static inline bool ClassOf( const EDA_ITEM* aItem )
441 {
442 return aItem && ( aItem->Type() == PCB_DIM_ORTHOGONAL_T
443 || aItem->Type() == PCB_FP_DIM_ORTHOGONAL_T );
444 }
445
446 EDA_ITEM* Clone() const override;
447
448 void SwapData( BOARD_ITEM* aImage ) override;
449
450 BITMAPS GetMenuImage() const override;
451
457 void SetOrientation( DIR aOrientation ) { m_orientation = aOrientation; }
458 DIR GetOrientation() const { return m_orientation; }
459
460 wxString GetClass() const override
461 {
462 return wxT( "PCB_DIM_ORTHOGONAL" );
463 }
464 void Rotate( const VECTOR2I& aRotCentre, const EDA_ANGLE& aAngle ) override;
465
466protected:
467 void updateGeometry() override;
468
469 void updateText() override;
470
471private:
472 // Geometry
474
475};
476
477
499{
500public:
501 PCB_DIM_RADIAL( BOARD_ITEM* aParent, bool aInFP = false );
502
503 static inline bool ClassOf( const EDA_ITEM* aItem )
504 {
505 return aItem && ( aItem->Type() == PCB_DIM_RADIAL_T
506 || aItem->Type() == PCB_FP_DIM_RADIAL_T );
507 }
508
509 EDA_ITEM* Clone() const override;
510
511 virtual void SwapData( BOARD_ITEM* aImage ) override;
512
513 void SetLeaderLength( int aLength ) { m_leaderLength = aLength; }
514 int GetLeaderLength() const { return m_leaderLength; }
515
516 // Returns the point (c).
517 VECTOR2I GetKnee() const;
518
519 BITMAPS GetMenuImage() const override;
520
521 wxString GetClass() const override
522 {
523 return wxT( "PCB_DIM_RADIAL" );
524 }
525
526protected:
527 void updateText() override;
528 void updateGeometry() override;
529
530private:
533};
534
535
550{
551public:
552 PCB_DIM_LEADER( BOARD_ITEM* aParent, bool aInFP = false );
553
554 static inline bool ClassOf( const EDA_ITEM* aItem )
555 {
556 return aItem && ( aItem->Type() == PCB_DIM_LEADER_T
557 || aItem->Type() == PCB_FP_DIM_LEADER_T );
558 }
559
560 EDA_ITEM* Clone() const override;
561
562 virtual void SwapData( BOARD_ITEM* aImage ) override;
563
564 BITMAPS GetMenuImage() const override;
565
566 wxString GetClass() const override
567 {
568 return wxT( "PCB_DIM_LEADER" );
569 }
570
571 void SetTextBorder( DIM_TEXT_BORDER aFrame ) { m_textBorder = aFrame; }
573
574 void GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList ) override;
575
576protected:
577 void updateGeometry() override;
578
579private:
581};
582
583
591{
592public:
593 PCB_DIM_CENTER( BOARD_ITEM* aParent, bool aInFP = false );
594
595 static inline bool ClassOf( const EDA_ITEM* aItem )
596 {
597 return aItem && ( aItem->Type() == PCB_DIM_CENTER_T
598 || aItem->Type() == PCB_FP_DIM_CENTER_T );
599 }
600
601 EDA_ITEM* Clone() const override;
602
603 virtual void SwapData( BOARD_ITEM* aImage ) override;
604
605 BITMAPS GetMenuImage() const override;
606
607 wxString GetClass() const override
608 {
609 return wxT( "PCB_DIM_CENTER" );
610 }
611
612 const BOX2I GetBoundingBox() const override;
613
614 const BOX2I ViewBBox() const override;
615
616protected:
617 void updateGeometry() override;
618};
619
620#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:50
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:85
KICAD_T Type() const
Returns the type of object.
Definition: eda_item.h:97
virtual bool IsType(const std::vector< KICAD_T > &aScanTypes) const
Check whether the item is one of the listed types.
Definition: eda_item.h:183
void SetTextSize(const VECTOR2I &aNewSize)
Definition: eda_text.cpp:347
An abstract class from which implementation specific LINE_READERs may be derived to read single lines...
Definition: richio.h:81
EDA_MSG_PANEL items for displaying messages.
Definition: msgpanel.h:54
Abstract dimension API.
Definition: pcb_dimension.h:96
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 SetTextSize(const wxSize &aTextSize)
wxString GetOverrideText() const
wxString GetSuffix() const
std::vector< std::shared_ptr< SHAPE > > m_shapes
bool IsType(const std::vector< KICAD_T > &aScanTypes) const override
Check whether the item is one of the listed types.
void TransformShapeWithClearanceToPolygon(SHAPE_POLY_SET &aCornerBuffer, 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 SetPrecision(int aPrecision)
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.
void SetMeasuredValue(int aValue)
int GetLineThickness() const
void SetUnits(EDA_UNITS aUnits)
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)
const PCB_TEXT & Text() const
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 SetExtensionOffset(int aOffset)
PCB_TEXT m_text
The actual text object.
void SetSuppressZeroes(bool aSuppress)
PCB_TEXT & Text()
PCB_DIMENSION_BASE(BOARD_ITEM *aParent, KICAD_T aType=PCB_DIMENSION_T)
int m_extensionOffset
Distance from feature points to extension line start.
void SetText(const wxString &aNewText)
Set the override text - has no effect if m_overrideValue == false.
DIM_TEXT_POSITION GetTextPositionMode() const
void SetParent(EDA_ITEM *aParent) override
bool GetKeepTextAligned() const
bool m_keepTextAligned
Calculate text orientation to match dimension.
wxString GetPrefix() const
void SetOverrideTextEnabled(bool aOverride)
void SetSuffix(const wxString &aSuffix)
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.
virtual void SetEnd(const VECTOR2I &aPoint)
bool m_overrideTextEnabled
Manually specify the displayed measurement value.
wxString GetSelectMenuText(UNITS_PROVIDER *aUnitsProvider) const override
Return the text to display to be used in the selection clarification context menu when multiple items...
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.
int m_precision
Number of digits to display after decimal.
const wxString GetText() const
Retrieve the value text or override text, not including prefix or suffix.
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
wxString m_prefix
String prepended to the value.
int GetPrecision() const
void Rotate(const VECTOR2I &aRotCentre, const EDA_ANGLE &aAngle) override
Rotate this object.
void SetPosition(const VECTOR2I &aPos) override
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.
void SetLayer(PCB_LAYER_ID aLayer) override
Set the layer this item is on.
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 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.
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.
PCB_DIM_ALIGNED(BOARD_ITEM *aParent, KICAD_T aType)
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.
virtual void SwapData(BOARD_ITEM *aImage) override
Swap data between aItem and aImage.
void Mirror(const VECTOR2I &axis_pos, bool aMirrorLeftRight=false) override
Mirror the dimension relative to a given horizontal axis.
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.
PCB_DIM_CENTER(BOARD_ITEM *aParent, bool aInFP=false)
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.
virtual void SwapData(BOARD_ITEM *aImage) override
Swap data between aItem and aImage.
const BOX2I ViewBBox() const override
Return the bounding box of the item covering all its layers.
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
void SetTextBorder(DIM_TEXT_BORDER aFrame)
PCB_DIM_LEADER(BOARD_ITEM *aParent, bool aInFP=false)
static bool ClassOf(const EDA_ITEM *aItem)
void updateGeometry() override
Update the cached geometry of the dimension after changing any of its properties.
EDA_ITEM * Clone() const override
Create a duplicate of this item with linked list members set to NULL.
virtual void SwapData(BOARD_ITEM *aImage) override
Swap data between aItem and aImage.
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 ...
PCB_DIM_ORTHOGONAL(BOARD_ITEM *aParent, bool aInFP=false)
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.
void SwapData(BOARD_ITEM *aImage) override
Swap data between aItem and aImage.
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).
void SetLeaderLength(int aLength)
wxString GetClass() const override
Return the class name.
virtual void SwapData(BOARD_ITEM *aImage) override
Swap data between aItem and aImage.
void updateGeometry() override
Update the cached geometry of the dimension after changing any of its properties.
PCB_DIM_RADIAL(BOARD_ITEM *aParent, bool aInFP=false)
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:43
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:147
PCB_LAYER_ID
A quick note on layer IDs:
Definition: layer_ids.h:59
DIM_TEXT_POSITION
Where to place the text on a dimension.
Definition: pcb_dimension.h:48
@ 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:58
DIM_TEXT_BORDER
Frame to show around dimension text.
Definition: pcb_dimension.h:69
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_FP_DIM_ALIGNED_T
class PCB_DIM_ALIGNED, a linear dimension (graphic item)
Definition: typeinfo.h:95
@ PCB_DIM_ORTHOGONAL_T
class PCB_DIM_ORTHOGONAL, a linear dimension constrained to x/y
Definition: typeinfo.h:110
@ PCB_DIM_LEADER_T
class PCB_DIM_LEADER, a leader dimension (graphic item)
Definition: typeinfo.h:107
@ PCB_DIM_CENTER_T
class PCB_DIM_CENTER, a center point marking (graphic item)
Definition: typeinfo.h:108
@ PCB_FP_DIM_CENTER_T
class PCB_DIM_CENTER, a center point marking (graphic item)
Definition: typeinfo.h:97
@ PCB_LOCATE_GRAPHIC_T
Definition: typeinfo.h:124
@ PCB_FP_DIM_ORTHOGONAL_T
class PCB_DIM_ORTHOGONAL, a linear dimension constrained to x/y
Definition: typeinfo.h:99
@ PCB_FP_DIM_LEADER_T
class PCB_DIM_LEADER, a leader dimension (graphic item)
Definition: typeinfo.h:96
@ PCB_DIM_ALIGNED_T
class PCB_DIM_ALIGNED, a linear dimension (graphic item)
Definition: typeinfo.h:106
@ PCB_FP_DIM_RADIAL_T
class PCB_DIM_RADIAL, a radius or diameter dimension
Definition: typeinfo.h:98
@ PCB_DIMENSION_T
class PCB_DIMENSION_BASE: abstract dimension meta-type
Definition: typeinfo.h:105
@ PCB_DIM_RADIAL_T
class PCB_DIM_RADIAL, a radius or diameter dimension
Definition: typeinfo.h:109