KiCad PCB EDA Suite
|
Class that represents an oval shape (rectangle with semicircular end caps) More...
#include <oval.h>
Public Member Functions | |
OVAL (const SEG &aSeg, int aWidth) | |
Create an oval from the segment joining the centers of the semicircles and the diameter of the semicircles. | |
OVAL (const VECTOR2I &aOverallSize, const VECTOR2I &aCenter, const EDA_ANGLE &aRotation) | |
Create an oval from the overall size, the center of the oval, and the rotation. | |
BOX2I | BBox (int aClearance) const |
Get the bounding box of the oval. | |
int | GetWidth () const |
Get the width of the oval (diameter of the semicircles) | |
int | GetLength () const |
Get the overall length of the oval from endcap tip to endcap tip. | |
int | GetSideLength () const |
Get the side length of the oval (=length between the centers of the semicircles) | |
VECTOR2I | GetCenter () const |
Get the center point of the oval. | |
const SEG & | GetSegment () const |
Get the central segment of the oval. | |
EDA_ANGLE | GetAngle () const |
Get the angle of the oval's central segment. | |
Private Attributes | |
SEG | m_seg |
int | m_width |
Class that represents an oval shape (rectangle with semicircular end caps)
This is not a full-blown SHAPE (yet), but can be used for some simple purposes, as well as for type-based logic.
OVAL::OVAL | ( | const SEG & | aSeg, |
int | aWidth | ||
) |
Create an oval from the overall size, the center of the oval, and the rotation.
The shorter dimension is the width of the semicircles.
Definition at line 41 of file oval.cpp.
References m_seg, m_width, RotatePoint(), VECTOR2< T >::x, and VECTOR2< T >::y.
BOX2I OVAL::BBox | ( | int | aClearance | ) | const |
Get the bounding box of the oval.
Definition at line 58 of file oval.cpp.
References SEG::A, SEG::B, BOX2< VECTOR2I >::ByCorners(), LexicographicalMax(), LexicographicalMin(), m_seg, and m_width.
|
inline |
|
inline |
Get the center point of the oval.
Definition at line 83 of file oval.h.
References SEG::Center(), and m_seg.
Referenced by KIGEOM::GetOvalKeyPoints().
|
inline |
Get the overall length of the oval from endcap tip to endcap tip.
Definition at line 73 of file oval.h.
References SEG::Length(), m_seg, and m_width.
Referenced by KIGEOM::GetOvalKeyPoints().
|
inline |
Get the central segment of the oval.
(Endpoint are the centers of the semicircles)
Definition at line 90 of file oval.h.
References m_seg.
Referenced by KIGEOM::ConvertToChain().
|
inline |
Get the side length of the oval (=length between the centers of the semicircles)
Definition at line 78 of file oval.h.
References SEG::Length(), and m_seg.
|
inline |
Get the width of the oval (diameter of the semicircles)
Definition at line 68 of file oval.h.
References m_width.
Referenced by KIGEOM::ConvertToChain(), and KIGEOM::GetOvalKeyPoints().
|
private |
Definition at line 100 of file oval.h.
Referenced by BBox(), GetAngle(), GetCenter(), GetLength(), GetSegment(), GetSideLength(), and OVAL().
|
private |
Definition at line 101 of file oval.h.
Referenced by BBox(), GetLength(), GetWidth(), and OVAL().