26#ifndef __SHAPE_CIRCLE_H
27#define __SHAPE_CIRCLE_H
70 const BOX2I BBox(
int aClearance = 0 )
const override
77 bool Collide(
const SEG& aSeg,
int aClearance = 0,
int* aActual =
nullptr,
78 VECTOR2I* aLocation =
nullptr )
const override
84 if( dist_sq == 0 || dist_sq <
SEG::Square( minDist ) )
89 !pts.empty() && dist_sq == 0 )
100 *aActual = std::max( 0, (
int) sqrt( dist_sq ) -
m_circle.
Radius );
148 virtual const std::string
Format(
bool aCplusPlus =
true )
const override;
ERROR_LOC
When approximating an arc or circle, should the error be placed on the outside or inside of the curve...
Represent basic circle geometry with utility geometry functions.
VECTOR2I Center
Public to make access simpler.
int Radius
Public to make access simpler.
std::vector< VECTOR2I > Intersect(const CIRCLE &aCircle) const
Compute the intersection points between this circle and aCircle.
const VECTOR2I NearestPoint(const VECTOR2I &aP) const
Compute a point on the segment (this) that is closest to point aP.
static SEG::ecoord Square(int a)
bool IsSolid() const override
void Rotate(const EDA_ANGLE &aAngle, const VECTOR2I &aCenter={ 0, 0 }) override
const CIRCLE GetCircle() const
SHAPE_CIRCLE(const SHAPE_CIRCLE &aOther)
SHAPE_CIRCLE(const VECTOR2I &aCenter, int aRadius)
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 GetCenter() 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.
SHAPE_CIRCLE(const CIRCLE &aCircle)
const BOX2I BBox(int aClearance=0) const override
Compute a bounding box of the shape, with a margin of aClearance a collision.
SHAPE * Clone() const override
Return a dynamically allocated copy of the shape.
void SetRadius(int aRadius)
virtual const std::string Format(bool aCplusPlus=true) const override
SHAPE_CIRCLE & operator=(const SHAPE_CIRCLE &)=default
void Move(const VECTOR2I &aVector) override
void SetCenter(const VECTOR2I &aCenter)
Represent a set of closed polygons.
An abstract shape on 2D plane.
VECTOR2I::extended_type ecoord
void RotatePoint(int *pX, int *pY, const EDA_ANGLE &aAngle)
Calculate the new point of coord coord pX, pY, for a rotation center 0, 0.