72 const BOX2I BBox(
int aClearance = 0 )
const override;
74 bool Collide(
const SEG& aSeg,
int aClearance = 0,
int* aActual =
nullptr,
75 VECTOR2I* aLocation =
nullptr )
const override;
77 bool Collide(
const SHAPE* aShape,
int aClearance = 0,
int* aActual =
nullptr,
78 VECTOR2I* aLocation =
nullptr )
const override
98 const std::string
Format(
bool aCplusPlus =
true )
const override;
110 bool PointInside(
const VECTOR2I& aPt,
int aAccuracy = 0,
bool aUseBBoxCache =
false )
const override;
131 void sweepRange(
double& aStart,
double& aEnd )
const;
ERROR_LOC
When approximating an arc or circle, should the error be placed on the outside or inside of the curve...
Plain ellipse / elliptical-arc data.
VECTOR2I::extended_type ecoord
void SetRotation(const EDA_ANGLE &aAngle)
int GetMajorRadius() const
void updateCache()
Recompute cached sin/cos and inverse-radius-squared values.
SHAPE_LINE_CHAIN ConvertToPolyline(int aMaxError) const
Build a polyline approximation of the ellipse or arc.
const VECTOR2I & GetCenter() const
void SetMajorRadius(int aRadius)
ELLIPSE< int > m_ellipse
Wrapped geometric data (from geometry/ellipse.h)
bool isAngleInSweep(double aAngleRad) const
Return true if aAngleRad falls between StartAngle and EndAngle (counter-clockwise sweep).
SEG::ecoord SquaredDistance(const VECTOR2I &aP, bool aOutlineOnly=false) const override
double m_invMinorRSq
1 / MinorRadius ^ 2
void SetStartAngle(const EDA_ANGLE &aAngle)
const EDA_ANGLE & GetStartAngle() const
double m_cosRot
cos(Rotation)
const EDA_ANGLE & GetEndAngle() const
void TransformToPolygon(SHAPE_POLY_SET &aBuffer, int aError, ERROR_LOC aErrorLoc) const override
Fills a SHAPE_POLY_SET with a polygon representation of this shape.
bool PointInside(const VECTOR2I &aPt, int aAccuracy=0, bool aUseBBoxCache=false) const override
Check if point aP lies inside a closed shape.
const std::string Format(bool aCplusPlus=true) const override
Serialize the ellipse.
void Rotate(const EDA_ANGLE &aAngle, const VECTOR2I &aCenter={ 0, 0 }) override
const BOX2I BBox(int aClearance=0) const override
Compute a bounding box of the shape, with a margin of aClearance a collision.
void Mirror(const VECTOR2I &aRef, FLIP_DIRECTION aFlipDirection)
Mirror the ellipse across a horizontal or vertical axis passing through aRef.
void sweepRange(double &aStart, double &aEnd) const
Canonical CCW sweep in radians; aEnd >= aStart. Used by all sweep-aware paths.
void normalize()
If major < minor, swap them and add 90 degrees to rotation.
const EDA_ANGLE & GetRotation() const
~SHAPE_ELLIPSE() override=default
void SetCenter(const VECTOR2I &aCenter)
void SetMinorRadius(int aRadius)
double m_invMajorRSq
1 / MajorRadius ^ 2
double m_sinRot
sin(Rotation)
bool Collide(const SHAPE *aShape, int aClearance=0, int *aActual=nullptr, VECTOR2I *aLocation=nullptr) const override
void Move(const VECTOR2I &aVector) override
bool Collide(const SEG &aSeg, int aClearance=0, int *aActual=nullptr, VECTOR2I *aLocation=nullptr) const override
Check if the boundary of shape (this) lies closer to the segment aSeg than aClearance,...
SHAPE_ELLIPSE & operator=(const SHAPE_ELLIPSE &)=default
int GetMinorRadius() const
bool IsSolid() const override
bool m_isArc
true if open elliptical arc, false if closed ellipse
void SetEndAngle(const EDA_ANGLE &aAngle)
SHAPE_ELLIPSE(const SHAPE_ELLIPSE &aOther)=default
SHAPE * Clone() const override
Return a dynamically allocated copy of the shape.
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.
virtual bool Collide(const VECTOR2I &aP, int aClearance=0, int *aActual=nullptr, VECTOR2I *aLocation=nullptr) const
Check if the boundary of shape (this) lies closer to the point aP than aClearance,...
SHAPE(SHAPE_TYPE aType)
Create an empty shape of type aType.
VECTOR2< int32_t > VECTOR2I