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 The 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, see <https://www.gnu.org/licenses/>.
19 */
20
21#ifndef PCB_DIMENSION_H
22#define PCB_DIMENSION_H
23
24
25#include <board_item.h>
26#include <pcb_text.h>
27#include <geometry/shape.h>
28#include <geometry/circle.h>
29
30class LINE_READER;
31class MSG_PANEL_ITEM;
32
33enum class DIM_VALUE_MODE : int; // defined in constraints/constraint_builder.h
34
35
38{
39 NO_SUFFIX, // 1234.0
40 BARE_SUFFIX, // 1234.0 mm
41 PAREN_SUFFIX // 1234.0 (mm)
42};
43
44enum class DIM_PRECISION
45{
46 X = 0, // 0
47 X_X, // 0.0
48 X_XX, // 0.00
49 X_XXX, // 0.000
50 X_XXXX, // 0.0000
51 X_XXXXX, // 0.00000
52 V_VV, // 0.00 / 0 / 0.0
53 V_VVV, // 0.000 / 0 / 0.00
54 V_VVVV, // 0.0000 / 0.0 / 0.000
55 V_VVVVV // 0.00000 / 0.00 / 0.0000
56};
57
65
70{
71 INCH, // Do not use IN: it conflicts with a Windows header
75};
76
85
96
117{
118public:
120
121 void Serialize( google::protobuf::Any &aContainer ) const override;
122 bool Deserialize( const google::protobuf::Any &aContainer ) override;
123
129 virtual VECTOR2I GetStart() const;
130 virtual void SetStart( const VECTOR2I& aPoint );
131
132 virtual VECTOR2I GetEnd() const;
133 virtual void SetEnd( const VECTOR2I& aPoint );
134
135 VECTOR2I GetPosition() const override { return GetStart(); }
136 void SetPosition( const VECTOR2I& aPos ) override { SetStart( aPos ); }
137
138 void OnFootprintRescaled( double aRatioX, double aRatioY, double aLinearFactor, const VECTOR2I& aAnchor,
139 const EDA_ANGLE& aParentRotate ) override;
140
141 void OnFootprintTransformed() override;
142
143 const VECTOR2I& GetLibraryStart() const { return m_start; }
144 const VECTOR2I& GetLibraryEnd() const { return m_end; }
145
147 void SetOverrideTextEnabled( bool aOverride ) { m_overrideTextEnabled = aOverride; }
148
149 wxString GetOverrideText() const { return m_valueString; }
150 void SetOverrideText( const wxString& aValue ) { m_valueString = aValue; }
151
152 void ChangeOverrideText( const wxString& aValue )
153 {
155 SetOverrideText( aValue );
156 Update();
157 }
158
161
166 void ChangeValueMode( DIM_VALUE_MODE aMode );
167
172 wxString GetValueFieldText() const;
173
178 void ChangeValueFieldText( const wxString& aText );
179
180 int GetMeasuredValue() const { return m_measuredValue; }
181
182 // KiCad normally calculates the measured value but some importers need to set it.
183 void SetMeasuredValue( int aValue ) { m_measuredValue = aValue; }
184
188 wxString GetValueText() const;
189
197 void Update()
198 {
199 // Calls updateText internally
201 }
202
204 {
206 Update();
207 }
208
209 wxString GetPrefix() const { return m_prefix; }
210 void SetPrefix( const wxString& aPrefix );
211
212 void ChangePrefix( const wxString& aPrefix )
213 {
214 SetPrefix( aPrefix );
215 Update();
216 }
217
218 wxString GetSuffix() const { return m_suffix; }
219 void SetSuffix( const wxString& aSuffix );
220
221 void ChangeSuffix( const wxString& aSuffix )
222 {
223 SetSuffix( aSuffix );
224 Update();
225 }
226
228 void SetArrowDirection( const DIM_ARROW_DIRECTION& aDirection )
229 {
230 m_arrowDirection = aDirection;
231 }
232
234 {
235 SetArrowDirection( aDirection );
236 updateText();
238 }
239
240 EDA_UNITS GetUnits() const { return m_units; }
241 void SetUnits( EDA_UNITS aUnits );
242
244 void SetUnitsMode( DIM_UNITS_MODE aMode );
245
247 {
248 SetUnitsMode( aMode );
249 Update();
250 }
251
252 void SetAutoUnits( bool aAuto = true ) { m_autoUnits = aAuto; }
253
255 void SetUnitsFormat( const DIM_UNITS_FORMAT aFormat ) { m_unitsFormat = aFormat; }
256
258 {
259 SetUnitsFormat( aFormat );
260 Update();
261 }
262
264 void SetPrecision( DIM_PRECISION aPrecision ) { m_precision = aPrecision; }
265
267 {
268 SetPrecision( aPrecision );
269 Update();
270 }
271
272 bool GetSuppressZeroes() const { return m_suppressZeroes; }
273 void SetSuppressZeroes( bool aSuppress ) { m_suppressZeroes = aSuppress; }
274
275 void ChangeSuppressZeroes( bool aSuppress )
276 {
277 SetSuppressZeroes( aSuppress );
278 Update();
279 }
280
281 bool GetKeepTextAligned() const { return m_keepTextAligned; }
282 void SetKeepTextAligned( bool aKeepAligned ) { m_keepTextAligned = aKeepAligned; }
283
284 double GetTextAngleDegreesProp() const { return GetTextAngleDegrees(); }
285 void ChangeTextAngleDegrees( double aDegrees );
286 void ChangeKeepTextAligned( bool aKeepAligned );
287
290
291 int GetArrowLength() const { return m_arrowLength; }
292 void SetArrowLength( int aLength ) { m_arrowLength = aLength; }
293
294 void SetExtensionOffset( int aOffset ) { m_extensionOffset = aOffset; }
295 int GetExtensionOffset() const { return m_extensionOffset; }
296
297 int GetLineThickness() const { return m_lineThickness; }
298 void SetLineThickness( int aWidth ) { m_lineThickness = aWidth; }
299
300 void StyleFromSettings( const BOARD_DESIGN_SETTINGS& settings, bool aCheckSide ) override;
301
305 const std::vector<std::shared_ptr<SHAPE>>& GetShapes() const { return m_shapes; }
306
307 // BOARD_ITEM overrides
308
309 void Move( const VECTOR2I& offset ) override;
310 void Rotate( const VECTOR2I& aRotCentre, const EDA_ANGLE& aAngle ) override;
311 void Flip( const VECTOR2I& aCentre, FLIP_DIRECTION aFlipDirection ) override;
312
321 virtual void Mirror( const VECTOR2I& axis_pos, FLIP_DIRECTION aFlipDirection ) override;
322
323 void GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList ) override;
324
325 bool HitTest( const VECTOR2I& aPosition, int aAccuracy ) const override;
326 bool HitTest( const BOX2I& aRect, bool aContained, int aAccuracy = 0 ) const override;
327 bool HitTest( const SHAPE_LINE_CHAIN& aPoly, bool aContained ) const override;
328
329 const BOX2I GetBoundingBox() const override;
330
331 std::shared_ptr<SHAPE> GetEffectiveShape( PCB_LAYER_ID aLayer = UNDEFINED_LAYER,
333 DRC_CONSTRAINT_T aUsage = NULL_CONSTRAINT ) const override;
334
335 wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const override;
336
337 const BOX2I ViewBBox() const override;
338
339 std::vector<int> ViewGetLayers() const override;
340
341 double ViewGetLOD( int aLayer, const KIGFX::VIEW* aView ) const override;
342
343 void ClearRenderCache() override;
344
345 void TransformShapeToPolygon( SHAPE_POLY_SET& aBuffer, PCB_LAYER_ID aLayer, int aClearance,
346 int aError, ERROR_LOC aErrorLoc,
347 bool aIgnoreLineWidth = false ) const override;
348
349 double Similarity( const BOARD_ITEM& aOther ) const override;
350
351 bool operator==( const PCB_DIMENSION_BASE& aOther ) const;
352 bool operator==( const BOARD_ITEM& aBoardItem ) const override;
353
354#if defined(DEBUG)
355 virtual void Show( int nestLevel, std::ostream& os ) const override { ShowDummy( os ); }
356#endif
357
358protected:
359
363 virtual void updateGeometry() = 0;
364
371 virtual void updateText();
372
373 template<typename ShapeType>
374 void addShape( const ShapeType& aShape );
375
384 void drawAnArrow( VECTOR2I aStartPoint, EDA_ANGLE anAngle, int aLength );
385
386 // Value format
388 wxString m_valueString;
389 wxString m_prefix;
390 wxString m_suffix;
397
398 // Geometry
404
405 // Internal
407
410
412 std::vector<std::shared_ptr<SHAPE>> m_shapes;
413
415
416 // a flag to protect against reentrance
417 bool m_busy;
418};
419
420
440
449{
450public:
452
453 // Do not create a copy constructor & operator=.
454 // The ones generated by the compiler are adequate.
455
456 ~PCB_DIM_ALIGNED() = default;
457
458 void CopyFrom( const BOARD_ITEM* aOther ) override;
459 void Serialize( google::protobuf::Any &aContainer ) const override;
460 bool Deserialize( const google::protobuf::Any &aContainer ) override;
461
462 static inline bool ClassOf( const EDA_ITEM* aItem )
463 {
464 return aItem && aItem->Type() == PCB_DIM_ALIGNED_T;
465 }
466
467 EDA_ITEM* Clone() const override;
468
469 void Mirror( const VECTOR2I& axis_pos, FLIP_DIRECTION aFlipDirection ) override;
470
471 BITMAPS GetMenuImage() const override;
472
473 const VECTOR2I& GetCrossbarStart() const { return m_crossBarStart; }
474
475 const VECTOR2I& GetCrossbarEnd() const { return m_crossBarEnd; }
476
482 void SetHeight( int aHeight ) { m_height = aHeight; }
483 int GetHeight() const { return m_height; }
484
485 void ChangeHeight( int aHeight )
486 {
487 SetHeight( aHeight );
488 Update();
489 }
490
496 void UpdateHeight( const VECTOR2I& aCrossbarStart, const VECTOR2I& aCrossbarEnd );
497
498 void SetExtensionHeight( int aHeight ) { m_extensionHeight = aHeight; }
499 int GetExtensionHeight() const { return m_extensionHeight; }
500
501 void ChangeExtensionHeight( int aHeight )
502 {
503 SetExtensionHeight( aHeight );
504 Update();
505 }
506
512 double GetAngle() const
513 {
514 VECTOR2I delta( GetEnd() - GetStart() );
515
516 return atan2( (double)delta.y, (double)delta.x );
517 }
518
519 wxString GetClass() const override
520 {
521 return wxT( "PCB_DIM_ALIGNED" );
522 }
523
524 void GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList ) override;
525
526protected:
527 virtual void swapData( BOARD_ITEM* aImage ) override;
528
529 void updateGeometry() override;
530
531 void updateText() override;
532
533 // Geometry
536
539
540};
541
542
548{
549public:
550 enum class DIR
551 {
552 HORIZONTAL, // Aligned with x-axis
553 VERTICAL // Aligned with y-axis
554 };
555
556 PCB_DIM_ORTHOGONAL( BOARD_ITEM* aParent );
557
559
560 void CopyFrom( const BOARD_ITEM* aOther ) override;
561 void Serialize( google::protobuf::Any &aContainer ) const override;
562 bool Deserialize( const google::protobuf::Any &aContainer ) override;
563
564 static inline bool ClassOf( const EDA_ITEM* aItem )
565 {
566 return aItem && aItem->Type() == PCB_DIM_ORTHOGONAL_T;
567 }
568
569 EDA_ITEM* Clone() const override;
570
571 void Mirror( const VECTOR2I& axis_pos, FLIP_DIRECTION aFlipDirection ) override;
572
573 BITMAPS GetMenuImage() const override;
574
580 void SetOrientation( DIR aOrientation ) { m_orientation = aOrientation; }
581 DIR GetOrientation() const { return m_orientation; }
582
583 wxString GetClass() const override
584 {
585 return wxT( "PCB_DIM_ORTHOGONAL" );
586 }
587 void Rotate( const VECTOR2I& aRotCentre, const EDA_ANGLE& aAngle ) override;
588
589protected:
590 void swapData( BOARD_ITEM* aImage ) override;
591
592 void updateGeometry() override;
593
594 void updateText() override;
595
596private:
597 // Geometry
599
600};
601
602
624{
625public:
626 PCB_DIM_RADIAL( BOARD_ITEM* aParent );
627
628 void CopyFrom( const BOARD_ITEM* aOther ) override;
629 void Serialize( google::protobuf::Any &aContainer ) const override;
630 bool Deserialize( const google::protobuf::Any &aContainer ) override;
631
632 static inline bool ClassOf( const EDA_ITEM* aItem )
633 {
634 return aItem && aItem->Type() == PCB_DIM_RADIAL_T;
635 }
636
637 EDA_ITEM* Clone() const override;
638
639 void SetLeaderLength( int aLength ) { m_leaderLength = aLength; }
640 int GetLeaderLength() const { return m_leaderLength; }
641
642 void ChangeLeaderLength( int aLength )
643 {
644 SetLeaderLength( aLength );
645 Update();
646 }
647
648 // Returns the point (c).
649 VECTOR2I GetKnee() const;
650
651 BITMAPS GetMenuImage() const override;
652
653 wxString GetClass() const override
654 {
655 return wxT( "PCB_DIM_RADIAL" );
656 }
657
658protected:
659 virtual void swapData( BOARD_ITEM* aImage ) override;
660
661 void updateText() override;
662 void updateGeometry() override;
663
664private:
666};
667
668
683{
684public:
685 PCB_DIM_LEADER( BOARD_ITEM* aParent );
686
687 void CopyFrom( const BOARD_ITEM* aOther ) override;
688 void Serialize( google::protobuf::Any &aContainer ) const override;
689 bool Deserialize( const google::protobuf::Any &aContainer ) override;
690
691 static inline bool ClassOf( const EDA_ITEM* aItem )
692 {
693 return aItem && aItem->Type() == PCB_DIM_LEADER_T;
694 }
695
696 EDA_ITEM* Clone() const override;
697
698 BITMAPS GetMenuImage() const override;
699
700 wxString GetClass() const override
701 {
702 return wxT( "PCB_DIM_LEADER" );
703 }
704
705 void SetTextBorder( DIM_TEXT_BORDER aBorder ) { m_textBorder = aBorder; }
707
709 {
710 SetTextBorder( aBorder );
711 Update();
712 }
713
714 void GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList ) override;
715
716protected:
717 virtual void swapData( BOARD_ITEM* aImage ) override;
718
719 void updateText() override;
720 void updateGeometry() override;
721
722private:
724};
725
726
734{
735public:
736 PCB_DIM_CENTER( BOARD_ITEM* aParent );
737
738 void CopyFrom( const BOARD_ITEM* aOther ) override;
739 void Serialize( google::protobuf::Any &aContainer ) const override;
740 bool Deserialize( const google::protobuf::Any &aContainer ) override;
741
742 static inline bool ClassOf( const EDA_ITEM* aItem )
743 {
744 return aItem && aItem->Type() == PCB_DIM_CENTER_T;
745 }
746
747 EDA_ITEM* Clone() const override;
748
749 BITMAPS GetMenuImage() const override;
750
751 wxString GetClass() const override
752 {
753 return wxT( "PCB_DIM_CENTER" );
754 }
755
756 const BOX2I GetBoundingBox() const override;
757
758 const BOX2I ViewBBox() const override;
759
760protected:
761 virtual void swapData( BOARD_ITEM* aImage ) override;
762
763 void updateText() override;
764 void updateGeometry() override;
765};
766
767#endif // DIMENSION_H
ERROR_LOC
When approximating an arc or circle, should the error be placed on the outside or inside of the curve...
BITMAPS
A list of all bitmap identifiers.
BOX2< VECTOR2I > BOX2I
Definition box2.h:927
Container for design settings for a BOARD object.
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
Definition board_item.h:84
BOARD_ITEM(BOARD_ITEM *aParent, KICAD_T idtype, PCB_LAYER_ID aLayer=F_Cu)
Definition board_item.h:86
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:98
KICAD_T Type() const
Returns the type of object.
Definition eda_item.h:110
double GetTextAngleDegrees() const
Definition eda_text.h:185
Hold a (potentially large) number of VIEW_ITEMs and renders them on a graphics device provided by the...
Definition view.h:63
An abstract class from which implementation specific LINE_READERs may be derived to read single lines...
Definition richio.h:65
EDA_MSG_PANEL items for displaying messages.
Definition msgpanel.h:50
Abstract dimension API.
EDA_UNITS GetUnits() const
bool m_autoUnits
If true, follow the currently selected UI units.
void Flip(const VECTOR2I &aCentre, FLIP_DIRECTION aFlipDirection) override
Flip this object, i.e.
void Update()
Update the dimension's cached text and geometry.
void ChangeSuffix(const wxString &aSuffix)
void OnFootprintRescaled(double aRatioX, double aRatioY, double aLinearFactor, const VECTOR2I &aAnchor, const EDA_ANGLE &aParentRotate) override
Apply a parent footprint scale to this item.
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.
void Serialize(google::protobuf::Any &aContainer) const override
Serializes this object to the given Any message.
virtual void updateGeometry()=0
Update the cached geometry of the dimension after changing any of its properties.
void ClearRenderCache() override
int m_lineThickness
Thickness used for all graphics in the dimension.
virtual void SetEnd(const VECTOR2I &aPoint)
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)
VECTOR2I m_start
Start, FP-relative when in a footprint, board absolute otherwise.
DIM_PRECISION m_precision
Number of digits to display after decimal.
virtual void SetStart(const VECTOR2I &aPoint)
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)
std::shared_ptr< SHAPE > GetEffectiveShape(PCB_LAYER_ID aLayer=UNDEFINED_LAYER, FLASHING aFlash=FLASHING::DEFAULT, DRC_CONSTRAINT_T aUsage=NULL_CONSTRAINT) const override
Some pad shapes can be complex (rounded/chamfered rectangle), even without considering custom shapes.
const VECTOR2I & GetLibraryStart() const
void SetSuppressZeroes(bool aSuppress)
bool m_inClearRenderCache
re-entrancy guard
PCB_DIMENSION_BASE(BOARD_ITEM *aParent, KICAD_T aType=PCB_DIMENSION_T)
int m_extensionOffset
Distance from feature points to extension line start.
DIM_TEXT_POSITION GetTextPositionMode() const
void ChangeArrowDirection(const DIM_ARROW_DIRECTION &aDirection)
bool GetKeepTextAligned() const
void OnFootprintTransformed() override
Hook for items inside a footprint to refresh after the FP transform changes (translate,...
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
void ChangeValueMode(DIM_VALUE_MODE aMode)
Property panel setter for value mode override text flag lives on dimension length constraint is board...
const std::vector< std::shared_ptr< SHAPE > > & GetShapes() const
DIM_UNITS_MODE GetUnitsMode() const
void drawAnArrow(VECTOR2I aStartPoint, EDA_ANGLE anAngle, int aLength)
Draws an arrow and updates the shape container.
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_VALUE_MODE GetValueMode() const
Value mode from board state via DimensionValueMode.
DIM_UNITS_FORMAT GetUnitsFormat() const
void SetLineThickness(int aWidth)
void SetArrowLength(int aLength)
DIM_ARROW_DIRECTION GetArrowDirection() const
wxString m_valueString
Displayed value when m_overrideValue = true.
virtual VECTOR2I GetEnd() const
void ChangePrecision(DIM_PRECISION aPrecision)
void SetPrecision(DIM_PRECISION aPrecision)
bool m_overrideTextEnabled
Manually specify the displayed measurement value.
void SetAutoUnits(bool aAuto=true)
DIM_UNITS_FORMAT m_unitsFormat
How to render the units suffix.
int GetMeasuredValue() const
bool GetSuppressZeroes() const
void SetArrowDirection(const DIM_ARROW_DIRECTION &aDirection)
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.
void SetOverrideText(const wxString &aValue)
wxString GetValueText() const
int GetExtensionOffset() const
double ViewGetLOD(int aLayer, const KIGFX::VIEW *aView) const override
Return the level of detail (LOD) of the item.
void ChangePrefix(const wxString &aPrefix)
wxString m_prefix
String prepended to the value.
const VECTOR2I & GetLibraryEnd() const
bool Deserialize(const google::protobuf::Any &aContainer) override
Deserializes the given protobuf message into this object.
void Rotate(const VECTOR2I &aRotCentre, const EDA_ANGLE &aAngle) override
Rotate this object.
virtual VECTOR2I GetStart() const
The dimension's origin is the first feature point for the dimension.
void SetPosition(const VECTOR2I &aPos) override
DIM_ARROW_DIRECTION m_arrowDirection
direction of dimension arrow.
void ChangeKeepTextAligned(bool aKeepAligned)
void ChangeUnitsFormat(const DIM_UNITS_FORMAT aFormat)
wxString GetValueFieldText() const
Mode aware value for panel driving shows constraint length arbitrary shows override text otherwise sh...
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.
void ChangeValueFieldText(const wxString &aText)
Property panel setter for value arbitrary text owned by dimension driving edits board level constrain...
double GetTextAngleDegreesProp() const
bool GetOverrideTextEnabled() const
void SetUnitsMode(DIM_UNITS_MODE aMode)
int m_arrowLength
Length of arrow shapes.
virtual void Mirror(const VECTOR2I &axis_pos, FLIP_DIRECTION aFlipDirection) override
Mirror the dimension relative to a given horizontal axis.
VECTOR2I m_end
End, FP-relative when in a footprint, board absolute otherwise.
void ChangeUnitsMode(DIM_UNITS_MODE aMode)
void SetKeepTextAligned(bool aKeepAligned)
void StyleFromSettings(const BOARD_DESIGN_SETTINGS &settings, bool aCheckSide) override
std::vector< int > ViewGetLayers() const override
Return the all the layers within the VIEW the object is painted on.
VECTOR2I GetPosition() const override
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.
bool Deserialize(const google::protobuf::Any &aContainer) override
Deserializes the given protobuf message into this object.
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 Serialize(google::protobuf::Any &aContainer) const override
Serializes this object to the given Any message.
void Mirror(const VECTOR2I &axis_pos, FLIP_DIRECTION aFlipDirection) override
Mirror the dimension relative to a given horizontal axis.
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 CopyFrom(const BOARD_ITEM *aOther) override
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.
PCB_DIM_ALIGNED(BOARD_ITEM *aParent, KICAD_T aType=PCB_DIM_ALIGNED_T)
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.
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.
void Serialize(google::protobuf::Any &aContainer) const override
Serializes this object to the given Any message.
void CopyFrom(const BOARD_ITEM *aOther) override
virtual void swapData(BOARD_ITEM *aImage) override
BITMAPS GetMenuImage() const override
Return a pointer to an image to be used in menus.
bool Deserialize(const google::protobuf::Any &aContainer) override
Deserializes the given protobuf message into this object.
PCB_DIM_CENTER(BOARD_ITEM *aParent)
static bool ClassOf(const EDA_ITEM *aItem)
void updateText() override
Update the text field value from the current geometry (called by updateGeometry normally).
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 CopyFrom(const BOARD_ITEM *aOther) override
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.
PCB_DIM_LEADER(BOARD_ITEM *aParent)
void Serialize(google::protobuf::Any &aContainer) const override
Serializes this object to the given Any message.
void ChangeTextBorder(DIM_TEXT_BORDER aBorder)
wxString GetClass() const override
Return the class name.
bool Deserialize(const google::protobuf::Any &aContainer) override
Deserializes the given protobuf message into this object.
void swapData(BOARD_ITEM *aImage) override
wxString GetClass() const override
Return the class name.
bool Deserialize(const google::protobuf::Any &aContainer) override
Deserializes the given protobuf message into this object.
static bool ClassOf(const EDA_ITEM *aItem)
void updateText() override
Update the text field value from the current geometry (called by updateGeometry normally).
void CopyFrom(const BOARD_ITEM *aOther) override
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
void Serialize(google::protobuf::Any &aContainer) const override
Serializes this object to the given Any message.
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 Mirror(const VECTOR2I &axis_pos, FLIP_DIRECTION aFlipDirection) override
Mirror the dimension relative to a given horizontal axis.
void Rotate(const VECTOR2I &aRotCentre, const EDA_ANGLE &aAngle) override
Rotate this object.
DIR GetOrientation() const
PCB_DIM_ORTHOGONAL(BOARD_ITEM *aParent)
int GetLeaderLength() const
PCB_DIM_RADIAL(BOARD_ITEM *aParent)
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 CopyFrom(const BOARD_ITEM *aOther) override
void Serialize(google::protobuf::Any &aContainer) const override
Serializes this object to the given Any message.
void updateGeometry() override
Update the cached geometry of the dimension after changing any of its properties.
void ChangeLeaderLength(int aLength)
bool Deserialize(const google::protobuf::Any &aContainer) override
Deserializes the given protobuf message into this object.
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.
PCB_TEXT(BOARD_ITEM *parent, KICAD_T idtype=PCB_TEXT_T)
Definition pcb_text.cpp:49
A round rectangle shape, based on a rectangle and a radius.
Definition roundrect.h:32
Represent a polyline containing arcs as well as line segments: A chain of connected line and/or arc s...
Represent a set of closed polygons.
DIM_VALUE_MODE
Mode a value bearing dimension value is in Driven mirrors measured geometry Driving forces geometry t...
DRC_CONSTRAINT_T
Definition drc_rule.h:49
@ NULL_CONSTRAINT
Definition drc_rule.h:50
@ NONE
Definition eda_fill.h:42
EDA_UNITS
Definition eda_units.h:44
FLASHING
Enum used during connectivity building to ensure we do not query connectivity while building the data...
Definition layer_ids.h:180
@ DEFAULT
Flashing follows connectivity.
Definition layer_ids.h:181
PCB_LAYER_ID
A quick note on layer IDs:
Definition layer_ids.h:56
@ UNDEFINED_LAYER
Definition layer_ids.h:57
FLIP_DIRECTION
Definition mirror.h:23
DIM_TEXT_POSITION
Where to place the text on a dimension.
@ 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.
DIM_UNITS_MODE
Used for storing the units selection in the file because EDA_UNITS alone doesn't cut it.
DIM_ARROW_DIRECTION
Used for dimension's arrow.
DIM_TEXT_BORDER
Frame to show around dimension text.
DIM_PRECISION
@ INCH
Definition rs274x.cpp:58
static const long long MM
int delta
KICAD_T
The set of class identification values stored in EDA_ITEM::m_structType.
Definition typeinfo.h:70
@ PCB_DIM_ORTHOGONAL_T
class PCB_DIM_ORTHOGONAL, a linear dimension constrained to x/y
Definition typeinfo.h:98
@ PCB_DIM_LEADER_T
class PCB_DIM_LEADER, a leader dimension (graphic item)
Definition typeinfo.h:95
@ PCB_DIM_CENTER_T
class PCB_DIM_CENTER, a center point marking (graphic item)
Definition typeinfo.h:96
@ PCB_DIM_ALIGNED_T
class PCB_DIM_ALIGNED, a linear dimension (graphic item)
Definition typeinfo.h:94
@ PCB_DIMENSION_T
class PCB_DIMENSION_BASE: abstract dimension meta-type
Definition typeinfo.h:92
@ PCB_DIM_RADIAL_T
class PCB_DIM_RADIAL, a radius or diameter dimension
Definition typeinfo.h:97
VECTOR2< int32_t > VECTOR2I
Definition vector2d.h:683