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 void SetStart( const VECTOR2I& aStart ) override;
200 void SetEnd( const VECTOR2I& aEnd ) override;
201 void SetCenter( const VECTOR2I& aCenter ) override;
202
203 void SetCornerRadius( int aCornerRadius ) override;
204
205 // Stroke width is stored in lib units. Scale-aware accessors apply the
206 // parent footprint scale on read / strip it on write so callers see the
207 // runtime width as before.
208 void SetWidth( int aWidth ) override;
209
210 void SetLibStrokeWidth( int aWidth );
211
212 void SetShape( SHAPE_T aShape ) override
213 {
214 EDA_SHAPE::SetShape( aShape );
215 m_libShape = aShape;
216 }
217
218 void SetArcGeometry( const VECTOR2I& aStart, const VECTOR2I& aMid, const VECTOR2I& aEnd ) override;
219
220 void SetBezierC1( const VECTOR2I& aPt ) override;
221 void SetBezierC2( const VECTOR2I& aPt ) override;
222
223 void SetPolyShape( const SHAPE_POLY_SET& aShape ) override;
224
225 void SetEllipseCenter( const VECTOR2I& aPt ) override;
226 void SetEllipseMajorRadius( int aR ) override;
227 void SetEllipseMinorRadius( int aR ) override;
228 void SetEllipseRotation( const EDA_ANGLE& aA ) override;
229 void SetEllipseStartAngle( const EDA_ANGLE& aA ) override;
230 void SetEllipseEndAngle( const EDA_ANGLE& aA ) override;
231
233 VECTOR2I GetLibraryEnd() const { return m_libEnd; }
236
243
244 void SetLibraryEllipse( const VECTOR2I& aCenter, int aMajor, int aMinor, const EDA_ANGLE& aRotation,
245 const EDA_ANGLE& aStartAngle, const EDA_ANGLE& aEndAngle )
246 {
247 m_libEllipseCenter = aCenter;
250 m_libEllipseRotation = aRotation;
251 m_libEllipseStartAngle = aStartAngle;
252 m_libEllipseEndAngle = aEndAngle;
253
258 EDA_SHAPE::SetEllipseStartAngle( aStartAngle );
260 }
261
266
267 void RebakeFromLib();
268
269 void RebakeWithScale( double aScaleX, double aScaleY );
270
271 void OverrideLibCoords( const VECTOR2I& aStart, const VECTOR2I& aEnd, const VECTOR2I& aArcMid = VECTOR2I( 0, 0 ) )
272 {
273 m_libStart = aStart;
274 m_libEnd = aEnd;
275
276 if( m_libShape == SHAPE_T::ARC )
277 m_libArcMid = aArcMid;
278 }
279
280 void OverrideLibCornerRadius( int aCornerRadius ) { m_libCornerRadius = aCornerRadius; }
281
282 void OverrideLibBezier( const VECTOR2I& aC1, const VECTOR2I& aC2 )
283 {
284 m_libBezierC1 = aC1;
285 m_libBezierC2 = aC2;
286 }
287
288 void OverrideLibPoly( const SHAPE_POLY_SET& aPoly ) { m_libPoly = aPoly; }
289
290 const SHAPE_POLY_SET& GetLibPoly() const { return m_libPoly; }
291
292 void Scale( double aScale );
293
294 void UpdateHatching() const override;
295
296 double GetCoverageArea( int aTextMargin ) const override;
297
309 void TransformShapeToPolygon( SHAPE_POLY_SET& aBuffer, PCB_LAYER_ID aLayer, int aClearance,
310 int aError, ERROR_LOC aErrorLoc,
311 bool ignoreLineWidth = false ) const override;
312
326 int aClearance, int aError, ERROR_LOC aErrorLoc,
327 KIGFX::RENDER_SETTINGS* aRenderSettings = nullptr ) const override;
328
329 wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const override;
330
331 BITMAPS GetMenuImage() const override;
332
333 EDA_ITEM* Clone() const override;
334
335 const BOX2I ViewBBox() const override;
336
337 std::vector<int> ViewGetLayers() const override;
338
339 double ViewGetLOD( int aLayer, const KIGFX::VIEW* aView ) const override;
340
341 double Similarity( const BOARD_ITEM& aBoardItem ) const override;
342
343 bool operator==( const PCB_SHAPE& aShape ) const;
344 bool operator==( const BOARD_ITEM& aBoardItem ) const override;
345
346 void SetHasSolderMask( bool aVal ) { m_hasSolderMask = aVal; }
347 bool HasSolderMask() const { return m_hasSolderMask; }
348
349 void SetLocalSolderMaskMargin( std::optional<int> aMargin ) { m_solderMaskMargin = aMargin; }
350 std::optional<int> GetLocalSolderMaskMargin() const { return m_solderMaskMargin; }
351
352 int GetSolderMaskExpansion() const;
353
354#if defined(DEBUG)
355 void Show( int nestLevel, std::ostream& os ) const override { ShowDummy( os ); }
356#endif
357
358protected:
359 void swapData( BOARD_ITEM* aImage ) override;
360
361 bool isMoving() const override { return IsMoving(); }
362
363 virtual void syncLibCoords();
364
365 // Returns the parent footprint to use for lib/board frame conversion. Pad primitives
366 // are stored pad-local so they get nullptr (the pad applies its own transform when
367 // building the effective shape).
368 const FOOTPRINT* transformFp() const;
369
370 void rebakeFromTransform( const TRANSFORM_TRS& aXform );
371
372 int getMaxError() const override;
373
374 SHAPE_POLY_SET getHatchingKnockouts() const override;
375
377 {
378 bool operator()( const BOARD_ITEM* aFirst, const BOARD_ITEM* aSecond ) const;
379 };
380
381protected:
383 std::optional<int> m_solderMaskMargin;
384
387
389
391
394
396
403
405};
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:85
BOARD_ITEM(BOARD_ITEM *aParent, KICAD_T idtype, PCB_LAYER_ID aLayer=F_Cu)
Definition board_item.h:87
PCB_LAYER_ID m_layer
Definition board_item.h:600
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:781
VECTOR2I getCenter() const
void calcEdit(const VECTOR2I &aPosition)
virtual void SetEllipseEndAngle(const EDA_ANGLE &aA)
Definition eda_shape.h:424
virtual void SetEllipseRotation(const EDA_ANGLE &aA)
Definition eda_shape.h:405
bool continueEdit(const VECTOR2I &aPosition)
virtual void SetArcAngle(const EDA_ANGLE &aAngle)
Definition eda_shape.h:449
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:378
virtual void SetEllipseMinorRadius(int aR)
Definition eda_shape.h:396
virtual void SetEllipseMajorRadius(int aR)
Definition eda_shape.h:387
virtual void SetShape(SHAPE_T aShape)
Definition eda_shape.h:176
void setPosition(const VECTOR2I &aPos)
virtual void SetEllipseStartAngle(const EDA_ANGLE &aA)
Definition eda_shape.h:415
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:710
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:397
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:242
void SetCenter(const VECTOR2I &aCenter) override
EDA_ANGLE m_libEllipseStartAngle
Definition pcb_shape.h:401
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:386
VECTOR2I m_libBezierC1
Definition pcb_shape.h:392
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:350
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:361
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:402
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:244
void OverrideLibPoly(const SHAPE_POLY_SET &aPoly)
Definition pcb_shape.h:288
void OverrideLibBezier(const VECTOR2I &aC1, const VECTOR2I &aC2)
Definition pcb_shape.h:282
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:404
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:347
int GetLibraryEllipseMinorRadius() const
Definition pcb_shape.h:239
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:241
void SetHasSolderMask(bool aVal)
Definition pcb_shape.h:346
int GetLibraryEllipseMajorRadius() const
Definition pcb_shape.h:238
std::optional< int > m_solderMaskMargin
Definition pcb_shape.h:383
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:212
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:240
SHAPE_T GetLibraryShape() const
Definition pcb_shape.h:234
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:390
void SetEllipseEndAngle(const EDA_ANGLE &aA) override
int m_libEllipseMinorRadius
Definition pcb_shape.h:399
const VECTOR2I GetFocusPosition() const override
Allows items to return their visual center rather than their anchor.
VECTOR2I GetLibraryEllipseCenter() const
Definition pcb_shape.h:237
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:233
const SHAPE_POLY_SET & GetLibPoly() const
Definition pcb_shape.h:290
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:382
const FOOTPRINT * transformFp() const
VECTOR2I GetLibraryStart() const
Definition pcb_shape.h:232
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:271
EDA_ITEM * AsEdaItem() override
Definition pcb_shape.h:46
int m_libCornerRadius
Definition pcb_shape.h:388
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:280
SHAPE_POLY_SET m_libPoly
Definition pcb_shape.h:395
void SetLocalSolderMaskMargin(std::optional< int > aMargin)
Definition pcb_shape.h:349
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:393
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:385
EDA_ANGLE m_libEllipseRotation
Definition pcb_shape.h:400
int m_libEllipseMajorRadius
Definition pcb_shape.h:398
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:235
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: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