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 <memory>
28
29#include <core/mirror.h>
32#include <properties/property.h>
33#include <stroke_params.h>
34#include <trigo.h>
35#include <api/serializable.h>
36
37class LINE_READER;
38class EDA_DRAW_FRAME;
39class FOOTPRINT;
40class MSG_PANEL_ITEM;
41struct EDA_IU_SCALE;
42
43using KIGFX::COLOR4D;
44
55
56
57// WARNING: Do not change these values without updating dialogs that depend on their position values
58enum class FILL_T : int
59{
62 FILLED_WITH_BG_BODYCOLOR, //< Fill with background body color.
63 FILLED_WITH_COLOR, //< Fill with a separate color.
67};
68
69
78
79
88
89
95
96
97class EDA_SHAPE : public SERIALIZABLE
98{
99public:
100 EDA_SHAPE( SHAPE_T aType, int aLineWidth, FILL_T aFill );
101
103 EDA_SHAPE( const SHAPE& aShape );
104
105 EDA_SHAPE( const EDA_SHAPE& aOther );
106 EDA_SHAPE& operator=( const EDA_SHAPE& aOther );
107
108 EDA_SHAPE( EDA_SHAPE&& ) noexcept = default;
109 EDA_SHAPE& operator=( EDA_SHAPE&& ) noexcept = default;
110
111 virtual ~EDA_SHAPE();
112
113 void SwapShape( EDA_SHAPE* aImage );
114
115 void Serialize( google::protobuf::Any &aContainer ) const override;
116 bool Deserialize( const google::protobuf::Any &aContainer ) override;
117
118 void Serialize( google::protobuf::Any &aContainer, const EDA_IU_SCALE& aScale ) const;
119 bool Deserialize( const google::protobuf::Any& aContainer, const EDA_IU_SCALE& aScale );
120
121 wxString ShowShape() const;
122
123 wxString SHAPE_T_asString() const;
124
125 virtual bool IsProxyItem() const { return m_proxyItem; }
126 virtual void SetIsProxyItem( bool aIsProxy = true ) { m_proxyItem = aIsProxy; }
127
128 bool IsAnyFill() const
129 {
130 return GetFillMode() != FILL_T::NO_FILL;
131 }
132
139
140 bool IsHatchedFill() const
141 {
142 return GetFillMode() == FILL_T::HATCH
145 }
146
147 virtual bool IsFilledForHitTesting() const
148 {
149 return IsSolidFill();
150 }
151
152 virtual void SetFilled( bool aFlag )
153 {
154 setFilled( aFlag );
155 }
156
157 void SetFillMode( FILL_T aFill );
158 FILL_T GetFillMode() const { return m_fill; }
159
162
164 const SHAPE_POLY_SET& GetHatching() const;
165 const std::vector<SEG>& GetHatchLines() const;
166
167 bool IsClosed() const;
168
169 COLOR4D GetFillColor() const { return m_fillColor; }
170 void SetFillColor( const COLOR4D& aColor ) { m_fillColor = aColor; }
171
172 void SetWidth( int aWidth );
173 virtual int GetWidth() const { return m_stroke.GetWidth(); }
174 virtual int GetEffectiveWidth() const { return GetWidth(); }
175 virtual int GetHatchLineWidth() const { return GetEffectiveWidth(); }
176 virtual int GetHatchLineSpacing() const { return GetHatchLineWidth() * 10; }
177
178 void SetLineStyle( const LINE_STYLE aStyle );
179 LINE_STYLE GetLineStyle() const;
180
181 void SetLineColor( const COLOR4D& aColor ) { m_stroke.SetColor( aColor ); }
182 COLOR4D GetLineColor() const { return m_stroke.GetColor(); }
183
184 void SetShape( SHAPE_T aShape ) { m_shape = aShape; }
185 SHAPE_T GetShape() const { return m_shape; }
186
190 const VECTOR2I& GetStart() const { return m_start; }
191 int GetStartY() const { return m_start.y; }
192 int GetStartX() const { return m_start.x; }
193
194 void SetStart( const VECTOR2I& aStart )
195 {
196 m_start = aStart;
197 m_endsSwapped = false;
198 m_hatchingDirty = true;
199 }
200
201 void SetStartY( int y )
202 {
203 m_start.y = y;
204 m_endsSwapped = false;
205 m_hatchingDirty = true;
206 }
207
208 void SetStartX( int x )
209 {
210 m_start.x = x;
211 m_endsSwapped = false;
212 m_hatchingDirty = true;
213 }
214
215 void SetCenterY( int y )
216 {
217 m_end.y += y - m_start.y;
218 m_start.y = y;
219 m_hatchingDirty = true;
220 }
221
222 void SetCenterX( int x )
223 {
224 m_end.x += x - m_start.x;
225 m_start.x = x;
226 m_hatchingDirty = true;
227 }
228
232 const VECTOR2I& GetEnd() const { return m_end; }
233 int GetEndY() const { return m_end.y; }
234 int GetEndX() const { return m_end.x; }
235
236 void SetEnd( const VECTOR2I& aEnd )
237 {
238 m_end = aEnd;
239 m_endsSwapped = false;
240 m_hatchingDirty = true;
241 }
242
243 void SetEndY( int aY )
244 {
245 m_end.y = aY;
246 m_endsSwapped = false;
247 m_hatchingDirty = true;
248 }
249
250 void SetEndX( int aX )
251 {
252 m_end.x = aX;
253 m_endsSwapped = false;
254 m_hatchingDirty = true;
255 }
256
257 void SetRadius( int aX )
258 {
259 m_end = m_start + VECTOR2I( aX, 0 );
260 m_hatchingDirty = true;
261 }
262
263 virtual VECTOR2I GetTopLeft() const { return GetStart(); }
264 virtual VECTOR2I GetBotRight() const { return GetEnd(); }
265
266 virtual void SetTop( int val ) { SetStartY( val ); }
267 virtual void SetLeft( int val ) { SetStartX( val ); }
268 virtual void SetRight( int val ) { SetEndX( val ); }
269 virtual void SetBottom( int val ) { SetEndY( val ); }
270
271 void SetBezierC1( const VECTOR2I& aPt ) { m_bezierC1 = aPt; }
272 const VECTOR2I& GetBezierC1() const { return m_bezierC1; }
273
274 void SetBezierC2( const VECTOR2I& aPt ) { m_bezierC2 = aPt; }
275 const VECTOR2I& GetBezierC2() const { return m_bezierC2; }
276
277 VECTOR2I getCenter() const;
278 void SetCenter( const VECTOR2I& aCenter );
279
287 void SetArcAngleAndEnd( const EDA_ANGLE& aAngle, bool aCheckNegativeAngle = false );
288
289 EDA_ANGLE GetArcAngle() const;
290
292
298 bool EndsSwapped() const { return m_endsSwapped; }
299
300 // Some attributes are read only, since they are derived from m_Start, m_End, and m_Angle.
301 // No Set...() function for these attributes.
302
303 VECTOR2I GetArcMid() const;
304 std::vector<VECTOR2I> GetRectCorners() const;
305 std::vector<VECTOR2I> GetCornersInSequence( EDA_ANGLE angle ) const;
306
311 void CalcArcAngles( EDA_ANGLE& aStartAngle, EDA_ANGLE& aEndAngle ) const;
312
313 int GetRadius() const;
314
321 void SetArcGeometry( const VECTOR2I& aStart, const VECTOR2I& aMid, const VECTOR2I& aEnd );
322
334 void SetCachedArcData( const VECTOR2I& aStart, const VECTOR2I& aMid, const VECTOR2I& aEnd,
335 const VECTOR2I& aCenter );
336
337 const std::vector<VECTOR2I>& GetBezierPoints() const { return m_bezierPoints; }
338
345 std::vector<VECTOR2I> GetPolyPoints() const;
346
350 int GetPointCount() const;
351
353 const SHAPE_POLY_SET& GetPolyShape() const;
354
358 bool IsPolyShapeValid() const;
359
360 void SetPolyShape( const SHAPE_POLY_SET& aShape )
361 {
362 GetPolyShape() = aShape;
363
364 for( int ii = 0; ii < GetPolyShape().OutlineCount(); ++ii )
365 {
366 if( GetPolyShape().HoleCount( ii ) )
367 {
369 break;
370 }
371 }
372 }
373
374 void SetPolyPoints( const std::vector<VECTOR2I>& aPoints );
375
384 void RebuildBezierToSegmentsPointsList( int aMaxError );
385
394 virtual std::vector<SHAPE*> MakeEffectiveShapes( bool aEdgeOnly = false ) const
395 {
396 return makeEffectiveShapes( aEdgeOnly );
397 }
398
399 virtual std::vector<SHAPE*> MakeEffectiveShapesForHitTesting() const
400 {
401 return makeEffectiveShapes( false, false, true );
402 }
403
404 void ShapeGetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList );
405
406 void SetRectangleHeight( const int& aHeight );
407
408 void SetRectangleWidth( const int& aWidth );
409
410 void SetRectangle( const long long int& aHeight, const long long int& aWidth );
411
412 void SetCornerRadius( int aRadius );
413 int GetCornerRadius() const;
414
415 bool IsClockwiseArc() const;
416
420 double GetLength() const;
421
422 int GetRectangleHeight() const;
423 int GetRectangleWidth() const;
424
425 virtual void UpdateHatching() const;
426
439 void TransformShapeToPolygon( SHAPE_POLY_SET& aBuffer, int aClearance, int aError,
440 ERROR_LOC aErrorLoc, bool ignoreLineWidth = false,
441 bool includeFill = false ) const;
442
443 int Compare( const EDA_SHAPE* aOther ) const;
444
445 double Similarity( const EDA_SHAPE& aOther ) const;
446
447 bool operator==( const EDA_SHAPE& aOther ) const;
448
449protected:
450 wxString getFriendlyName() const;
451
452 void setPosition( const VECTOR2I& aPos );
453 VECTOR2I getPosition() const;
454
455 virtual void setFilled( bool aFlag )
456 {
458 }
459
461 {
462 return SHAPE_POLY_SET();
463 }
464
465 void move( const VECTOR2I& aMoveVector );
466 void rotate( const VECTOR2I& aRotCentre, const EDA_ANGLE& aAngle );
467 void flip( const VECTOR2I& aCentre, FLIP_DIRECTION aFlipDirection );
468 void scale( double aScale );
469
470 virtual EDA_ANGLE getDrawRotation() const { return ANGLE_0; }
471
472 const BOX2I getBoundingBox() const;
473
474 void computeArcBBox( BOX2I& aBBox ) const;
475
476 bool hitTest( const VECTOR2I& aPosition, int aAccuracy = 0 ) const;
477 bool hitTest( const BOX2I& aRect, bool aContained, int aAccuracy = 0 ) const;
478 bool hitTest( const SHAPE_LINE_CHAIN& aPoly, bool aContained ) const;
479
480 const std::vector<VECTOR2I> buildBezierToSegmentsPointsList( int aMaxError ) const;
481
482 void beginEdit( const VECTOR2I& aStartPoint );
483 bool continueEdit( const VECTOR2I& aPosition );
484 void calcEdit( const VECTOR2I& aPosition );
485
491 void endEdit( bool aClosed = true );
492 void setEditState( int aState ) { m_editState = aState; }
493
494 virtual bool isMoving() const { return false; }
495
506 // fixme: move to shape_compound
507 std::vector<SHAPE*> makeEffectiveShapes( bool aEdgeOnly, bool aLineChainOnly = false,
508 bool aHittesting = false ) const;
509
510 virtual int getMaxError() const { return 100; }
511
512 // non-const for PCB_SHAPE
513 SHAPE_POLY_SET& hatching() const;
514 std::vector<SEG>& hatchLines() const;
515
516protected:
517 bool m_endsSwapped; // true if start/end were swapped e.g. SetArcAngleAndEnd
518 SHAPE_T m_shape; // Shape: line, Circle, Arc
519 STROKE_PARAMS m_stroke; // Line style, width, etc.
522
523 mutable std::unique_ptr<EDA_SHAPE_HATCH_CACHE_DATA> m_hatchingCache;
524 mutable bool m_hatchingDirty;
525
526 long long int m_rectangleHeight;
527 long long int m_rectangleWidth;
529
530 VECTOR2I m_start; // Line start point or Circle center
531 VECTOR2I m_end; // Line end point or Circle 3 o'clock point
532
533 VECTOR2I m_arcCenter; // Used only for Arcs: arc end point
534 ARC_MID m_arcMidData; // Used to store originating data
535
536 VECTOR2I m_bezierC1; // Bezier Control Point 1
537 VECTOR2I m_bezierC2; // Bezier Control Point 2
538
539 std::vector<VECTOR2I> m_bezierPoints;
540 mutable std::unique_ptr<SHAPE_POLY_SET> m_poly; // Stores the S_POLYGON shape
541
543 bool m_proxyItem; // A shape storing proxy information (ie: a pad
544 // number box, thermal spoke template, etc.)
545};
546
550
ERROR_LOC
When approximating an arc or circle, should the error be placed on the outside or inside of the curve...
BOX2< VECTOR2I > BOX2I
Definition box2.h:922
Generic cubic Bezier representation.
Represent basic circle geometry with utility geometry functions.
Definition circle.h:33
The base class for create windows for drawing purpose.
UI_FILL_MODE GetFillModeProp() const
virtual int GetHatchLineSpacing() const
Definition eda_shape.h:176
EDA_ANGLE GetArcAngle() const
SHAPE_T m_shape
Definition eda_shape.h:518
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.
void SetStartX(int x)
Definition eda_shape.h:208
bool m_proxyItem
Definition eda_shape.h:543
int m_cornerRadius
Definition eda_shape.h:528
bool m_hatchingDirty
Definition eda_shape.h:524
bool m_endsSwapped
Definition eda_shape.h:517
const VECTOR2I & GetBezierC2() const
Definition eda_shape.h:275
void SetBezierC2(const VECTOR2I &aPt)
Definition eda_shape.h:274
void SetCenter(const VECTOR2I &aCenter)
VECTOR2I getCenter() const
int GetStartY() const
Definition eda_shape.h:191
void SetFillModeProp(UI_FILL_MODE)
int m_editState
Definition eda_shape.h:542
virtual int getMaxError() const
Definition eda_shape.h:510
virtual VECTOR2I GetTopLeft() const
Definition eda_shape.h:263
void rotate(const VECTOR2I &aRotCentre, const EDA_ANGLE &aAngle)
const std::vector< VECTOR2I > buildBezierToSegmentsPointsList(int aMaxError) const
const SHAPE_POLY_SET & GetHatching() const
FILL_T GetFillMode() const
Definition eda_shape.h:158
void SetCornerRadius(int aRadius)
long long int m_rectangleHeight
Definition eda_shape.h:526
std::unique_ptr< EDA_SHAPE_HATCH_CACHE_DATA > m_hatchingCache
Definition eda_shape.h:523
void SetEndY(int aY)
Definition eda_shape.h:243
virtual int GetEffectiveWidth() const
Definition eda_shape.h:174
std::vector< VECTOR2I > GetPolyPoints() const
Duplicate the polygon outlines into a flat list of VECTOR2I points.
COLOR4D GetLineColor() const
Definition eda_shape.h:182
EDA_SHAPE(EDA_SHAPE &&) noexcept=default
int GetEndX() const
Definition eda_shape.h:234
std::vector< SHAPE * > makeEffectiveShapes(bool aEdgeOnly, bool aLineChainOnly=false, bool aHittesting=false) const
Make a set of SHAPE objects representing the EDA_SHAPE.
int GetRectangleWidth() const
void SetLineStyle(const LINE_STYLE aStyle)
void calcEdit(const VECTOR2I &aPosition)
void SetStartY(int y)
Definition eda_shape.h:201
virtual std::vector< SHAPE * > MakeEffectiveShapes(bool aEdgeOnly=false) const
Make a set of SHAPE objects representing the EDA_SHAPE.
Definition eda_shape.h:394
SHAPE_POLY_SET & GetPolyShape()
void SetCenterY(int y)
Definition eda_shape.h:215
void CalcArcAngles(EDA_ANGLE &aStartAngle, EDA_ANGLE &aEndAngle) const
Calc arc start and end angles such that aStartAngle < aEndAngle.
std::vector< VECTOR2I > GetCornersInSequence(EDA_ANGLE angle) const
void ShapeGetMsgPanelInfo(EDA_DRAW_FRAME *aFrame, std::vector< MSG_PANEL_ITEM > &aList)
virtual bool isMoving() const
Definition eda_shape.h:494
bool operator==(const EDA_SHAPE &aOther) const
int GetRadius() const
SHAPE_T GetShape() const
Definition eda_shape.h:185
void SetPolyShape(const SHAPE_POLY_SET &aShape)
Definition eda_shape.h:360
virtual VECTOR2I GetBotRight() const
Definition eda_shape.h:264
virtual void SetBottom(int val)
Definition eda_shape.h:269
bool Deserialize(const google::protobuf::Any &aContainer) override
Deserializes the given protobuf message into this object.
const std::vector< SEG > & GetHatchLines() const
void SetRectangleHeight(const int &aHeight)
SHAPE_POLY_SET & hatching() const
bool IsHatchedFill() const
Definition eda_shape.h:140
virtual SHAPE_POLY_SET getHatchingKnockouts() const
Definition eda_shape.h:460
VECTOR2I m_arcCenter
Definition eda_shape.h:533
void SetCenterX(int x)
Definition eda_shape.h:222
virtual void SetFilled(bool aFlag)
Definition eda_shape.h:152
virtual void SetTop(int val)
Definition eda_shape.h:266
virtual bool IsFilledForHitTesting() const
Definition eda_shape.h:147
bool continueEdit(const VECTOR2I &aPosition)
wxString ShowShape() const
ARC_MID m_arcMidData
Definition eda_shape.h:534
void SetFillColor(const COLOR4D &aColor)
Definition eda_shape.h:170
int GetEndY() const
Definition eda_shape.h:233
bool hitTest(const VECTOR2I &aPosition, int aAccuracy=0) const
void SetCachedArcData(const VECTOR2I &aStart, const VECTOR2I &aMid, const VECTOR2I &aEnd, const VECTOR2I &aCenter)
Set the data used for mid point caching.
void SetEndX(int aX)
Definition eda_shape.h:250
void RebuildBezierToSegmentsPointsList(int aMaxError)
Rebuild the m_bezierPoints vertex list that approximate the Bezier curve by a list of segments.
virtual int GetHatchLineWidth() const
Definition eda_shape.h:175
bool IsSolidFill() const
Definition eda_shape.h:133
void flip(const VECTOR2I &aCentre, FLIP_DIRECTION aFlipDirection)
EDA_SHAPE(SHAPE_T aType, int aLineWidth, FILL_T aFill)
Definition eda_shape.cpp:55
std::vector< SEG > & hatchLines() const
void beginEdit(const VECTOR2I &aStartPoint)
VECTOR2I m_start
Definition eda_shape.h:530
int GetPointCount() const
const VECTOR2I & GetEnd() const
Return the ending point of the graphic.
Definition eda_shape.h:232
bool IsClosed() const
void SetRadius(int aX)
Definition eda_shape.h:257
void SetStart(const VECTOR2I &aStart)
Definition eda_shape.h:194
LINE_STYLE GetLineStyle() const
void endEdit(bool aClosed=true)
Finish editing the shape.
const VECTOR2I & GetStart() const
Return the starting point of the graphic.
Definition eda_shape.h:190
void SetLineColor(const COLOR4D &aColor)
Definition eda_shape.h:181
COLOR4D GetFillColor() const
Definition eda_shape.h:169
void SetRectangle(const long long int &aHeight, const long long int &aWidth)
void SetShape(SHAPE_T aShape)
Definition eda_shape.h:184
void SwapShape(EDA_SHAPE *aImage)
std::vector< VECTOR2I > GetRectCorners() const
std::vector< VECTOR2I > m_bezierPoints
Definition eda_shape.h:539
bool IsAnyFill() const
Definition eda_shape.h:128
void setPosition(const VECTOR2I &aPos)
virtual std::vector< SHAPE * > MakeEffectiveShapesForHitTesting() const
Definition eda_shape.h:399
virtual void setFilled(bool aFlag)
Definition eda_shape.h:455
const std::vector< VECTOR2I > & GetBezierPoints() const
Definition eda_shape.h:337
virtual bool IsProxyItem() const
Definition eda_shape.h:125
void computeArcBBox(BOX2I &aBBox) const
virtual void UpdateHatching() const
void SetEnd(const VECTOR2I &aEnd)
Definition eda_shape.h:236
bool EndsSwapped() const
Have the start and end points been swapped since they were set?
Definition eda_shape.h:298
void SetRectangleWidth(const int &aWidth)
void SetBezierC1(const VECTOR2I &aPt)
Definition eda_shape.h:271
void SetArcGeometry(const VECTOR2I &aStart, const VECTOR2I &aMid, const VECTOR2I &aEnd)
Set the three controlling points for an arc.
virtual void SetLeft(int val)
Definition eda_shape.h:267
double GetLength() const
wxString SHAPE_T_asString() const
int GetStartX() const
Definition eda_shape.h:192
double Similarity(const EDA_SHAPE &aOther) const
const VECTOR2I & GetBezierC1() const
Definition eda_shape.h:272
VECTOR2I m_end
Definition eda_shape.h:531
const BOX2I getBoundingBox() const
virtual EDA_ANGLE getDrawRotation() const
Definition eda_shape.h:470
void SetArcAngleAndEnd(const EDA_ANGLE &aAngle, bool aCheckNegativeAngle=false)
Set the end point from the angle center and start.
int GetRectangleHeight() const
virtual int GetWidth() const
Definition eda_shape.h:173
VECTOR2I getPosition() const
bool IsClockwiseArc() const
STROKE_PARAMS m_stroke
Definition eda_shape.h:519
void SetHatchingDirty()
Definition eda_shape.h:163
void setEditState(int aState)
Definition eda_shape.h:492
void SetPolyPoints(const std::vector< VECTOR2I > &aPoints)
wxString getFriendlyName() const
EDA_SHAPE & operator=(const EDA_SHAPE &aOther)
VECTOR2I m_bezierC1
Definition eda_shape.h:536
FILL_T m_fill
Definition eda_shape.h:520
COLOR4D m_fillColor
Definition eda_shape.h:521
void SetWidth(int aWidth)
EDA_ANGLE GetSegmentAngle() const
virtual void SetRight(int val)
Definition eda_shape.h:268
int GetCornerRadius() const
void SetFillMode(FILL_T aFill)
std::unique_ptr< SHAPE_POLY_SET > m_poly
Definition eda_shape.h:540
virtual void SetIsProxyItem(bool aIsProxy=true)
Definition eda_shape.h:126
long long int m_rectangleWidth
Definition eda_shape.h:527
VECTOR2I m_bezierC2
Definition eda_shape.h:537
void Serialize(google::protobuf::Any &aContainer) const override
Serializes this object to the given Any message.
bool IsPolyShapeValid() const
int Compare(const EDA_SHAPE *aOther) const
VECTOR2I GetArcMid() const
A color representation with 4 components: red, green, blue, alpha.
Definition color4d.h:105
An abstract class from which implementation specific LINE_READERs may be derived to read single lines...
Definition richio.h:66
EDA_MSG_PANEL items for displaying messages.
Definition msgpanel.h:54
Interface for objects that can be serialized to Protobuf messages.
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.
int OutlineCount() const
Return the number of outlines in the set.
void Fracture(bool aSimplify=true)
Convert a set of polygons with holes to a single outline with "slits"/"fractures" connecting the oute...
An abstract shape on 2D plane.
Definition shape.h:126
Simple container to manage line stroke parameters.
static constexpr EDA_ANGLE ANGLE_0
Definition eda_angle.h:411
SHAPE_T
Definition eda_shape.h:46
@ SEGMENT
Definition eda_shape.h:48
UI_FILL_MODE
Definition eda_shape.h:71
@ REVERSE_HATCH
Definition eda_shape.h:75
@ SOLID
Definition eda_shape.h:73
@ HATCH
Definition eda_shape.h:74
@ NONE
Definition eda_shape.h:72
@ CROSS_HATCH
Definition eda_shape.h:76
FILL_T
Definition eda_shape.h:59
@ FILLED_WITH_COLOR
Definition eda_shape.h:63
@ NO_FILL
Definition eda_shape.h:60
@ REVERSE_HATCH
Definition eda_shape.h:65
@ HATCH
Definition eda_shape.h:64
@ FILLED_WITH_BG_BODYCOLOR
Definition eda_shape.h:62
@ FILLED_SHAPE
Fill with object color.
Definition eda_shape.h:61
@ CROSS_HATCH
Definition eda_shape.h:66
FLIP_DIRECTION
Definition mirror.h:27
#define DECLARE_ENUM_TO_WXANY(type)
Definition property.h:787
const int scale
LINE_STYLE
Dashed line types.
Holding struct to keep originating midpoint.
Definition eda_shape.h:82
VECTOR2I end
Definition eda_shape.h:85
VECTOR2I center
Definition eda_shape.h:86
VECTOR2I start
Definition eda_shape.h:84
VECTOR2I mid
Definition eda_shape.h:83
SHAPE_POLY_SET hatching
Definition eda_shape.h:92
std::vector< SEG > hatchLines
Definition eda_shape.h:93
VECTOR2< int32_t > VECTOR2I
Definition vector2d.h:687