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 EDA_ITEM* AsEdaItem() override { return this; }
47
48 void CopyFrom( const BOARD_ITEM* aOther ) override;
49
50 static bool ClassOf( const EDA_ITEM* aItem )
51 {
52 return aItem && PCB_SHAPE_T == aItem->Type();
53 }
54
55 wxString GetClass() const override
56 {
57 return wxT( "PCB_SHAPE" );
58 }
59
60 void Serialize( google::protobuf::Any &aContainer ) const override;
61 bool Deserialize( const google::protobuf::Any &aContainer ) override;
62
63 bool IsConnected() const override;
64
65 wxString GetFriendlyName() const override { return getFriendlyName( FRAME_PCB_EDITOR ); }
66
67 bool IsType( const std::vector<KICAD_T>& aScanTypes ) const override;
68
69 void SetLayer( PCB_LAYER_ID aLayer ) override;
70 PCB_LAYER_ID GetLayer() const override { return m_layer; }
71
72 bool IsOnLayer( PCB_LAYER_ID aLayer ) const override;
73
74 virtual LSET GetLayerSet() const override;
75 virtual void SetLayerSet( const LSET& aLayers ) override;
76
77 void SetPosition( const VECTOR2I& aPos ) override { setPosition( aPos ); }
78 VECTOR2I GetPosition() const override { return getPosition(); }
79
80 VECTOR2I GetCenter() const override { return getCenter(); }
81
82 void BeginEdit( const VECTOR2I& aStartPoint )
83 {
84 beginEdit( aStartPoint );
86 }
87
88 bool ContinueEdit( const VECTOR2I& aPosition )
89 {
90 bool result = continueEdit( aPosition );
92 return result;
93 }
94
95 void CalcEdit( const VECTOR2I& aPosition )
96 {
97 calcEdit( aPosition );
99 }
100
101 void EndEdit( bool aClosed = true )
102 {
103 endEdit( aClosed );
105 }
106
107 void SetEditState( int aState ) { setEditState( aState ); }
108
109 void SetArcAngleAndEnd( const EDA_ANGLE& aAngle, bool aCheckNegativeAngle = false )
110 {
111 EDA_SHAPE::SetArcAngleAndEnd( aAngle, aCheckNegativeAngle );
113 }
114
115 void SetArcAngle( const EDA_ANGLE& aAngle ) override
116 {
117 EDA_SHAPE::SetArcAngle( aAngle );
119 }
120
125 std::vector<VECTOR2I> GetConnectionPoints() const;
126
127 bool HasLineStroke() const override { return true; }
128
129 STROKE_PARAMS GetStroke() const override;
130 void SetStroke( const STROKE_PARAMS& aStroke ) override;
131
132 int GetWidth() const override;
133
134 void StyleFromSettings( const BOARD_DESIGN_SETTINGS& aSettings, bool aCheckSide ) override;
135
140 virtual std::vector<VECTOR2I> GetCorners() const;
141
146 const VECTOR2I GetFocusPosition() const override;
147
151 std::shared_ptr<SHAPE> GetEffectiveShape( PCB_LAYER_ID aLayer = UNDEFINED_LAYER,
153 DRC_CONSTRAINT_T aUsage = NULL_CONSTRAINT ) const override;
154
155 bool IsProxyItem() const override { return m_proxyItem; }
156 void SetIsProxyItem( bool aIsProxy = true ) override;
157
158 void GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList ) override;
159
160 const BOX2I GetBoundingBox() const override;
161
162 bool HitTest( const VECTOR2I& aPosition, int aAccuracy = 0 ) const override
163 {
164 return hitTest( aPosition, aAccuracy );
165 }
166
167 bool HitTest( const BOX2I& aRect, bool aContained, int aAccuracy = 0 ) const override
168 {
169 return hitTest( aRect, aContained, aAccuracy );
170 }
171
172 bool HitTest( const SHAPE_LINE_CHAIN& aPoly, bool aContained ) const override
173 {
174 return hitTest( aPoly, aContained );
175 }
176
177 void Normalize() override;
178
184 void NormalizeForCompare() override;
185
186 void Move( const VECTOR2I& aMoveVector ) override;
187
188 void Rotate( const VECTOR2I& aRotCentre, const EDA_ANGLE& aAngle ) override;
189
190 void Flip( const VECTOR2I& aCentre, FLIP_DIRECTION aFlipDirection ) override;
191
192 void OnFootprintRescaled( double aRatioX, double aRatioY, double aLinearFactor, const VECTOR2I& aAnchor,
193 const EDA_ANGLE& aParentRotate ) override;
194
196
197 virtual void Mirror( const VECTOR2I& aCentre, FLIP_DIRECTION aFlipDirection ) override;
198
199 virtual void Mirror( const SEG& aAxis ) override;
200
201 void SetStart( const VECTOR2I& aStart ) override;
202 void SetEnd( const VECTOR2I& aEnd ) override;
203 void SetCenter( const VECTOR2I& aCenter ) override;
204
205 void SetCornerRadius( int aCornerRadius ) override;
206
207 // Stroke width is stored in lib units. Scale-aware accessors apply the
208 // parent footprint scale on read / strip it on write so callers see the
209 // runtime width as before.
210 void SetWidth( int aWidth ) override;
211
212 void SetLibStrokeWidth( int aWidth );
213
214 void SetShape( SHAPE_T aShape ) override
215 {
216 EDA_SHAPE::SetShape( aShape );
217 m_libShape = aShape;
218 }
219
220 void SetArcGeometry( const VECTOR2I& aStart, const VECTOR2I& aMid, const VECTOR2I& aEnd ) override;
221
222 void SetBezierC1( const VECTOR2I& aPt ) override;
223 void SetBezierC2( const VECTOR2I& aPt ) override;
224
225 void SetPolyShape( const SHAPE_POLY_SET& aShape ) override;
226
227 void SetEllipseCenter( const VECTOR2I& aPt ) override;
228 void SetEllipseMajorRadius( int aR ) override;
229 void SetEllipseMinorRadius( int aR ) override;
230 void SetEllipseRotation( const EDA_ANGLE& aA ) override;
231 void SetEllipseStartAngle( const EDA_ANGLE& aA ) override;
232 void SetEllipseEndAngle( const EDA_ANGLE& aA ) override;
233
235 VECTOR2I GetLibraryEnd() const { return m_libEnd; }
238
245
246 void SetLibraryEllipse( const VECTOR2I& aCenter, int aMajor, int aMinor, const EDA_ANGLE& aRotation,
247 const EDA_ANGLE& aStartAngle, const EDA_ANGLE& aEndAngle )
248 {
249 m_libEllipseCenter = aCenter;
252 m_libEllipseRotation = aRotation;
253 m_libEllipseStartAngle = aStartAngle;
254 m_libEllipseEndAngle = aEndAngle;
255
260 EDA_SHAPE::SetEllipseStartAngle( aStartAngle );
262 }
263
268
269 void RebakeFromLib();
270
271 void RebakeWithScale( double aScaleX, double aScaleY );
272
273 void OverrideLibCoords( const VECTOR2I& aStart, const VECTOR2I& aEnd, const VECTOR2I& aArcMid = VECTOR2I( 0, 0 ) )
274 {
275 m_libStart = aStart;
276 m_libEnd = aEnd;
277
278 if( m_libShape == SHAPE_T::ARC )
279 m_libArcMid = aArcMid;
280 }
281
282 void OverrideLibCornerRadius( int aCornerRadius ) { m_libCornerRadius = aCornerRadius; }
283
284 void OverrideLibBezier( const VECTOR2I& aC1, const VECTOR2I& aC2 )
285 {
286 m_libBezierC1 = aC1;
287 m_libBezierC2 = aC2;
288 }
289
290 void OverrideLibPoly( const SHAPE_POLY_SET& aPoly ) { m_libPoly = aPoly; }
291
292 const SHAPE_POLY_SET& GetLibPoly() const { return m_libPoly; }
293
294 void Scale( double aScale );
295
296 void UpdateHatching() const override;
297
298 double GetCoverageArea( int aTextMargin ) const override;
299
311 void TransformShapeToPolygon( SHAPE_POLY_SET& aBuffer, PCB_LAYER_ID aLayer, int aClearance,
312 int aError, ERROR_LOC aErrorLoc,
313 bool ignoreLineWidth = false ) const override;
314
328 int aClearance, int aError, ERROR_LOC aErrorLoc,
329 KIGFX::RENDER_SETTINGS* aRenderSettings = nullptr ) const override;
330
331 wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const override;
332
333 BITMAPS GetMenuImage() const override;
334
335 EDA_ITEM* Clone() 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 double Similarity( const BOARD_ITEM& aBoardItem ) const override;
344
345 bool operator==( const PCB_SHAPE& aShape ) const;
346 bool operator==( const BOARD_ITEM& aBoardItem ) const override;
347
348 void SetHasSolderMask( bool aVal ) { m_hasSolderMask = aVal; }
349 bool HasSolderMask() const { return m_hasSolderMask; }
350
351 void SetLocalSolderMaskMargin( std::optional<int> aMargin ) { m_solderMaskMargin = aMargin; }
352 std::optional<int> GetLocalSolderMaskMargin() const { return m_solderMaskMargin; }
353
354 int GetSolderMaskExpansion() const;
355
356#if defined(DEBUG)
357 void Show( int nestLevel, std::ostream& os ) const override { ShowDummy( os ); }
358#endif
359
360protected:
361 void swapData( BOARD_ITEM* aImage ) override;
362
363 bool isMoving() const override { return IsMoving(); }
364
365 virtual void syncLibCoords();
366
367 // Returns the parent footprint to use for lib/board frame conversion. Pad primitives
368 // are stored pad-local so they get nullptr (the pad applies its own transform when
369 // building the effective shape).
370 const FOOTPRINT* transformFp() const;
371
372 void rebakeFromTransform( const TRANSFORM_TRS& aXform );
373
374 int getMaxError() const override;
375
376 SHAPE_POLY_SET getHatchingKnockouts() const override;
377
379 {
380 bool operator()( const BOARD_ITEM* aFirst, const BOARD_ITEM* aSecond ) const;
381 };
382
383protected:
385 std::optional<int> m_solderMaskMargin;
386
389
391
393
396
398
405
407};
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:917
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:99
BOARD_ITEM(BOARD_ITEM *aParent, KICAD_T idtype, PCB_LAYER_ID aLayer=F_Cu)
Definition board_item.h:101
PCB_LAYER_ID m_layer
Definition board_item.h:625
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:783
VECTOR2I getCenter() const
void calcEdit(const VECTOR2I &aPosition)
virtual void SetEllipseEndAngle(const EDA_ANGLE &aA)
Definition eda_shape.h:425
virtual void SetEllipseRotation(const EDA_ANGLE &aA)
Definition eda_shape.h:406
bool continueEdit(const VECTOR2I &aPosition)
virtual void SetArcAngle(const EDA_ANGLE &aAngle)
Definition eda_shape.h:450
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:379
virtual void SetEllipseMinorRadius(int aR)
Definition eda_shape.h:397
virtual void SetEllipseMajorRadius(int aR)
Definition eda_shape.h:388
virtual void SetShape(SHAPE_T aShape)
Definition eda_shape.h:177
void setPosition(const VECTOR2I &aPos)
virtual void SetEllipseStartAngle(const EDA_ANGLE &aA)
Definition eda_shape.h:416
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:712
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:68
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
void StyleFromSettings(const BOARD_DESIGN_SETTINGS &aSettings, bool aCheckSide) override
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.
VECTOR2I m_libEllipseCenter
Definition pcb_shape.h:399
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:244
void SetCenter(const VECTOR2I &aCenter) override
EDA_ANGLE m_libEllipseStartAngle
Definition pcb_shape.h:403
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:388
VECTOR2I m_libBezierC1
Definition pcb_shape.h:394
bool HitTest(const SHAPE_LINE_CHAIN &aPoly, bool aContained) const override
Test if aPoly intersects this item.
Definition pcb_shape.h:172
virtual void syncLibCoords()
void EndEdit(bool aClosed=true)
Definition pcb_shape.h:101
SHAPE_POLY_SET getHatchingKnockouts() const override
void SetBezierC1(const VECTOR2I &aPt) override
void SetCornerRadius(int aCornerRadius) override
std::optional< int > GetLocalSolderMaskMargin() const
Definition pcb_shape.h:352
VECTOR2I GetCenter() const override
This defaults to the center of the bounding box if not overridden.
Definition pcb_shape.h:80
bool isMoving() const override
Definition pcb_shape.h:363
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:404
void CalcEdit(const VECTOR2I &aPosition)
Definition pcb_shape.h:95
void SetArcAngleAndEnd(const EDA_ANGLE &aAngle, bool aCheckNegativeAngle=false)
Definition pcb_shape.h:109
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:246
void OverrideLibPoly(const SHAPE_POLY_SET &aPoly)
Definition pcb_shape.h:290
void OverrideLibBezier(const VECTOR2I &aC1, const VECTOR2I &aC2)
Definition pcb_shape.h:284
void SetLibStrokeWidth(int aWidth)
bool HasLineStroke() const override
Check if this item has line stoke properties.
Definition pcb_shape.h:127
SHAPE_T m_libShape
Definition pcb_shape.h:406
void rebakeFromTransform(const TRANSFORM_TRS &aXform)
void SetEditState(int aState)
Definition pcb_shape.h:107
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:349
int GetLibraryEllipseMinorRadius() const
Definition pcb_shape.h:241
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:162
EDA_ANGLE GetLibraryEllipseStartAngle() const
Definition pcb_shape.h:243
void SetHasSolderMask(bool aVal)
Definition pcb_shape.h:348
int GetLibraryEllipseMajorRadius() const
Definition pcb_shape.h:240
std::optional< int > m_solderMaskMargin
Definition pcb_shape.h:385
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:214
void SetPosition(const VECTOR2I &aPos) override
Definition pcb_shape.h:77
void SetArcAngle(const EDA_ANGLE &aAngle) override
Definition pcb_shape.h:115
EDA_ANGLE GetLibraryEllipseRotation() const
Definition pcb_shape.h:242
SHAPE_T GetLibraryShape() const
Definition pcb_shape.h:236
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:392
void SetEllipseEndAngle(const EDA_ANGLE &aA) override
int m_libEllipseMinorRadius
Definition pcb_shape.h:401
const VECTOR2I GetFocusPosition() const override
Allows items to return their visual center rather than their anchor.
VECTOR2I GetLibraryEllipseCenter() const
Definition pcb_shape.h:239
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:235
const SHAPE_POLY_SET & GetLibPoly() const
Definition pcb_shape.h:292
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:155
void SetEllipseRotation(const EDA_ANGLE &aA) override
bool m_hasSolderMask
Definition pcb_shape.h:384
const FOOTPRINT * transformFp() const
VECTOR2I GetLibraryStart() const
Definition pcb_shape.h:234
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:82
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:50
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:273
EDA_ITEM * AsEdaItem() override
Definition pcb_shape.h:46
int m_libCornerRadius
Definition pcb_shape.h:390
void SetEllipseMinorRadius(int aR) override
wxString GetFriendlyName() const override
Definition pcb_shape.h:65
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)
void OverrideLibCornerRadius(int aCornerRadius)
Definition pcb_shape.h:282
SHAPE_POLY_SET m_libPoly
Definition pcb_shape.h:397
void SetLocalSolderMaskMargin(std::optional< int > aMargin)
Definition pcb_shape.h:351
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:195
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:88
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:167
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:395
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:55
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:387
EDA_ANGLE m_libEllipseRotation
Definition pcb_shape.h:402
int m_libEllipseMajorRadius
Definition pcb_shape.h:400
VECTOR2I GetPosition() const override
Definition pcb_shape.h:78
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:70
int GetLibraryCornerRadius() const
Definition pcb_shape.h:237
Definition seg.h:38
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.
@ NULL_CONSTRAINT
SHAPE_T
Definition eda_shape.h:55
@ SEGMENT
Definition eda_shape.h:57
@ 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:26
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