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;
41
42using KIGFX::COLOR4D;
43
54
55
56// WARNING: Do not change these values without updating dialogs that depend on their position values
57enum class FILL_T : int
58{
61 FILLED_WITH_BG_BODYCOLOR, //< Fill with background body color.
62 FILLED_WITH_COLOR, //< Fill with a separate color.
66};
67
68
77
78
87
88
94
95
96class EDA_SHAPE : public SERIALIZABLE
97{
98public:
99 EDA_SHAPE( SHAPE_T aType, int aLineWidth, FILL_T aFill );
100
102 EDA_SHAPE( const SHAPE& aShape );
103
104 EDA_SHAPE( const EDA_SHAPE& aOther );
105 EDA_SHAPE& operator=( const EDA_SHAPE& aOther );
106
107 EDA_SHAPE( EDA_SHAPE&& ) noexcept = default;
108 EDA_SHAPE& operator=( EDA_SHAPE&& ) noexcept = default;
109
110 virtual ~EDA_SHAPE();
111
112 void SwapShape( EDA_SHAPE* aImage );
113
114 void Serialize( google::protobuf::Any &aContainer ) const override;
115 bool Deserialize( const google::protobuf::Any &aContainer ) override;
116
117 wxString ShowShape() const;
118
119 wxString SHAPE_T_asString() const;
120
121 virtual bool IsProxyItem() const { return m_proxyItem; }
122 virtual void SetIsProxyItem( bool aIsProxy = true ) { m_proxyItem = aIsProxy; }
123
124 bool IsAnyFill() const
125 {
126 return GetFillMode() != FILL_T::NO_FILL;
127 }
128
135
136 bool IsHatchedFill() const
137 {
138 return GetFillMode() == FILL_T::HATCH
141 }
142
143 virtual bool IsFilledForHitTesting() const
144 {
145 return IsSolidFill();
146 }
147
148 virtual void SetFilled( bool aFlag )
149 {
150 setFilled( aFlag );
151 }
152
153 void SetFillMode( FILL_T aFill );
154 FILL_T GetFillMode() const { return m_fill; }
155
158
160 const SHAPE_POLY_SET& GetHatching() const;
161 const std::vector<SEG>& GetHatchLines() const;
162
163 bool IsClosed() const;
164
165 COLOR4D GetFillColor() const { return m_fillColor; }
166 void SetFillColor( const COLOR4D& aColor ) { m_fillColor = aColor; }
167
168 void SetWidth( int aWidth );
169 virtual int GetWidth() const { return m_stroke.GetWidth(); }
170 virtual int GetEffectiveWidth() const { return GetWidth(); }
171 virtual int GetHatchLineWidth() const { return GetEffectiveWidth(); }
172 virtual int GetHatchLineSpacing() const { return GetHatchLineWidth() * 10; }
173
174 void SetLineStyle( const LINE_STYLE aStyle );
175 LINE_STYLE GetLineStyle() const;
176
177 void SetLineColor( const COLOR4D& aColor ) { m_stroke.SetColor( aColor ); }
178 COLOR4D GetLineColor() const { return m_stroke.GetColor(); }
179
180 void SetShape( SHAPE_T aShape ) { m_shape = aShape; }
181 SHAPE_T GetShape() const { return m_shape; }
182
186 const VECTOR2I& GetStart() const { return m_start; }
187 int GetStartY() const { return m_start.y; }
188 int GetStartX() const { return m_start.x; }
189
190 void SetStart( const VECTOR2I& aStart )
191 {
192 m_start = aStart;
193 m_endsSwapped = false;
194 m_hatchingDirty = true;
195 }
196
197 void SetStartY( int y )
198 {
199 m_start.y = y;
200 m_endsSwapped = false;
201 m_hatchingDirty = true;
202 }
203
204 void SetStartX( int x )
205 {
206 m_start.x = x;
207 m_endsSwapped = false;
208 m_hatchingDirty = true;
209 }
210
211 void SetCenterY( int y )
212 {
213 m_end.y += y - m_start.y;
214 m_start.y = y;
215 m_hatchingDirty = true;
216 }
217
218 void SetCenterX( int x )
219 {
220 m_end.x += x - m_start.x;
221 m_start.x = x;
222 m_hatchingDirty = true;
223 }
224
228 const VECTOR2I& GetEnd() const { return m_end; }
229 int GetEndY() const { return m_end.y; }
230 int GetEndX() const { return m_end.x; }
231
232 void SetEnd( const VECTOR2I& aEnd )
233 {
234 m_end = aEnd;
235 m_endsSwapped = false;
236 m_hatchingDirty = true;
237 }
238
239 void SetEndY( int aY )
240 {
241 m_end.y = aY;
242 m_endsSwapped = false;
243 m_hatchingDirty = true;
244 }
245
246 void SetEndX( int aX )
247 {
248 m_end.x = aX;
249 m_endsSwapped = false;
250 m_hatchingDirty = true;
251 }
252
253 void SetRadius( int aX )
254 {
255 m_end = m_start + VECTOR2I( aX, 0 );
256 m_hatchingDirty = true;
257 }
258
259 virtual VECTOR2I GetTopLeft() const { return GetStart(); }
260 virtual VECTOR2I GetBotRight() const { return GetEnd(); }
261
262 virtual void SetTop( int val ) { SetStartY( val ); }
263 virtual void SetLeft( int val ) { SetStartX( val ); }
264 virtual void SetRight( int val ) { SetEndX( val ); }
265 virtual void SetBottom( int val ) { SetEndY( val ); }
266
267 void SetBezierC1( const VECTOR2I& aPt ) { m_bezierC1 = aPt; }
268 const VECTOR2I& GetBezierC1() const { return m_bezierC1; }
269
270 void SetBezierC2( const VECTOR2I& aPt ) { m_bezierC2 = aPt; }
271 const VECTOR2I& GetBezierC2() const { return m_bezierC2; }
272
273 VECTOR2I getCenter() const;
274 void SetCenter( const VECTOR2I& aCenter );
275
283 void SetArcAngleAndEnd( const EDA_ANGLE& aAngle, bool aCheckNegativeAngle = false );
284
285 EDA_ANGLE GetArcAngle() const;
286
288
294 bool EndsSwapped() const { return m_endsSwapped; }
295
296 // Some attributes are read only, since they are derived from m_Start, m_End, and m_Angle.
297 // No Set...() function for these attributes.
298
299 VECTOR2I GetArcMid() const;
300 std::vector<VECTOR2I> GetRectCorners() const;
301 std::vector<VECTOR2I> GetCornersInSequence( EDA_ANGLE angle ) const;
302
307 void CalcArcAngles( EDA_ANGLE& aStartAngle, EDA_ANGLE& aEndAngle ) const;
308
309 int GetRadius() const;
310
317 void SetArcGeometry( const VECTOR2I& aStart, const VECTOR2I& aMid, const VECTOR2I& aEnd );
318
330 void SetCachedArcData( const VECTOR2I& aStart, const VECTOR2I& aMid, const VECTOR2I& aEnd,
331 const VECTOR2I& aCenter );
332
333 const std::vector<VECTOR2I>& GetBezierPoints() const { return m_bezierPoints; }
334
341 std::vector<VECTOR2I> GetPolyPoints() const;
342
346 int GetPointCount() const;
347
349 const SHAPE_POLY_SET& GetPolyShape() const;
350
354 bool IsPolyShapeValid() const;
355
356 void SetPolyShape( const SHAPE_POLY_SET& aShape )
357 {
358 GetPolyShape() = aShape;
359
360 for( int ii = 0; ii < GetPolyShape().OutlineCount(); ++ii )
361 {
362 if( GetPolyShape().HoleCount( ii ) )
363 {
365 break;
366 }
367 }
368 }
369
370 void SetPolyPoints( const std::vector<VECTOR2I>& aPoints );
371
380 void RebuildBezierToSegmentsPointsList( int aMaxError );
381
390 virtual std::vector<SHAPE*> MakeEffectiveShapes( bool aEdgeOnly = false ) const
391 {
392 return makeEffectiveShapes( aEdgeOnly );
393 }
394
395 virtual std::vector<SHAPE*> MakeEffectiveShapesForHitTesting() const
396 {
397 return makeEffectiveShapes( false, false, true );
398 }
399
400 void ShapeGetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList );
401
402 void SetRectangleHeight( const int& aHeight );
403
404 void SetRectangleWidth( const int& aWidth );
405
406 void SetRectangle( const long long int& aHeight, const long long int& aWidth );
407
408 void SetCornerRadius( int aRadius );
409 int GetCornerRadius() const;
410
411 bool IsClockwiseArc() const;
412
416 double GetLength() const;
417
418 int GetRectangleHeight() const;
419 int GetRectangleWidth() const;
420
421 virtual void UpdateHatching() const;
422
435 void TransformShapeToPolygon( SHAPE_POLY_SET& aBuffer, int aClearance, int aError,
436 ERROR_LOC aErrorLoc, bool ignoreLineWidth = false,
437 bool includeFill = false ) const;
438
439 int Compare( const EDA_SHAPE* aOther ) const;
440
441 double Similarity( const EDA_SHAPE& aOther ) const;
442
443 bool operator==( const EDA_SHAPE& aOther ) const;
444
445protected:
446 wxString getFriendlyName() const;
447
448 void setPosition( const VECTOR2I& aPos );
449 VECTOR2I getPosition() const;
450
451 virtual void setFilled( bool aFlag )
452 {
454 }
455
457 {
458 return SHAPE_POLY_SET();
459 }
460
461 void move( const VECTOR2I& aMoveVector );
462 void rotate( const VECTOR2I& aRotCentre, const EDA_ANGLE& aAngle );
463 void flip( const VECTOR2I& aCentre, FLIP_DIRECTION aFlipDirection );
464 void scale( double aScale );
465
466 virtual EDA_ANGLE getDrawRotation() const { return ANGLE_0; }
467
468 const BOX2I getBoundingBox() const;
469
470 void computeArcBBox( BOX2I& aBBox ) const;
471
472 bool hitTest( const VECTOR2I& aPosition, int aAccuracy = 0 ) const;
473 bool hitTest( const BOX2I& aRect, bool aContained, int aAccuracy = 0 ) const;
474 bool hitTest( const SHAPE_LINE_CHAIN& aPoly, bool aContained ) const;
475
476 const std::vector<VECTOR2I> buildBezierToSegmentsPointsList( int aMaxError ) const;
477
478 void beginEdit( const VECTOR2I& aStartPoint );
479 bool continueEdit( const VECTOR2I& aPosition );
480 void calcEdit( const VECTOR2I& aPosition );
481
487 void endEdit( bool aClosed = true );
488 void setEditState( int aState ) { m_editState = aState; }
489
490 virtual bool isMoving() const { return false; }
491
502 // fixme: move to shape_compound
503 std::vector<SHAPE*> makeEffectiveShapes( bool aEdgeOnly, bool aLineChainOnly = false,
504 bool aHittesting = false ) const;
505
506 virtual int getMaxError() const { return 100; }
507
508 // non-const for PCB_SHAPE
509 SHAPE_POLY_SET& hatching() const;
510 std::vector<SEG>& hatchLines() const;
511
512protected:
513 bool m_endsSwapped; // true if start/end were swapped e.g. SetArcAngleAndEnd
514 SHAPE_T m_shape; // Shape: line, Circle, Arc
515 STROKE_PARAMS m_stroke; // Line style, width, etc.
518
519 mutable std::unique_ptr<EDA_SHAPE_HATCH_CACHE_DATA> m_hatchingCache;
520 mutable bool m_hatchingDirty;
521
522 long long int m_rectangleHeight;
523 long long int m_rectangleWidth;
525
526 VECTOR2I m_start; // Line start point or Circle center
527 VECTOR2I m_end; // Line end point or Circle 3 o'clock point
528
529 VECTOR2I m_arcCenter; // Used only for Arcs: arc end point
530 ARC_MID m_arcMidData; // Used to store originating data
531
532 VECTOR2I m_bezierC1; // Bezier Control Point 1
533 VECTOR2I m_bezierC2; // Bezier Control Point 2
534
535 std::vector<VECTOR2I> m_bezierPoints;
536 mutable std::unique_ptr<SHAPE_POLY_SET> m_poly; // Stores the S_POLYGON shape
537
539 bool m_proxyItem; // A shape storing proxy information (ie: a pad
540 // number box, thermal spoke template, etc.)
541};
542
546
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:172
EDA_ANGLE GetArcAngle() const
SHAPE_T m_shape
Definition eda_shape.h:514
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:204
bool m_proxyItem
Definition eda_shape.h:539
int m_cornerRadius
Definition eda_shape.h:524
bool m_hatchingDirty
Definition eda_shape.h:520
bool m_endsSwapped
Definition eda_shape.h:513
const VECTOR2I & GetBezierC2() const
Definition eda_shape.h:271
void SetBezierC2(const VECTOR2I &aPt)
Definition eda_shape.h:270
void SetCenter(const VECTOR2I &aCenter)
VECTOR2I getCenter() const
int GetStartY() const
Definition eda_shape.h:187
void SetFillModeProp(UI_FILL_MODE)
int m_editState
Definition eda_shape.h:538
virtual int getMaxError() const
Definition eda_shape.h:506
virtual VECTOR2I GetTopLeft() const
Definition eda_shape.h:259
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:154
void SetCornerRadius(int aRadius)
long long int m_rectangleHeight
Definition eda_shape.h:522
std::unique_ptr< EDA_SHAPE_HATCH_CACHE_DATA > m_hatchingCache
Definition eda_shape.h:519
void SetEndY(int aY)
Definition eda_shape.h:239
virtual int GetEffectiveWidth() const
Definition eda_shape.h:170
std::vector< VECTOR2I > GetPolyPoints() const
Duplicate the polygon outlines into a flat list of VECTOR2I points.
COLOR4D GetLineColor() const
Definition eda_shape.h:178
EDA_SHAPE(EDA_SHAPE &&) noexcept=default
int GetEndX() const
Definition eda_shape.h:230
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:197
virtual std::vector< SHAPE * > MakeEffectiveShapes(bool aEdgeOnly=false) const
Make a set of SHAPE objects representing the EDA_SHAPE.
Definition eda_shape.h:390
SHAPE_POLY_SET & GetPolyShape()
void SetCenterY(int y)
Definition eda_shape.h:211
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:490
bool operator==(const EDA_SHAPE &aOther) const
int GetRadius() const
SHAPE_T GetShape() const
Definition eda_shape.h:181
void SetPolyShape(const SHAPE_POLY_SET &aShape)
Definition eda_shape.h:356
virtual VECTOR2I GetBotRight() const
Definition eda_shape.h:260
virtual void SetBottom(int val)
Definition eda_shape.h:265
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:136
virtual SHAPE_POLY_SET getHatchingKnockouts() const
Definition eda_shape.h:456
VECTOR2I m_arcCenter
Definition eda_shape.h:529
void SetCenterX(int x)
Definition eda_shape.h:218
virtual void SetFilled(bool aFlag)
Definition eda_shape.h:148
virtual void SetTop(int val)
Definition eda_shape.h:262
virtual bool IsFilledForHitTesting() const
Definition eda_shape.h:143
bool continueEdit(const VECTOR2I &aPosition)
wxString ShowShape() const
ARC_MID m_arcMidData
Definition eda_shape.h:530
void SetFillColor(const COLOR4D &aColor)
Definition eda_shape.h:166
int GetEndY() const
Definition eda_shape.h:229
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:246
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:171
bool IsSolidFill() const
Definition eda_shape.h:129
void flip(const VECTOR2I &aCentre, FLIP_DIRECTION aFlipDirection)
EDA_SHAPE(SHAPE_T aType, int aLineWidth, FILL_T aFill)
Definition eda_shape.cpp:54
std::vector< SEG > & hatchLines() const
void beginEdit(const VECTOR2I &aStartPoint)
VECTOR2I m_start
Definition eda_shape.h:526
int GetPointCount() const
const VECTOR2I & GetEnd() const
Return the ending point of the graphic.
Definition eda_shape.h:228
bool IsClosed() const
void SetRadius(int aX)
Definition eda_shape.h:253
void SetStart(const VECTOR2I &aStart)
Definition eda_shape.h:190
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:186
void SetLineColor(const COLOR4D &aColor)
Definition eda_shape.h:177
COLOR4D GetFillColor() const
Definition eda_shape.h:165
void SetRectangle(const long long int &aHeight, const long long int &aWidth)
void SetShape(SHAPE_T aShape)
Definition eda_shape.h:180
void SwapShape(EDA_SHAPE *aImage)
std::vector< VECTOR2I > GetRectCorners() const
std::vector< VECTOR2I > m_bezierPoints
Definition eda_shape.h:535
bool IsAnyFill() const
Definition eda_shape.h:124
void setPosition(const VECTOR2I &aPos)
virtual std::vector< SHAPE * > MakeEffectiveShapesForHitTesting() const
Definition eda_shape.h:395
virtual void setFilled(bool aFlag)
Definition eda_shape.h:451
const std::vector< VECTOR2I > & GetBezierPoints() const
Definition eda_shape.h:333
virtual bool IsProxyItem() const
Definition eda_shape.h:121
void computeArcBBox(BOX2I &aBBox) const
virtual void UpdateHatching() const
void SetEnd(const VECTOR2I &aEnd)
Definition eda_shape.h:232
bool EndsSwapped() const
Have the start and end points been swapped since they were set?
Definition eda_shape.h:294
void SetRectangleWidth(const int &aWidth)
void SetBezierC1(const VECTOR2I &aPt)
Definition eda_shape.h:267
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:263
double GetLength() const
wxString SHAPE_T_asString() const
int GetStartX() const
Definition eda_shape.h:188
double Similarity(const EDA_SHAPE &aOther) const
const VECTOR2I & GetBezierC1() const
Definition eda_shape.h:268
VECTOR2I m_end
Definition eda_shape.h:527
const BOX2I getBoundingBox() const
virtual EDA_ANGLE getDrawRotation() const
Definition eda_shape.h:466
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:169
VECTOR2I getPosition() const
bool IsClockwiseArc() const
STROKE_PARAMS m_stroke
Definition eda_shape.h:515
void SetHatchingDirty()
Definition eda_shape.h:159
void setEditState(int aState)
Definition eda_shape.h:488
void SetPolyPoints(const std::vector< VECTOR2I > &aPoints)
wxString getFriendlyName() const
EDA_SHAPE & operator=(const EDA_SHAPE &aOther)
VECTOR2I m_bezierC1
Definition eda_shape.h:532
FILL_T m_fill
Definition eda_shape.h:516
COLOR4D m_fillColor
Definition eda_shape.h:517
void SetWidth(int aWidth)
EDA_ANGLE GetSegmentAngle() const
virtual void SetRight(int val)
Definition eda_shape.h:264
int GetCornerRadius() const
void SetFillMode(FILL_T aFill)
std::unique_ptr< SHAPE_POLY_SET > m_poly
Definition eda_shape.h:536
virtual void SetIsProxyItem(bool aIsProxy=true)
Definition eda_shape.h:122
long long int m_rectangleWidth
Definition eda_shape.h:523
VECTOR2I m_bezierC2
Definition eda_shape.h:533
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:45
@ SEGMENT
Definition eda_shape.h:47
UI_FILL_MODE
Definition eda_shape.h:70
@ REVERSE_HATCH
Definition eda_shape.h:74
@ SOLID
Definition eda_shape.h:72
@ HATCH
Definition eda_shape.h:73
@ NONE
Definition eda_shape.h:71
@ CROSS_HATCH
Definition eda_shape.h:75
FILL_T
Definition eda_shape.h:58
@ FILLED_WITH_COLOR
Definition eda_shape.h:62
@ NO_FILL
Definition eda_shape.h:59
@ REVERSE_HATCH
Definition eda_shape.h:64
@ HATCH
Definition eda_shape.h:63
@ FILLED_WITH_BG_BODYCOLOR
Definition eda_shape.h:61
@ FILLED_SHAPE
Fill with object color.
Definition eda_shape.h:60
@ CROSS_HATCH
Definition eda_shape.h:65
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:81
VECTOR2I end
Definition eda_shape.h:84
VECTOR2I center
Definition eda_shape.h:85
VECTOR2I start
Definition eda_shape.h:83
VECTOR2I mid
Definition eda_shape.h:82
SHAPE_POLY_SET hatching
Definition eda_shape.h:91
std::vector< SEG > hatchLines
Definition eda_shape.h:92
VECTOR2< int32_t > VECTOR2I
Definition vector2d.h:687