KiCad PCB EDA Suite
Loading...
Searching...
No Matches
pcb_shape.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) 2018 Jean-Pierre Charras jp.charras at wanadoo.fr
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#pragma once
22
24#include <eda_shape.h>
25
26
27class LINE_READER;
28class EDA_DRAW_FRAME;
29class FOOTPRINT;
30class MSG_PANEL_ITEM;
31class TRANSFORM_TRS;
32
33
35{
36public:
37 PCB_SHAPE( BOARD_ITEM* aParent, KICAD_T aItemType, SHAPE_T aShapeType );
38
39 PCB_SHAPE( BOARD_ITEM* aParent = nullptr, SHAPE_T aShapeType = SHAPE_T::SEGMENT );
40
41 // Do not create a copy constructor & operator=.
42 // The ones generated by the compiler are adequate.
43
44 ~PCB_SHAPE() override;
45
46 void CopyFrom( const BOARD_ITEM* aOther ) override;
47
48 static bool ClassOf( const EDA_ITEM* aItem )
49 {
50 return aItem && PCB_SHAPE_T == aItem->Type();
51 }
52
53 wxString GetClass() const override
54 {
55 return wxT( "PCB_SHAPE" );
56 }
57
58 void Serialize( google::protobuf::Any &aContainer ) const override;
59 bool Deserialize( const google::protobuf::Any &aContainer ) override;
60
61 bool IsConnected() const override;
62
63 wxString GetFriendlyName() const override { return getFriendlyName( FRAME_PCB_EDITOR ); }
64
65 bool IsType( const std::vector<KICAD_T>& aScanTypes ) const override;
66
67 void SetLayer( PCB_LAYER_ID aLayer ) override;
68 PCB_LAYER_ID GetLayer() const override { return m_layer; }
69
70 bool IsOnLayer( PCB_LAYER_ID aLayer ) const override;
71
72 virtual LSET GetLayerSet() const override;
73 virtual void SetLayerSet( const LSET& aLayers ) override;
74
75 void SetPosition( const VECTOR2I& aPos ) override { setPosition( aPos ); }
76 VECTOR2I GetPosition() const override { return getPosition(); }
77
78 VECTOR2I GetCenter() const override { return getCenter(); }
79
80 void BeginEdit( const VECTOR2I& aStartPoint )
81 {
82 beginEdit( aStartPoint );
84 }
85
86 bool ContinueEdit( const VECTOR2I& aPosition )
87 {
88 bool result = continueEdit( aPosition );
90 return result;
91 }
92
93 void CalcEdit( const VECTOR2I& aPosition )
94 {
95 calcEdit( aPosition );
97 }
98
99 void EndEdit( bool aClosed = true )
100 {
101 endEdit( aClosed );
103 }
104
105 void SetEditState( int aState ) { setEditState( aState ); }
106
107 void SetArcAngleAndEnd( const EDA_ANGLE& aAngle, bool aCheckNegativeAngle = false )
108 {
109 EDA_SHAPE::SetArcAngleAndEnd( aAngle, aCheckNegativeAngle );
111 }
112
113 void SetArcAngle( const EDA_ANGLE& aAngle ) override
114 {
115 EDA_SHAPE::SetArcAngle( aAngle );
117 }
118
123 std::vector<VECTOR2I> GetConnectionPoints() const;
124
125 bool HasLineStroke() const override { return true; }
126
127 STROKE_PARAMS GetStroke() const override;
128 void SetStroke( const STROKE_PARAMS& aStroke ) override;
129
130 int GetWidth() const override;
131
132 void StyleFromSettings( const BOARD_DESIGN_SETTINGS& settings, bool aCheckSide ) override;
133
138 virtual std::vector<VECTOR2I> GetCorners() const;
139
144 const VECTOR2I GetFocusPosition() const override;
145
149 std::shared_ptr<SHAPE> GetEffectiveShape( PCB_LAYER_ID aLayer = UNDEFINED_LAYER,
151 DRC_CONSTRAINT_T aUsage = NULL_CONSTRAINT ) const override;
152
153 bool IsProxyItem() const override { return m_proxyItem; }
154 void SetIsProxyItem( bool aIsProxy = true ) override;
155
156 void GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList ) override;
157
158 const BOX2I GetBoundingBox() const override;
159
160 bool HitTest( const VECTOR2I& aPosition, int aAccuracy = 0 ) const override
161 {
162 return hitTest( aPosition, aAccuracy );
163 }
164
165 bool HitTest( const BOX2I& aRect, bool aContained, int aAccuracy = 0 ) const override
166 {
167 return hitTest( aRect, aContained, aAccuracy );
168 }
169
170 bool HitTest( const SHAPE_LINE_CHAIN& aPoly, bool aContained ) const override
171 {
172 return hitTest( aPoly, aContained );
173 }
174
175 void Normalize() override;
176
182 void NormalizeForCompare() override;
183
184 void Move( const VECTOR2I& aMoveVector ) override;
185
186 void Rotate( const VECTOR2I& aRotCentre, const EDA_ANGLE& aAngle ) override;
187
188 void Flip( const VECTOR2I& aCentre, FLIP_DIRECTION aFlipDirection ) override;
189
190 void OnFootprintRescaled( double aRatioX, double aRatioY, double aLinearFactor, const VECTOR2I& aAnchor,
191 const EDA_ANGLE& aParentRotate ) override;
192
194
195 virtual void Mirror( const VECTOR2I& aCentre, FLIP_DIRECTION aFlipDirection ) override;
196
197 void SetStart( const VECTOR2I& aStart ) override;
198 void SetEnd( const VECTOR2I& aEnd ) override;
199
200 // Stroke width is stored in lib units. Scale-aware accessors apply the
201 // parent footprint scale on read / strip it on write so callers see the
202 // runtime width as before.
203 void SetWidth( int aWidth ) override;
204
205 void SetLibStrokeWidth( int aWidth );
206
207 void SetShape( SHAPE_T aShape ) override
208 {
209 EDA_SHAPE::SetShape( aShape );
210 m_libShape = aShape;
211 }
212
213 void SetArcGeometry( const VECTOR2I& aStart, const VECTOR2I& aMid, const VECTOR2I& aEnd ) override;
214
215 void SetBezierC1( const VECTOR2I& aPt ) override;
216 void SetBezierC2( const VECTOR2I& aPt ) override;
217
218 void SetPolyShape( const SHAPE_POLY_SET& aShape ) override;
219
220 void SetEllipseCenter( const VECTOR2I& aPt ) override;
221 void SetEllipseMajorRadius( int aR ) override;
222 void SetEllipseMinorRadius( int aR ) override;
223 void SetEllipseRotation( const EDA_ANGLE& aA ) override;
224 void SetEllipseStartAngle( const EDA_ANGLE& aA ) override;
225 void SetEllipseEndAngle( const EDA_ANGLE& aA ) override;
226
228 VECTOR2I GetLibraryEnd() const { return m_libEnd; }
230
237
238 void SetLibraryEllipse( const VECTOR2I& aCenter, int aMajor, int aMinor, const EDA_ANGLE& aRotation,
239 const EDA_ANGLE& aStartAngle, const EDA_ANGLE& aEndAngle )
240 {
241 m_libEllipseCenter = aCenter;
244 m_libEllipseRotation = aRotation;
245 m_libEllipseStartAngle = aStartAngle;
246 m_libEllipseEndAngle = aEndAngle;
247
252 EDA_SHAPE::SetEllipseStartAngle( aStartAngle );
254 }
255
260
261 void RebakeFromLib();
262
263 void RebakeWithScale( double aScaleX, double aScaleY );
264
265 void OverrideLibCoords( const VECTOR2I& aStart, const VECTOR2I& aEnd, const VECTOR2I& aArcMid = VECTOR2I( 0, 0 ) )
266 {
267 m_libStart = aStart;
268 m_libEnd = aEnd;
269
270 if( m_libShape == SHAPE_T::ARC )
271 m_libArcMid = aArcMid;
272 }
273
274 void OverrideLibBezier( const VECTOR2I& aC1, const VECTOR2I& aC2 )
275 {
276 m_libBezierC1 = aC1;
277 m_libBezierC2 = aC2;
278 }
279
280 void OverrideLibPoly( const SHAPE_POLY_SET& aPoly ) { m_libPoly = aPoly; }
281
282 const SHAPE_POLY_SET& GetLibPoly() const { return m_libPoly; }
283
284 void Scale( double aScale );
285
286 void UpdateHatching() const override;
287
288 double GetCoverageArea( int aTextMargin ) const override;
289
301 void TransformShapeToPolygon( SHAPE_POLY_SET& aBuffer, PCB_LAYER_ID aLayer, int aClearance,
302 int aError, ERROR_LOC aErrorLoc,
303 bool ignoreLineWidth = false ) const override;
304
318 int aClearance, int aError, ERROR_LOC aErrorLoc,
319 KIGFX::RENDER_SETTINGS* aRenderSettings = nullptr ) const override;
320
321 wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const override;
322
323 BITMAPS GetMenuImage() const override;
324
325 EDA_ITEM* Clone() const override;
326
327 const BOX2I ViewBBox() const override;
328
329 std::vector<int> ViewGetLayers() const override;
330
331 double ViewGetLOD( int aLayer, const KIGFX::VIEW* aView ) const override;
332
333 double Similarity( const BOARD_ITEM& aBoardItem ) const override;
334
335 bool operator==( const PCB_SHAPE& aShape ) const;
336 bool operator==( const BOARD_ITEM& aBoardItem ) const override;
337
338 void SetHasSolderMask( bool aVal ) { m_hasSolderMask = aVal; }
339 bool HasSolderMask() const { return m_hasSolderMask; }
340
341 void SetLocalSolderMaskMargin( std::optional<int> aMargin ) { m_solderMaskMargin = aMargin; }
342 std::optional<int> GetLocalSolderMaskMargin() const { return m_solderMaskMargin; }
343
344 int GetSolderMaskExpansion() const;
345
346#if defined(DEBUG)
347 void Show( int nestLevel, std::ostream& os ) const override { ShowDummy( os ); }
348#endif
349
350protected:
351 void swapData( BOARD_ITEM* aImage ) override;
352
353 bool isMoving() const override { return IsMoving(); }
354
355 virtual void syncLibCoords();
356
357 // Returns the parent footprint to use for lib/board frame conversion. Pad primitives
358 // are stored pad-local so they get nullptr (the pad applies its own transform when
359 // building the effective shape).
360 const FOOTPRINT* transformFp() const;
361
362 void rebakeFromTransform( const TRANSFORM_TRS& aXform );
363
364 int getMaxError() const override;
365
366 SHAPE_POLY_SET getHatchingKnockouts() const override;
367
369 {
370 bool operator()( const BOARD_ITEM* aFirst, const BOARD_ITEM* aSecond ) const;
371 };
372
373protected:
375 std::optional<int> m_solderMaskMargin;
376
379
381
384
386
393
395};
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:914
BOARD_CONNECTED_ITEM(BOARD_ITEM *aParent, KICAD_T idtype)
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
PCB_LAYER_ID m_layer
Definition board_item.h:586
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
bool IsMoving() const
Definition eda_item.h:132
EDA_ITEM(EDA_ITEM *parent, KICAD_T idType, bool isSCH_ITEM=false, bool isBOARD_ITEM=false)
Definition eda_item.cpp:84
bool m_proxyItem
Definition eda_shape.h:764
VECTOR2I getCenter() const
void calcEdit(const VECTOR2I &aPosition)
virtual void SetEllipseEndAngle(const EDA_ANGLE &aA)
Definition eda_shape.h:416
virtual void SetEllipseRotation(const EDA_ANGLE &aA)
Definition eda_shape.h:397
bool continueEdit(const VECTOR2I &aPosition)
virtual void SetArcAngle(const EDA_ANGLE &aAngle)
Definition eda_shape.h:441
bool hitTest(const VECTOR2I &aPosition, int aAccuracy=0) const
EDA_SHAPE(SHAPE_T aType, int aLineWidth, FILL_T aFill)
Definition eda_shape.cpp:56
void beginEdit(const VECTOR2I &aStartPoint)
void endEdit(bool aClosed=true)
Finish editing the shape.
virtual void SetEllipseCenter(const VECTOR2I &aPt)
Definition eda_shape.h:370
virtual void SetEllipseMinorRadius(int aR)
Definition eda_shape.h:388
virtual void SetEllipseMajorRadius(int aR)
Definition eda_shape.h:379
virtual void SetShape(SHAPE_T aShape)
Definition eda_shape.h:174
void setPosition(const VECTOR2I &aPos)
virtual void SetEllipseStartAngle(const EDA_ANGLE &aA)
Definition eda_shape.h:407
void SetArcAngleAndEnd(const EDA_ANGLE &aAngle, bool aCheckNegativeAngle=false)
Set the end point from the angle center and start.
VECTOR2I getPosition() const
void setEditState(int aState)
Definition eda_shape.h:694
wxString getFriendlyName(FRAME_T aFrameType) const
Container for all the knowledge about how graphical objects are drawn on any output surface/device.
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
LSET is a set of PCB_LAYER_IDs.
Definition lset.h:37
EDA_MSG_PANEL items for displaying messages.
Definition msgpanel.h:50
const BOX2I GetBoundingBox() const override
Return the orthogonal bounding box of this object for display purposes.
virtual void Mirror(const VECTOR2I &aCentre, FLIP_DIRECTION aFlipDirection) override
Mirror this object relative to a given horizontal axis the layer is not changed.
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 StyleFromSettings(const BOARD_DESIGN_SETTINGS &settings, bool aCheckSide) override
VECTOR2I m_libEllipseCenter
Definition pcb_shape.h:387
void swapData(BOARD_ITEM *aImage) override
bool IsConnected() const override
Returns information if the object is derived from BOARD_CONNECTED_ITEM.
void SetEllipseCenter(const VECTOR2I &aPt) override
EDA_ANGLE GetLibraryEllipseEndAngle() const
Definition pcb_shape.h:236
EDA_ANGLE m_libEllipseStartAngle
Definition pcb_shape.h:391
double ViewGetLOD(int aLayer, const KIGFX::VIEW *aView) const override
Return the level of detail (LOD) of the item.
VECTOR2I m_libEnd
Definition pcb_shape.h:378
VECTOR2I m_libBezierC1
Definition pcb_shape.h:382
bool HitTest(const SHAPE_LINE_CHAIN &aPoly, bool aContained) const override
Test if aPoly intersects this item.
Definition pcb_shape.h:170
virtual void syncLibCoords()
void EndEdit(bool aClosed=true)
Definition pcb_shape.h:99
SHAPE_POLY_SET getHatchingKnockouts() const override
void SetBezierC1(const VECTOR2I &aPt) override
std::optional< int > GetLocalSolderMaskMargin() const
Definition pcb_shape.h:342
VECTOR2I GetCenter() const override
This defaults to the center of the bounding box if not overridden.
Definition pcb_shape.h:78
bool isMoving() const override
Definition pcb_shape.h:353
void Rotate(const VECTOR2I &aRotCentre, const EDA_ANGLE &aAngle) override
Rotate this object.
VECTOR2I GetLibraryBezierC1() const
BITMAPS GetMenuImage() const override
Return a pointer to an image to be used in menus.
PCB_SHAPE(BOARD_ITEM *aParent, KICAD_T aItemType, SHAPE_T aShapeType)
void SetWidth(int aWidth) override
EDA_ANGLE m_libEllipseEndAngle
Definition pcb_shape.h:392
void CalcEdit(const VECTOR2I &aPosition)
Definition pcb_shape.h:93
void SetArcAngleAndEnd(const EDA_ANGLE &aAngle, bool aCheckNegativeAngle=false)
Definition pcb_shape.h:107
void SetLibraryEllipse(const VECTOR2I &aCenter, int aMajor, int aMinor, const EDA_ANGLE &aRotation, const EDA_ANGLE &aStartAngle, const EDA_ANGLE &aEndAngle)
Definition pcb_shape.h:238
void OverrideLibPoly(const SHAPE_POLY_SET &aPoly)
Definition pcb_shape.h:280
void OverrideLibBezier(const VECTOR2I &aC1, const VECTOR2I &aC2)
Definition pcb_shape.h:274
void SetLibStrokeWidth(int aWidth)
bool HasLineStroke() const override
Check if this item has line stoke properties.
Definition pcb_shape.h:125
SHAPE_T m_libShape
Definition pcb_shape.h:394
void rebakeFromTransform(const TRANSFORM_TRS &aXform)
void SetEditState(int aState)
Definition pcb_shape.h:105
int GetWidth() const override
const BOX2I ViewBBox() const override
Return the bounding box of the item covering all its layers.
bool HasSolderMask() const
Definition pcb_shape.h:339
int GetLibraryEllipseMinorRadius() const
Definition pcb_shape.h:233
void SetEllipseStartAngle(const EDA_ANGLE &aA) override
bool HitTest(const VECTOR2I &aPosition, int aAccuracy=0) const override
Test if aPosition is inside or on the boundary of this item.
Definition pcb_shape.h:160
EDA_ANGLE GetLibraryEllipseStartAngle() const
Definition pcb_shape.h:235
void SetHasSolderMask(bool aVal)
Definition pcb_shape.h:338
int GetLibraryEllipseMajorRadius() const
Definition pcb_shape.h:232
std::optional< int > m_solderMaskMargin
Definition pcb_shape.h:375
int GetSolderMaskExpansion() const
void NormalizeForCompare() override
Normalize coordinates to compare 2 similar PCB_SHAPES similat to Normalize(), but also normalize SEGM...
void SetShape(SHAPE_T aShape) override
Definition pcb_shape.h:207
void SetPosition(const VECTOR2I &aPos) override
Definition pcb_shape.h:75
void SetArcAngle(const EDA_ANGLE &aAngle) override
Definition pcb_shape.h:113
EDA_ANGLE GetLibraryEllipseRotation() const
Definition pcb_shape.h:234
SHAPE_T GetLibraryShape() const
Definition pcb_shape.h:229
void TransformShapeToPolySet(SHAPE_POLY_SET &aBuffer, PCB_LAYER_ID aLayer, int aClearance, int aError, ERROR_LOC aErrorLoc, KIGFX::RENDER_SETTINGS *aRenderSettings=nullptr) const override
Convert the item shape to a polyset.
VECTOR2I m_libArcMid
Definition pcb_shape.h:380
void SetEllipseEndAngle(const EDA_ANGLE &aA) override
int m_libEllipseMinorRadius
Definition pcb_shape.h:389
const VECTOR2I GetFocusPosition() const override
Allows items to return their visual center rather than their anchor.
VECTOR2I GetLibraryEllipseCenter() const
Definition pcb_shape.h:231
virtual void SetLayerSet(const LSET &aLayers) override
void SetEnd(const VECTOR2I &aEnd) override
void Flip(const VECTOR2I &aCentre, FLIP_DIRECTION aFlipDirection) override
Flip this object, i.e.
VECTOR2I GetLibraryEnd() const
Definition pcb_shape.h:228
const SHAPE_POLY_SET & GetLibPoly() const
Definition pcb_shape.h:282
void SetPolyShape(const SHAPE_POLY_SET &aShape) override
virtual std::vector< VECTOR2I > GetCorners() const
Return 4 corners for a rectangle or rotated rectangle (stored as a poly).
bool IsProxyItem() const override
Definition pcb_shape.h:153
void SetEllipseRotation(const EDA_ANGLE &aA) override
bool m_hasSolderMask
Definition pcb_shape.h:374
const FOOTPRINT * transformFp() const
VECTOR2I GetLibraryStart() const
Definition pcb_shape.h:227
void OnFootprintRescaled(double aRatioX, double aRatioY, double aLinearFactor, const VECTOR2I &aAnchor, const EDA_ANGLE &aParentRotate) override
Apply a parent footprint scale to this item.
~PCB_SHAPE() override
void BeginEdit(const VECTOR2I &aStartPoint)
Definition pcb_shape.h:80
virtual LSET GetLayerSet() const override
Return a std::bitset of all layers on which the item physically resides.
static bool ClassOf(const EDA_ITEM *aItem)
Definition pcb_shape.h:48
bool operator==(const PCB_SHAPE &aShape) const
std::shared_ptr< SHAPE > GetEffectiveShape(PCB_LAYER_ID aLayer=UNDEFINED_LAYER, FLASHING aFlash=FLASHING::DEFAULT, DRC_CONSTRAINT_T aUsage=NULL_CONSTRAINT) const override
Make a set of SHAPE objects representing the PCB_SHAPE.
void SetLayer(PCB_LAYER_ID aLayer) override
Set the layer this item is on.
void OverrideLibCoords(const VECTOR2I &aStart, const VECTOR2I &aEnd, const VECTOR2I &aArcMid=VECTOR2I(0, 0))
Definition pcb_shape.h:265
void SetEllipseMinorRadius(int aR) override
wxString GetFriendlyName() const override
Definition pcb_shape.h:63
void TransformShapeToPolygon(SHAPE_POLY_SET &aBuffer, PCB_LAYER_ID aLayer, int aClearance, int aError, ERROR_LOC aErrorLoc, bool ignoreLineWidth=false) const override
Convert the shape to a closed polygon.
STROKE_PARAMS GetStroke() const override
void SetIsProxyItem(bool aIsProxy=true) override
void RebakeWithScale(double aScaleX, double aScaleY)
SHAPE_POLY_SET m_libPoly
Definition pcb_shape.h:385
void SetLocalSolderMaskMargin(std::optional< int > aMargin)
Definition pcb_shape.h:341
void Move(const VECTOR2I &aMoveVector) override
Move this object.
std::vector< VECTOR2I > GetConnectionPoints() const
bool Deserialize(const google::protobuf::Any &aContainer) override
Deserializes the given protobuf message into this object.
EDA_ITEM * Clone() const override
Create a duplicate of this item with linked list members set to NULL.
double GetCoverageArea(int aTextMargin) const override
Return the board area this item covers, used to rank candidates under the cursor so a click on a smal...
int getMaxError() const override
void OnFootprintTransformed() override
Hook for items inside a footprint to refresh after the FP transform changes (translate,...
Definition pcb_shape.h:193
void SetStart(const VECTOR2I &aStart) override
bool IsOnLayer(PCB_LAYER_ID aLayer) const override
Test to see if this object is on the given layer.
void SetBezierC2(const VECTOR2I &aPt) override
void UpdateHatching() const override
wxString GetItemDescription(UNITS_PROVIDER *aUnitsProvider, bool aFull) const override
Return a user-visible description string of this item.
bool ContinueEdit(const VECTOR2I &aPosition)
Definition pcb_shape.h:86
void Scale(double aScale)
bool HitTest(const BOX2I &aRect, bool aContained, int aAccuracy=0) const override
Test if aRect intersects this item.
Definition pcb_shape.h:165
void Serialize(google::protobuf::Any &aContainer) const override
Serializes this object to the given Any message.
SHAPE_POLY_SET GetLibraryPolyShape() const
void SetStroke(const STROKE_PARAMS &aStroke) override
void Normalize() override
Perform any normalization required after a user rotate and/or flip.
bool IsType(const std::vector< KICAD_T > &aScanTypes) const override
Check whether the item is one of the listed types.
void CopyFrom(const BOARD_ITEM *aOther) override
VECTOR2I GetLibraryBezierC2() const
VECTOR2I m_libBezierC2
Definition pcb_shape.h:383
std::vector< int > ViewGetLayers() const override
Return the all the layers within the VIEW the object is painted on.
void RebakeFromLib()
wxString GetClass() const override
Return the class name.
Definition pcb_shape.h:53
void SetArcGeometry(const VECTOR2I &aStart, const VECTOR2I &aMid, const VECTOR2I &aEnd) override
Set the three controlling points for an arc.
double Similarity(const BOARD_ITEM &aBoardItem) const override
Return a measure of how likely the other object is to represent the same object.
VECTOR2I m_libStart
Definition pcb_shape.h:377
EDA_ANGLE m_libEllipseRotation
Definition pcb_shape.h:390
int m_libEllipseMajorRadius
Definition pcb_shape.h:388
VECTOR2I GetPosition() const override
Definition pcb_shape.h:76
VECTOR2I GetLibraryArcMid() const
void SetEllipseMajorRadius(int aR) override
PCB_LAYER_ID GetLayer() const override
Return the primary layer this item is on.
Definition pcb_shape.h:68
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.
Simple container to manage line stroke parameters.
DRC_CONSTRAINT_T
Definition drc_rule.h:49
@ NULL_CONSTRAINT
Definition drc_rule.h:50
SHAPE_T
Definition eda_shape.h:54
@ SEGMENT
Definition eda_shape.h:56
@ FRAME_PCB_EDITOR
Definition frame_type.h:38
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
bool operator()(const BOARD_ITEM *aFirst, const BOARD_ITEM *aSecond) const
wxString result
Test unit parsing edge cases and error handling.
KICAD_T
The set of class identification values stored in EDA_ITEM::m_structType.
Definition typeinfo.h:70
@ PCB_SHAPE_T
class PCB_SHAPE, a segment not on copper layers
Definition typeinfo.h:80
VECTOR2< int32_t > VECTOR2I
Definition vector2d.h:708