|
Horizon
|
Public Member Functions | |
| SHAPE_ARC (const VECTOR2I &aArcCenter, const VECTOR2I &aArcStartPoint, double aCenterAngle, int aWidth=0) | |
| Construct and arc using center, start, angle. | |
| SHAPE_ARC (const VECTOR2I &aArcStart, const VECTOR2I &aArcMid, const VECTOR2I &aArcEnd, int aWidth) | |
| SHAPE_ARC (const SEG &aSegmentA, const SEG &aSegmentB, int aRadius, int aWidth=0) | |
| Build a SHAPE_ARC which is tangent to two segments and a given radius. | |
| SHAPE_ARC (const SHAPE_ARC &aOther) | |
| SHAPE * | Clone () const override |
| Return a dynamically allocated copy of the shape. | |
| SHAPE_ARC & | ConstructFromStartEndAngle (const VECTOR2I &aStart, const VECTOR2I &aEnd, double aAngle, double aWidth=0) |
| Construct this arc from the given start, end and angle. | |
| SHAPE_ARC & | ConstructFromStartEndCenter (const VECTOR2I &aStart, const VECTOR2I &aEnd, const VECTOR2I &aCenter, bool aClockwise=false, double aWidth=0) |
| Constructs this arc from the given start, end and center. | |
| const VECTOR2I & | GetP0 () const |
| const VECTOR2I & | GetP1 () const |
| const VECTOR2I & | GetArcMid () const |
| VECTOR2I | GetCenter () const |
| const BOX2I | BBox (int aClearance=0) const override |
| Compute a bounding box of the shape, with a margin of aClearance a collision. | |
| 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, indicating a collision. | |
| bool | Collide (const VECTOR2I &aP, int aClearance=0, int *aActual=nullptr, VECTOR2I *aLocation=nullptr) const override |
| Check if the boundary of shape (this) lies closer to the point aP than aClearance, indicating a collision. | |
| bool | Collide (const SHAPE *aShape, int aClearance=0, int *aActual=nullptr, VECTOR2I *aLocation=nullptr) const override |
| int | IntersectLine (const SEG &aSeg, std::vector< VECTOR2I > *aIpsBuffer) const |
| Find intersection points between this arc and aSeg, treating aSeg as an infinite line. | |
| int | Intersect (const SHAPE_ARC &aArc, std::vector< VECTOR2I > *aIpsBuffer) const |
| Find intersection points between this arc and aArc. | |
| bool | IsClockwise () const |
| void | SetWidth (int aWidth) |
| int | GetWidth () const |
| bool | IsSolid () const override |
| void | Move (const VECTOR2I &aVector) override |
| void | Rotate (double aAngle, const VECTOR2I &aCenter) override |
| Rotate the arc by a given angle about a point. | |
| void | Mirror (bool aX=true, bool aY=false, const VECTOR2I &aVector={ 0, 0 }) |
| void | Mirror (const SEG &axis) |
| void | Reverse () |
| SHAPE_ARC | Reversed () const |
| double | GetRadius () const |
| SEG | GetChord () const |
| double | GetCentralAngle () const |
| double | GetStartAngle () const |
| double | GetEndAngle () const |
| double | GetLength () const |
| const SHAPE_LINE_CHAIN | ConvertToPolyline (double aAccuracy=DefaultAccuracyForPCB(), double *aEffectiveAccuracy=nullptr) const |
| Construct a SHAPE_LINE_CHAIN of segments from a given arc. | |
| bool | operator== (SHAPE_ARC const &aArc) const |
Public Member Functions inherited from SHAPE | |
| SHAPE (SHAPE_TYPE aType) | |
| Create an empty shape of type aType. | |
| bool | IsNull () const |
| Return true if the shape is a null shape. | |
| virtual bool | Collide (const SHAPE *aShape, int aClearance, VECTOR2I *aMTV) const |
| Check if the boundary of shape (this) lies closer to the shape aShape than aClearance, indicating a collision. | |
| virtual VECTOR2I | Centre () const |
| Compute a center-of-mass of the shape. | |
| virtual bool | Parse (std::stringstream &aStream) |
| virtual const std::string | Format () const |
Public Member Functions inherited from SHAPE_BASE | |
| SHAPE_BASE (SHAPE_TYPE aType) | |
| Create an empty shape of type aType. | |
| SHAPE_TYPE | Type () const |
| Return the type of the shape. | |
| virtual bool | HasIndexableSubshapes () const |
| virtual size_t | GetIndexableSubshapeCount () const |
| virtual void | GetIndexableSubshapes (std::vector< SHAPE * > &aSubshapes) |
Static Public Member Functions | |
| static double | DefaultAccuracyForPCB () |
Additional Inherited Members | |
Static Public Attributes inherited from SHAPE | |
| static const int | MIN_PRECISION_IU = 4 |
| This is the minimum precision for all the points in a shape. | |
Protected Types inherited from SHAPE | |
| typedef VECTOR2I::extended_type | ecoord |
Protected Attributes inherited from SHAPE_BASE | |
| SHAPE_TYPE | m_type |
| < type of our shape | |
| SHAPE_ARC::SHAPE_ARC | ( | const VECTOR2I & | aArcCenter, |
| const VECTOR2I & | aArcStartPoint, | ||
| double | aCenterAngle, | ||
| int | aWidth = 0 |
||
| ) |
Construct and arc using center, start, angle.
Center and angle are used to calculate the mid and end points of the arc, and are not stored.
| aArcCenter | is the arc center. |
| aArcStartPoint | is the arc start point. |
| aCenterAngle | is the arc angle in degrees. |
| aWidth | is the arc line thickness. |
| SHAPE_ARC::SHAPE_ARC | ( | const VECTOR2I & | aArcStart, |
| const VECTOR2I & | aArcMid, | ||
| const VECTOR2I & | aArcEnd, | ||
| int | aWidth | ||
| ) |
| aArcStart | is the arc start point. |
| aArcEnd | is the arc end point. |
| aArcMid | is the arc mid point. |
| aWidth | is the arc line thickness. |
Build a SHAPE_ARC which is tangent to two segments and a given radius.
| aSegmentA | is the first segment |
| aSegmentB | is the second segment |
| aRadius | is the arc radius |
| aWidth | is the arc line thickness |
|
overridevirtual |
Compute a bounding box of the shape, with a margin of aClearance a collision.
| aClearance | how much the bounding box is expanded wrs to the minimum enclosing rectangle for the shape. |
Implements SHAPE.
|
inlineoverridevirtual |
Return a dynamically allocated copy of the shape.
| copy | of the shape |
Reimplemented from SHAPE.
|
overridevirtual |
Check if the boundary of shape (this) lies closer to the segment aSeg than aClearance, indicating a collision.
| aActual | [out] an optional pointer to an int to be updated with the actual distance int the event of a collision. |
| aLocation | [out] an option pointer to a point to store a nearby location in the event of a collision. |
Implements SHAPE.
|
inlineoverridevirtual |
Reimplemented from SHAPE.
|
overridevirtual |
Check if the boundary of shape (this) lies closer to the point aP than aClearance, indicating a collision.
| aActual | [out] an optional pointer to an int to store the actual distance in the event of a collision. |
| aLocation | [out] an option pointer to a point to store a nearby location in the event of a collision. |
Reimplemented from SHAPE.
| SHAPE_ARC & SHAPE_ARC::ConstructFromStartEndAngle | ( | const VECTOR2I & | aStart, |
| const VECTOR2I & | aEnd, | ||
| double | aAngle, | ||
| double | aWidth = 0 |
||
| ) |
Construct this arc from the given start, end and angle.
| aStart | is the arc starting point |
| aEnd | is the arc endpoint |
| aAngle | is the arc included angle |
| aWidth | is the arc line thickness |
| SHAPE_ARC & SHAPE_ARC::ConstructFromStartEndCenter | ( | const VECTOR2I & | aStart, |
| const VECTOR2I & | aEnd, | ||
| const VECTOR2I & | aCenter, | ||
| bool | aClockwise = false, |
||
| double | aWidth = 0 |
||
| ) |
Constructs this arc from the given start, end and center.
| aStart | is the arc starting point |
| aEnd | is the arc endpoint |
| aCenter | is the arc center |
| aClockwise | determines which of the two solutions to construct |
| aWidth | is the arc line thickness |
| const SHAPE_LINE_CHAIN SHAPE_ARC::ConvertToPolyline | ( | double | aAccuracy = DefaultAccuracyForPCB(), |
| double * | aEffectiveAccuracy = nullptr |
||
| ) | const |
Construct a SHAPE_LINE_CHAIN of segments from a given arc.
| aAccuracy | maximum divergence from true arc given in internal units. |
| aEffectiveAccuracy | is the actual divergence from true arc given. the approximation error is between -aEffectiveAccuracy/2 and +aEffectiveAccuracy/2 in internal units |
|
inlinestatic |
| double SHAPE_ARC::GetCentralAngle | ( | ) | const |
| double SHAPE_ARC::GetEndAngle | ( | ) | const |
| double SHAPE_ARC::GetLength | ( | ) | const |
| double SHAPE_ARC::GetStartAngle | ( | ) | const |
Find intersection points between this arc and aArc.
Ignores arc width.
| aSeg | |
| aIpsBuffer | Buffer to store the resulting intersection points (if any) |
Find intersection points between this arc and aSeg, treating aSeg as an infinite line.
Ignores arc width.
| aSeg | Line to intersect against (treated as an infinite line) |
| aIpsBuffer | Buffer to store the resulting intersection points (if any) |
|
inlineoverridevirtual |
Implements SHAPE.
|
overridevirtual |
Rotate the arc by a given angle about a point.
| aCenter | is the rotation center. |
| aAngle | rotation angle in radians. |
Implements SHAPE.