|
KiCad PCB EDA Suite
|
Plain ellipse / elliptical-arc data. More...
#include <ellipse.h>
Public Member Functions | |
| ELLIPSE () | |
| ELLIPSE (const VECTOR2< NumericType > &aCenter, NumericType aMajorRadius, NumericType aMinorRadius, EDA_ANGLE aRotation, EDA_ANGLE aStartAngle=ANGLE_0, EDA_ANGLE aEndAngle=FULL_CIRCLE) | |
| Constructs an ellipse or elliptical arc. | |
| ELLIPSE (const VECTOR2< NumericType > &aCenter, const VECTOR2< NumericType > &aMajor, double aRatio, EDA_ANGLE aStartAngle=ANGLE_0, EDA_ANGLE aEndAngle=FULL_CIRCLE) | |
| Constructs a DXF-style ellipse or elliptical arc, where the major axis is given by a point rather than a radius, and therefore defines not only the major radius but also the rotation of the ellipse. | |
| void | Mirror (const VECTOR2< NumericType > &aRef, FLIP_DIRECTION aFlipDirection) |
| Mirror the ellipse along a horizontal or vertical axis passing through aRef. | |
| EDA_ANGLE | GetSubtendedAngle () const |
| Get the subtended angle of the ellipse or elliptical arc at the center. | |
| VECTOR2< NumericType > | GetPointAtAngle (EDA_ANGLE angle) const |
| Get the point on the ellipse at a given angle. | |
| VECTOR2< NumericType > | GetArcStartPoint () const |
| Get the point on the ellipse at the start angle of the arc. | |
| VECTOR2< NumericType > | GetArcEndPoint () const |
| Get the point on the ellipse at the end angle of the arc. | |
| EDA_ANGLE | GetAngleAtPoint (const VECTOR2< NumericType > &aPt) const |
| Get the parametric angle of a point on the ellipse. | |
Public Attributes | |
| VECTOR2< NumericType > | Center |
| NumericType | MajorRadius |
| NumericType | MinorRadius |
| EDA_ANGLE | Rotation |
| EDA_ANGLE | StartAngle |
| EDA_ANGLE | EndAngle |
Plain ellipse / elliptical-arc data.
Used by SHAPE_ELLIPSE, by EDA_SHAPE's native ellipse storage, and by importers that need to round-trip ellipses.
Definition at line 34 of file ellipse.h.
References MajorRadius, and MinorRadius.
| ELLIPSE< NumericType >::ELLIPSE | ( | const VECTOR2< NumericType > & | aCenter, |
| NumericType | aMajorRadius, | ||
| NumericType | aMinorRadius, | ||
| EDA_ANGLE | aRotation, | ||
| EDA_ANGLE | aStartAngle = ANGLE_0, | ||
| EDA_ANGLE | aEndAngle = FULL_CIRCLE ) |
Constructs an ellipse or elliptical arc.
The ellipse sweeps from aStartAngle to aEndAngle in a counter-clockwise direction.
| aCenter | is the center point of the ellipse. |
| aMajorRadius | is the radius of the "x-axis" dimension of the ellipse. |
| aMinorRadius | is the radius of the "y-axis" dimension of the ellipse. |
| aRotation | is the angle of the ellipse "x-axis" relative to world x-axis. |
| aStartAngle | is the starting angle of the elliptical arc. |
| aEndAngle | is the ending angle of the elliptical arc. |
Definition at line 26 of file ellipse.cpp.
References Center, EndAngle, MajorRadius, MinorRadius, Rotation, and StartAngle.
| ELLIPSE< NumericType >::ELLIPSE | ( | const VECTOR2< NumericType > & | aCenter, |
| const VECTOR2< NumericType > & | aMajor, | ||
| double | aRatio, | ||
| EDA_ANGLE | aStartAngle = ANGLE_0, | ||
| EDA_ANGLE | aEndAngle = FULL_CIRCLE ) |
Constructs a DXF-style ellipse or elliptical arc, where the major axis is given by a point rather than a radius, and therefore defines not only the major radius but also the rotation of the ellipse.
| aCenter | is the center point of the ellipse. |
| aMajor | is the endpoint of the major axis, relative to the center. |
| aRatio | is the ratio of the minor axis length to the major axis length. |
| aStartAngle | is the starting angle of the elliptical arc. |
| aEndAngle | is the ending angle of the elliptical arc. |
Definition at line 40 of file ellipse.cpp.
References Center, EndAngle, VECTOR2< T >::EuclideanNorm(), MajorRadius, MinorRadius, RADIANS_T, Rotation, StartAngle, VECTOR2< T >::x, and VECTOR2< T >::y.
| EDA_ANGLE ELLIPSE< NumericType >::GetAngleAtPoint | ( | const VECTOR2< NumericType > & | aPt | ) | const |
Get the parametric angle of a point on the ellipse.
The angle is measured in the ellipse's local coordinate system, where the x-axis is the major axis and the y-axis is the minor axis.
Definition at line 109 of file ellipse.cpp.
References Center, MajorRadius, MinorRadius, RADIANS_T, Rotation, VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by EDA_ELLIPSE_POINT_EDIT_BEHAVIOR::parametricAngleOf(), KIGFX::PREVIEW::ELLIPSE_GEOM_MANAGER::setEndAngle(), and KIGFX::PREVIEW::ELLIPSE_GEOM_MANAGER::setStartAngle().
|
inline |
Get the point on the ellipse at the end angle of the arc.
Definition at line 93 of file ellipse.h.
References EndAngle, and GetPointAtAngle().
Referenced by KIGFX::PREVIEW::ELLIPSE_ASSISTANT::ViewDraw().
|
inline |
Get the point on the ellipse at the start angle of the arc.
Definition at line 88 of file ellipse.h.
References GetPointAtAngle(), and StartAngle.
Referenced by KIGFX::PREVIEW::ELLIPSE_ASSISTANT::ViewDraw().
| VECTOR2< NumericType > ELLIPSE< NumericType >::GetPointAtAngle | ( | EDA_ANGLE | angle | ) | const |
Get the point on the ellipse at a given angle.
The angle is measured in the ellipse's local coordinate system, where the x-axis is the major axis and the y-axis is the minor axis.
Definition at line 90 of file ellipse.cpp.
References EDA_ANGLE::AsRadians(), MajorRadius, MinorRadius, and Rotation.
Referenced by EDA_ELLIPSE_POINT_EDIT_BEHAVIOR::evaluateAt(), GetArcEndPoint(), GetArcStartPoint(), EDA_ELLIPSE_POINT_EDIT_BEHAVIOR::MakePoints(), EDA_ELLIPSE_POINT_EDIT_BEHAVIOR::UpdatePoints(), and KIGFX::PREVIEW::ELLIPSE_ASSISTANT::ViewDraw().
Get the subtended angle of the ellipse or elliptical arc at the center.
Definition at line 82 of file ellipse.cpp.
Referenced by KIGFX::PREVIEW::ELLIPSE_ASSISTANT::ViewDraw().
| void ELLIPSE< NumericType >::Mirror | ( | const VECTOR2< NumericType > & | aRef, |
| FLIP_DIRECTION | aFlipDirection ) |
Mirror the ellipse along a horizontal or vertical axis passing through aRef.
Definition at line 54 of file ellipse.cpp.
References Center, EndAngle, LEFT_RIGHT, Rotation, StartAngle, VECTOR2< T >::x, and VECTOR2< T >::y.
Definition at line 101 of file ellipse.h.
Referenced by ELLIPSE_ARC_DRAW_BEHAVIOR::ApplyToShape(), EDA_SHAPE::Compare(), KIGFX::PREVIEW::DRAW_CONTEXT::DrawEllipse(), ELLIPSE(), ELLIPSE(), GetAngleAtPoint(), EDA_ELLIPSE_POINT_EDIT_BEHAVIOR::MakePoints(), Mirror(), EDA_SHAPE::operator==(), TransformEllipseToBeziers(), EDA_ELLIPSE_POINT_EDIT_BEHAVIOR::UpdatePoints(), and KIGFX::PREVIEW::ELLIPSE_ASSISTANT::ViewDraw().
Definition at line 106 of file ellipse.h.
Referenced by ELLIPSE_ARC_DRAW_BEHAVIOR::ApplyToShape(), EDA_SHAPE::Compare(), ELLIPSE(), ELLIPSE(), GetArcEndPoint(), Mirror(), EDA_SHAPE::operator==(), TransformEllipseToBeziers(), and KIGFX::PREVIEW::ELLIPSE_ASSISTANT::ViewDraw().
| NumericType ELLIPSE< NumericType >::MajorRadius |
Definition at line 102 of file ellipse.h.
Referenced by ELLIPSE_ARC_DRAW_BEHAVIOR::ApplyToShape(), EDA_SHAPE::Compare(), KIGFX::PREVIEW::DRAW_CONTEXT::DrawEllipse(), ELLIPSE(), ELLIPSE(), ELLIPSE(), GetAngleAtPoint(), GetPointAtAngle(), EDA_SHAPE::operator==(), and TransformEllipseToBeziers().
| NumericType ELLIPSE< NumericType >::MinorRadius |
Definition at line 103 of file ellipse.h.
Referenced by ELLIPSE_ARC_DRAW_BEHAVIOR::ApplyToShape(), EDA_SHAPE::Compare(), KIGFX::PREVIEW::DRAW_CONTEXT::DrawEllipse(), ELLIPSE(), ELLIPSE(), ELLIPSE(), GetAngleAtPoint(), GetPointAtAngle(), EDA_SHAPE::operator==(), and TransformEllipseToBeziers().
Definition at line 104 of file ellipse.h.
Referenced by ELLIPSE_ARC_DRAW_BEHAVIOR::ApplyToShape(), EDA_SHAPE::Compare(), KIGFX::PREVIEW::DRAW_CONTEXT::DrawEllipse(), ELLIPSE(), ELLIPSE(), GetAngleAtPoint(), GetPointAtAngle(), Mirror(), EDA_SHAPE::operator==(), and TransformEllipseToBeziers().
Definition at line 105 of file ellipse.h.
Referenced by ELLIPSE_ARC_DRAW_BEHAVIOR::ApplyToShape(), EDA_SHAPE::Compare(), ELLIPSE(), ELLIPSE(), GetArcStartPoint(), Mirror(), EDA_SHAPE::operator==(), and TransformEllipseToBeziers().