26 #ifndef __SHAPE_CIRCLE_H 27 #define __SHAPE_CIRCLE_H 69 const BOX2I BBox(
int aClearance = 0 )
const override 76 bool Collide(
const SEG& aSeg,
int aClearance = 0,
int* aActual =
nullptr,
77 VECTOR2I* aLocation =
nullptr )
const override 83 if( dist_sq == 0 || dist_sq <
SEG::Square( minDist ) )
void SetCenter(const VECTOR2I &aCenter)
SHAPE_CIRCLE(const SHAPE_CIRCLE &aOther)
void Rotate(double 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.
const VECTOR2I GetCenter() const
static SEG::ecoord Square(int a)
void Move(const VECTOR2I &aVector) override
bool IsSolid() const 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,...
const VECTOR2I NearestPoint(const VECTOR2I &aP) const
Compute a point on the segment (this) that is closest to point aP.
SHAPE_CIRCLE & operator=(const SHAPE_CIRCLE &)=default
int Radius
Public to make access simpler.
An abstract shape on 2D plane.
Represent basic circle geometry with utility geometry functions.
SHAPE * Clone() const override
Return a dynamically allocated copy of the shape.
SHAPE_CIRCLE(const VECTOR2I &aCenter, int aRadius)
VECTOR2< T > Rotate(double aAngle) const
Rotate the vector by a given angle.
SHAPE_CIRCLE(const CIRCLE &aCircle)
void SetRadius(int aRadius)
VECTOR2I::extended_type ecoord
VECTOR2I Center
Public to make access simpler.
const CIRCLE GetCircle() const