KiCad PCB EDA Suite
Loading...
Searching...
No Matches
eda_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, you may find one here:
19 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
20 * or you may search the http://www.gnu.org website for the version 2 license,
21 * or you may write to the Free Software Foundation, Inc.,
22 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
23 */
24
25#pragma once
26
27#include <core/mirror.h>
30#include <properties/property.h>
31#include <stroke_params.h>
32#include <trigo.h>
33#include <api/serializable.h>
34
35class LINE_READER;
36class EDA_DRAW_FRAME;
37class FOOTPRINT;
38class MSG_PANEL_ITEM;
39
40using KIGFX::COLOR4D;
41
42enum class SHAPE_T : int
43{
44 UNDEFINED = -1,
45 SEGMENT = 0,
46 RECTANGLE,
47 ARC,
48 CIRCLE,
49 POLY,
50 BEZIER
51};
52
53
54// WARNING: Do not change these values without updating dialogs that depend on their position values
55enum class FILL_T : int
56{
57 NO_FILL = 1,
59 FILLED_WITH_BG_BODYCOLOR, //< Fill with background body color.
60 FILLED_WITH_COLOR, //< Fill with a separate color.
61 HATCH,
64};
65
66
68{
69 NONE = 0,
74};
75
76
78struct ARC_MID
79{
84};
85
86
87class EDA_SHAPE : public SERIALIZABLE
88{
89public:
90 EDA_SHAPE( SHAPE_T aType, int aLineWidth, FILL_T aFill );
91
93 EDA_SHAPE( const SHAPE& aShape );
94
95 // Do not create a copy constructor & operator=.
96 // The ones generated by the compiler are adequate.
97
98 virtual ~EDA_SHAPE();
99
100 void SwapShape( EDA_SHAPE* aImage );
101
102 void Serialize( google::protobuf::Any &aContainer ) const override;
103 bool Deserialize( const google::protobuf::Any &aContainer ) override;
104
105 wxString ShowShape() const;
106
107 wxString SHAPE_T_asString() const;
108
109 virtual bool IsProxyItem() const { return m_proxyItem; }
110 virtual void SetIsProxyItem( bool aIsProxy = true ) { m_proxyItem = aIsProxy; }
111
112 bool IsAnyFill() const
113 {
114 return GetFillMode() != FILL_T::NO_FILL;
115 }
116
117 bool IsSolidFill() const
118 {
119 return GetFillMode() == FILL_T::FILLED_SHAPE
120 || GetFillMode() == FILL_T::FILLED_WITH_COLOR
121 || GetFillMode() == FILL_T::FILLED_WITH_BG_BODYCOLOR;
122 }
123
124 bool IsHatchedFill() const
125 {
126 return GetFillMode() == FILL_T::HATCH
127 || GetFillMode() == FILL_T::REVERSE_HATCH
128 || GetFillMode() == FILL_T::CROSS_HATCH;
129 }
130
131 virtual bool IsFilledForHitTesting() const
132 {
133 return IsSolidFill();
134 }
135
136 virtual void SetFilled( bool aFlag )
137 {
138 setFilled( aFlag );
139 }
140
141 void SetFillMode( FILL_T aFill );
142 FILL_T GetFillMode() const { return m_fill; }
143
146
148 const SHAPE_POLY_SET& GetHatching() const { return m_hatching; }
149
150 bool IsClosed() const;
151
152 COLOR4D GetFillColor() const { return m_fillColor; }
153 void SetFillColor( const COLOR4D& aColor ) { m_fillColor = aColor; }
154
155 void SetWidth( int aWidth );
156 virtual int GetWidth() const { return m_stroke.GetWidth(); }
157 virtual int GetEffectiveWidth() const { return GetWidth(); }
158 virtual int GetHatchLineWidth() const { return GetEffectiveWidth(); }
159 virtual int GetHatchLineSpacing() const { return GetHatchLineWidth() * 10; }
160
161 void SetLineStyle( const LINE_STYLE aStyle );
162 LINE_STYLE GetLineStyle() const;
163
164 void SetLineColor( const COLOR4D& aColor ) { m_stroke.SetColor( aColor ); }
165 COLOR4D GetLineColor() const { return m_stroke.GetColor(); }
166
167 void SetShape( SHAPE_T aShape ) { m_shape = aShape; }
168 SHAPE_T GetShape() const { return m_shape; }
169
173 const VECTOR2I& GetStart() const { return m_start; }
174 int GetStartY() const { return m_start.y; }
175 int GetStartX() const { return m_start.x; }
176
177 void SetStart( const VECTOR2I& aStart )
178 {
179 m_start = aStart;
180 m_endsSwapped = false;
181 m_hatchingDirty = true;
182 }
183
184 void SetStartY( int y )
185 {
186 m_start.y = y;
187 m_endsSwapped = false;
188 m_hatchingDirty = true;
189 }
190
191 void SetStartX( int x )
192 {
193 m_start.x = x;
194 m_endsSwapped = false;
195 m_hatchingDirty = true;
196 }
197
198 void SetCenterY( int y )
199 {
200 m_end.y += y - m_start.y;
201 m_start.y = y;
202 m_hatchingDirty = true;
203 }
204
205 void SetCenterX( int x )
206 {
207 m_end.x += x - m_start.x;
208 m_start.x = x;
209 m_hatchingDirty = true;
210 }
211
215 const VECTOR2I& GetEnd() const { return m_end; }
216 int GetEndY() const { return m_end.y; }
217 int GetEndX() const { return m_end.x; }
218
219 void SetEnd( const VECTOR2I& aEnd )
220 {
221 m_end = aEnd;
222 m_endsSwapped = false;
223 m_hatchingDirty = true;
224 }
225
226 void SetEndY( int aY )
227 {
228 m_end.y = aY;
229 m_endsSwapped = false;
230 m_hatchingDirty = true;
231 }
232
233 void SetEndX( int aX )
234 {
235 m_end.x = aX;
236 m_endsSwapped = false;
237 m_hatchingDirty = true;
238 }
239
240 void SetRadius( int aX )
241 {
242 m_end = m_start + VECTOR2I( aX, 0 );
243 m_hatchingDirty = true;
244 }
245
246 virtual VECTOR2I GetTopLeft() const { return GetStart(); }
247 virtual VECTOR2I GetBotRight() const { return GetEnd(); }
248
249 virtual void SetTop( int val ) { SetStartY( val ); }
250 virtual void SetLeft( int val ) { SetStartX( val ); }
251 virtual void SetRight( int val ) { SetEndX( val ); }
252 virtual void SetBottom( int val ) { SetEndY( val ); }
253
254 void SetBezierC1( const VECTOR2I& aPt ) { m_bezierC1 = aPt; }
255 const VECTOR2I& GetBezierC1() const { return m_bezierC1; }
256
257 void SetBezierC2( const VECTOR2I& aPt ) { m_bezierC2 = aPt; }
258 const VECTOR2I& GetBezierC2() const { return m_bezierC2; }
259
260 VECTOR2I getCenter() const;
261 void SetCenter( const VECTOR2I& aCenter );
262
270 void SetArcAngleAndEnd( const EDA_ANGLE& aAngle, bool aCheckNegativeAngle = false );
271
272 EDA_ANGLE GetArcAngle() const;
273
275
281 bool EndsSwapped() const { return m_endsSwapped; }
282
283 // Some attributes are read only, since they are derived from m_Start, m_End, and m_Angle.
284 // No Set...() function for these attributes.
285
286 VECTOR2I GetArcMid() const;
287 std::vector<VECTOR2I> GetRectCorners() const;
288 std::vector<VECTOR2I> GetCornersInSequence() const;
289
294 void CalcArcAngles( EDA_ANGLE& aStartAngle, EDA_ANGLE& aEndAngle ) const;
295
296 int GetRadius() const;
297
304 void SetArcGeometry( const VECTOR2I& aStart, const VECTOR2I& aMid, const VECTOR2I& aEnd );
305
317 void SetCachedArcData( const VECTOR2I& aStart, const VECTOR2I& aMid, const VECTOR2I& aEnd,
318 const VECTOR2I& aCenter );
319
320 const std::vector<VECTOR2I>& GetBezierPoints() const { return m_bezierPoints; }
321
329 void DupPolyPointsList( std::vector<VECTOR2I>& aBuffer ) const;
330
334 int GetPointCount() const;
335
336 // Accessors to the polygonal shape
338 const SHAPE_POLY_SET& GetPolyShape() const { return m_poly; }
339
343 bool IsPolyShapeValid() const;
344
345 void SetPolyShape( const SHAPE_POLY_SET& aShape )
346 {
347 m_poly = aShape;
348
349 for( int ii = 0; ii < m_poly.OutlineCount(); ++ii )
350 {
351 if( m_poly.HoleCount( ii ) )
352 {
354 break;
355 }
356 }
357 }
358
359 void SetPolyPoints( const std::vector<VECTOR2I>& aPoints );
360
369 void RebuildBezierToSegmentsPointsList( int aMaxError );
370
379 virtual std::vector<SHAPE*> MakeEffectiveShapes( bool aEdgeOnly = false ) const
380 {
381 return makeEffectiveShapes( aEdgeOnly );
382 }
383
384 void ShapeGetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList );
385
386 void SetLength( const double& aLength );
387
388 void SetRectangleHeight( const int& aHeight );
389
390 void SetRectangleWidth( const int& aWidth );
391
392 void SetRectangle( const long long int& aHeight, const long long int& aWidth );
393
394 void SetSegmentAngle( const EDA_ANGLE& aAngle );
395
396 bool IsClockwiseArc() const;
397
401 double GetLength() const;
402
403 int GetRectangleHeight() const;
404 int GetRectangleWidth() const;
405
406 virtual void UpdateHatching() const;
407
420 void TransformShapeToPolygon( SHAPE_POLY_SET& aBuffer, int aClearance, int aError,
421 ERROR_LOC aErrorLoc, bool ignoreLineWidth = false,
422 bool includeFill = false ) const;
423
424 int Compare( const EDA_SHAPE* aOther ) const;
425
426 double Similarity( const EDA_SHAPE& aOther ) const;
427
428 bool operator==( const EDA_SHAPE& aOther ) const;
429
430protected:
431 wxString getFriendlyName() const;
432
433 void setPosition( const VECTOR2I& aPos );
434 VECTOR2I getPosition() const;
435
436 virtual void setFilled( bool aFlag )
437 {
438 m_fill = aFlag ? FILL_T::FILLED_SHAPE : FILL_T::NO_FILL;
439 }
440
441 void move( const VECTOR2I& aMoveVector );
442 void rotate( const VECTOR2I& aRotCentre, const EDA_ANGLE& aAngle );
443 void flip( const VECTOR2I& aCentre, FLIP_DIRECTION aFlipDirection );
444 void scale( double aScale );
445
446 virtual EDA_ANGLE getDrawRotation() const { return ANGLE_0; }
447
448 const BOX2I getBoundingBox() const;
449
450 void computeArcBBox( BOX2I& aBBox ) const;
451
452 bool hitTest( const VECTOR2I& aPosition, int aAccuracy = 0 ) const;
453 bool hitTest( const BOX2I& aRect, bool aContained, int aAccuracy = 0 ) const;
454
455 const std::vector<VECTOR2I> buildBezierToSegmentsPointsList( int aMaxError ) const;
456
457 void beginEdit( const VECTOR2I& aStartPoint );
458 bool continueEdit( const VECTOR2I& aPosition );
459 void calcEdit( const VECTOR2I& aPosition );
460
466 void endEdit( bool aClosed = true );
467 void setEditState( int aState ) { m_editState = aState; }
468
469 virtual bool isMoving() const { return false; }
470
481 // fixme: move to shape_compound
482 std::vector<SHAPE*> makeEffectiveShapes( bool aEdgeOnly, bool aLineChainOnly = false ) const;
483
484protected:
485 bool m_endsSwapped; // true if start/end were swapped e.g. SetArcAngleAndEnd
486 SHAPE_T m_shape; // Shape: line, Circle, Arc
487 STROKE_PARAMS m_stroke; // Line style, width, etc.
490
492 mutable bool m_hatchingDirty;
493
494 long long int m_rectangleHeight;
495 long long int m_rectangleWidth;
496
499
500 VECTOR2I m_start; // Line start point or Circle center
501 VECTOR2I m_end; // Line end point or Circle 3 o'clock point
502
503 VECTOR2I m_arcCenter; // Used only for Arcs: arc end point
504 ARC_MID m_arcMidData; // Used to store originating data
505
506 VECTOR2I m_bezierC1; // Bezier Control Point 1
507 VECTOR2I m_bezierC2; // Bezier Control Point 2
508
509 std::vector<VECTOR2I> m_bezierPoints;
510 SHAPE_POLY_SET m_poly; // Stores the S_POLYGON shape
511
513 bool m_proxyItem; // A shape storing proxy information (ie: a pad
514 // number box, thermal spoke template, etc.)
515};
516
517#ifndef SWIG
521#endif
ERROR_LOC
When approximating an arc or circle, should the error be placed on the outside or inside of the curve...
Definition: approximation.h:32
Generic cubic Bezier representation.
Definition: bezier_curves.h:95
The base class for create windows for drawing purpose.
UI_FILL_MODE GetFillModeProp() const
Definition: eda_shape.cpp:556
virtual int GetHatchLineSpacing() const
Definition: eda_shape.h:159
EDA_ANGLE GetArcAngle() const
Definition: eda_shape.cpp:1074
SHAPE_T m_shape
Definition: eda_shape.h:486
void TransformShapeToPolygon(SHAPE_POLY_SET &aBuffer, int aClearance, int aError, ERROR_LOC aErrorLoc, bool ignoreLineWidth=false, bool includeFill=false) const
Convert the shape to a closed polygon.
Definition: eda_shape.cpp:2217
void SetStartX(int x)
Definition: eda_shape.h:191
bool m_proxyItem
Definition: eda_shape.h:513
bool m_hatchingDirty
Definition: eda_shape.h:492
bool m_endsSwapped
Definition: eda_shape.h:485
const VECTOR2I & GetBezierC2() const
Definition: eda_shape.h:258
void SetBezierC2(const VECTOR2I &aPt)
Definition: eda_shape.h:257
void SetCenter(const VECTOR2I &aCenter)
Definition: eda_shape.cpp:953
VECTOR2I getCenter() const
Definition: eda_shape.cpp:927
int GetStartY() const
Definition: eda_shape.h:174
void SetFillModeProp(UI_FILL_MODE)
Definition: eda_shape.cpp:543
void SetLength(const double &aLength)
Definition: eda_shape.cpp:433
int m_editState
Definition: eda_shape.h:512
virtual VECTOR2I GetTopLeft() const
Definition: eda_shape.h:246
void rotate(const VECTOR2I &aRotCentre, const EDA_ANGLE &aAngle)
Definition: eda_shape.cpp:792
const std::vector< VECTOR2I > buildBezierToSegmentsPointsList(int aMaxError) const
Definition: eda_shape.cpp:914
const SHAPE_POLY_SET & GetHatching() const
Definition: eda_shape.h:148
FILL_T GetFillMode() const
Definition: eda_shape.h:142
virtual ~EDA_SHAPE()
Definition: eda_shape.cpp:62
long long int m_rectangleHeight
Definition: eda_shape.h:494
void SetEndY(int aY)
Definition: eda_shape.h:226
virtual int GetEffectiveWidth() const
Definition: eda_shape.h:157
COLOR4D GetLineColor() const
Definition: eda_shape.h:165
int GetEndX() const
Definition: eda_shape.h:217
SHAPE_POLY_SET m_hatching
Definition: eda_shape.h:491
int GetRectangleWidth() const
Definition: eda_shape.cpp:419
void SetLineStyle(const LINE_STYLE aStyle)
Definition: eda_shape.cpp:2351
void calcEdit(const VECTOR2I &aPosition)
Definition: eda_shape.cpp:1960
void SetStartY(int y)
Definition: eda_shape.h:184
virtual std::vector< SHAPE * > MakeEffectiveShapes(bool aEdgeOnly=false) const
Make a set of SHAPE objects representing the EDA_SHAPE.
Definition: eda_shape.h:379
SHAPE_POLY_SET & GetPolyShape()
Definition: eda_shape.h:337
void SetCenterY(int y)
Definition: eda_shape.h:198
void CalcArcAngles(EDA_ANGLE &aStartAngle, EDA_ANGLE &aEndAngle) const
Calc arc start and end angles such that aStartAngle < aEndAngle.
Definition: eda_shape.cpp:986
void ShapeGetMsgPanelInfo(EDA_DRAW_FRAME *aFrame, std::vector< MSG_PANEL_ITEM > &aList)
Definition: eda_shape.cpp:1144
virtual bool isMoving() const
Definition: eda_shape.h:469
bool operator==(const EDA_SHAPE &aOther) const
Definition: eda_shape.cpp:2366
int GetRadius() const
Definition: eda_shape.cpp:1002
SHAPE_T GetShape() const
Definition: eda_shape.h:168
void SetPolyShape(const SHAPE_POLY_SET &aShape)
Definition: eda_shape.h:345
virtual VECTOR2I GetBotRight() const
Definition: eda_shape.h:247
virtual void SetBottom(int val)
Definition: eda_shape.h:252
bool Deserialize(const google::protobuf::Any &aContainer) override
Deserializes the given protobuf message into this object.
Definition: eda_shape.cpp:234
void SetRectangleHeight(const int &aHeight)
Definition: eda_shape.cpp:446
bool IsHatchedFill() const
Definition: eda_shape.h:124
VECTOR2I m_arcCenter
Definition: eda_shape.h:503
double m_segmentLength
Definition: eda_shape.h:497
void SetCenterX(int x)
Definition: eda_shape.h:205
virtual void SetFilled(bool aFlag)
Definition: eda_shape.h:136
virtual void SetTop(int val)
Definition: eda_shape.h:249
virtual bool IsFilledForHitTesting() const
Definition: eda_shape.h:131
bool continueEdit(const VECTOR2I &aPosition)
Definition: eda_shape.cpp:1926
wxString ShowShape() const
Definition: eda_shape.cpp:313
ARC_MID m_arcMidData
Definition: eda_shape.h:504
void SetFillColor(const COLOR4D &aColor)
Definition: eda_shape.h:153
int GetEndY() const
Definition: eda_shape.h:216
std::vector< SHAPE * > makeEffectiveShapes(bool aEdgeOnly, bool aLineChainOnly=false) const
Make a set of SHAPE objects representing the EDA_SHAPE.
Definition: eda_shape.cpp:1759
bool hitTest(const VECTOR2I &aPosition, int aAccuracy=0) const
Definition: eda_shape.cpp:1257
void SetCachedArcData(const VECTOR2I &aStart, const VECTOR2I &aMid, const VECTOR2I &aEnd, const VECTOR2I &aCenter)
Set the data used for mid point caching.
Definition: eda_shape.cpp:1025
void SetEndX(int aX)
Definition: eda_shape.h:233
void RebuildBezierToSegmentsPointsList(int aMaxError)
Rebuild the m_bezierPoints vertex list that approximate the Bezier curve by a list of segments.
Definition: eda_shape.cpp:900
virtual int GetHatchLineWidth() const
Definition: eda_shape.h:158
bool IsSolidFill() const
Definition: eda_shape.h:117
void flip(const VECTOR2I &aCentre, FLIP_DIRECTION aFlipDirection)
Definition: eda_shape.cpp:855
void beginEdit(const VECTOR2I &aStartPoint)
Definition: eda_shape.cpp:1885
VECTOR2I m_start
Definition: eda_shape.h:500
int GetPointCount() const
Definition: eda_shape.cpp:1877
const VECTOR2I & GetEnd() const
Return the ending point of the graphic.
Definition: eda_shape.h:215
bool IsClosed() const
Definition: eda_shape.cpp:505
void SetRadius(int aX)
Definition: eda_shape.h:240
void SetStart(const VECTOR2I &aStart)
Definition: eda_shape.h:177
void DupPolyPointsList(std::vector< VECTOR2I > &aBuffer) const
Duplicate the list of corners in a std::vector<VECTOR2I>.
Definition: eda_shape.cpp:1853
LINE_STYLE GetLineStyle() const
Definition: eda_shape.cpp:2357
void endEdit(bool aClosed=true)
Finish editing the shape.
Definition: eda_shape.cpp:2114
const VECTOR2I & GetStart() const
Return the starting point of the graphic.
Definition: eda_shape.h:173
void SetLineColor(const COLOR4D &aColor)
Definition: eda_shape.h:164
COLOR4D GetFillColor() const
Definition: eda_shape.h:152
void SetRectangle(const long long int &aHeight, const long long int &aWidth)
Definition: eda_shape.cpp:476
void SetShape(SHAPE_T aShape)
Definition: eda_shape.h:167
void SwapShape(EDA_SHAPE *aImage)
Definition: eda_shape.cpp:2151
std::vector< VECTOR2I > GetRectCorners() const
Definition: eda_shape.cpp:1585
void SetSegmentAngle(const EDA_ANGLE &aAngle)
Definition: eda_shape.cpp:491
std::vector< VECTOR2I > GetCornersInSequence() const
Definition: eda_shape.cpp:1600
std::vector< VECTOR2I > m_bezierPoints
Definition: eda_shape.h:509
bool IsAnyFill() const
Definition: eda_shape.h:112
void setPosition(const VECTOR2I &aPos)
Definition: eda_shape.cpp:357
virtual void setFilled(bool aFlag)
Definition: eda_shape.h:436
const std::vector< VECTOR2I > & GetBezierPoints() const
Definition: eda_shape.h:320
virtual bool IsProxyItem() const
Definition: eda_shape.h:109
void computeArcBBox(BOX2I &aBBox) const
Definition: eda_shape.cpp:1699
virtual void UpdateHatching() const
Definition: eda_shape.cpp:569
void SetEnd(const VECTOR2I &aEnd)
Definition: eda_shape.h:219
bool EndsSwapped() const
Have the start and end points been swapped since they were set?
Definition: eda_shape.h:281
void SetRectangleWidth(const int &aWidth)
Definition: eda_shape.cpp:461
const SHAPE_POLY_SET & GetPolyShape() const
Definition: eda_shape.h:338
void SetBezierC1(const VECTOR2I &aPt)
Definition: eda_shape.h:254
void SetArcGeometry(const VECTOR2I &aStart, const VECTOR2I &aMid, const VECTOR2I &aEnd)
Set the three controlling points for an arc.
Definition: eda_shape.cpp:1035
virtual void SetLeft(int val)
Definition: eda_shape.h:250
double GetLength() const
Definition: eda_shape.cpp:374
wxString SHAPE_T_asString() const
Definition: eda_shape.cpp:340
int GetStartX() const
Definition: eda_shape.h:175
double Similarity(const EDA_SHAPE &aOther) const
Definition: eda_shape.cpp:2411
const VECTOR2I & GetBezierC1() const
Definition: eda_shape.h:255
VECTOR2I m_end
Definition: eda_shape.h:501
const BOX2I getBoundingBox() const
Definition: eda_shape.cpp:1203
virtual EDA_ANGLE getDrawRotation() const
Definition: eda_shape.h:446
void SetArcAngleAndEnd(const EDA_ANGLE &aAngle, bool aCheckNegativeAngle=false)
Set the end point from the angle center and start.
Definition: eda_shape.cpp:1102
SHAPE_POLY_SET m_poly
Definition: eda_shape.h:510
int GetRectangleHeight() const
Definition: eda_shape.cpp:405
virtual int GetWidth() const
Definition: eda_shape.h:156
VECTOR2I getPosition() const
Definition: eda_shape.cpp:363
bool IsClockwiseArc() const
Definition: eda_shape.cpp:1085
STROKE_PARAMS m_stroke
Definition: eda_shape.h:487
void SetHatchingDirty()
Definition: eda_shape.h:147
EDA_ANGLE m_segmentAngle
Definition: eda_shape.h:498
void setEditState(int aState)
Definition: eda_shape.h:467
void SetPolyPoints(const std::vector< VECTOR2I > &aPoints)
Definition: eda_shape.cpp:1749
wxString getFriendlyName() const
Definition: eda_shape.cpp:1117
VECTOR2I m_bezierC1
Definition: eda_shape.h:506
FILL_T m_fill
Definition: eda_shape.h:488
COLOR4D m_fillColor
Definition: eda_shape.h:489
void SetWidth(int aWidth)
Definition: eda_shape.cpp:2344
EDA_ANGLE GetSegmentAngle() const
Definition: eda_shape.cpp:1065
virtual void SetRight(int val)
Definition: eda_shape.h:251
void SetFillMode(FILL_T aFill)
Definition: eda_shape.cpp:536
virtual void SetIsProxyItem(bool aIsProxy=true)
Definition: eda_shape.h:110
long long int m_rectangleWidth
Definition: eda_shape.h:495
VECTOR2I m_bezierC2
Definition: eda_shape.h:507
void Serialize(google::protobuf::Any &aContainer) const override
Serializes this object to the given Any message.
Definition: eda_shape.cpp:146
bool IsPolyShapeValid() const
Definition: eda_shape.cpp:1870
int Compare(const EDA_SHAPE *aOther) const
Definition: eda_shape.cpp:2176
VECTOR2I GetArcMid() const
Definition: eda_shape.cpp:972
A color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:104
An abstract class from which implementation specific LINE_READERs may be derived to read single lines...
Definition: richio.h:93
EDA_MSG_PANEL items for displaying messages.
Definition: msgpanel.h:54
Interface for objects that can be serialized to Protobuf messages.
Definition: serializable.h:37
Represent a set of closed polygons.
void Fracture()
Convert a set of polygons with holes to a single outline with "slits"/"fractures" connecting the oute...
int HoleCount(int aOutline) const
Returns the number of holes in a given outline.
int OutlineCount() const
Return the number of outlines in the set.
An abstract shape on 2D plane.
Definition: shape.h:126
Simple container to manage line stroke parameters.
Definition: stroke_params.h:94
int GetWidth() const
void SetColor(const KIGFX::COLOR4D &aColor)
KIGFX::COLOR4D GetColor() const
static constexpr EDA_ANGLE ANGLE_0
Definition: eda_angle.h:404
SHAPE_T
Definition: eda_shape.h:43
@ RECTANGLE
Use RECTANGLE instead of RECT to avoid collision in a Windows header.
UI_FILL_MODE
Definition: eda_shape.h:68
@ REVERSE_HATCH
Definition: eda_shape.h:72
@ SOLID
Definition: eda_shape.h:70
@ HATCH
Definition: eda_shape.h:71
@ NONE
Definition: eda_shape.h:69
@ CROSS_HATCH
Definition: eda_shape.h:73
FILL_T
Definition: eda_shape.h:56
@ FILLED_WITH_COLOR
@ FILLED_WITH_BG_BODYCOLOR
@ FILLED_SHAPE
Fill with object color.
FLIP_DIRECTION
Definition: mirror.h:27
#define DECLARE_ENUM_TO_WXANY(type)
Definition: property.h:747
const int scale
LINE_STYLE
Dashed line types.
Definition: stroke_params.h:46
Holding struct to keep originating midpoint.
Definition: eda_shape.h:79
VECTOR2I end
Definition: eda_shape.h:82
VECTOR2I center
Definition: eda_shape.h:83
VECTOR2I start
Definition: eda_shape.h:81
VECTOR2I mid
Definition: eda_shape.h:80
VECTOR2< int32_t > VECTOR2I
Definition: vector2d.h:695