36        return lineChain.
Collide( aSeg, aClearance, aActual, aLocation );
 
   72    for( 
int i = 0; i < 4; i++ )
 
   74        SEG side( corners[i], corners[ i + 1] );
 
   77        if( dist_sq < closest_dist_sq )
 
   84            closest_dist_sq = dist_sq;
 
   86        else if( aLocation && dist_sq == closest_dist_sq )
 
   90            if( ( near - aSeg.
A ).SquaredEuclideanNorm()
 
   91                < ( nearest - aSeg.
A ).SquaredEuclideanNorm() )
 
   98    if( closest_dist_sq == 0 || closest_dist_sq < 
SEG::Square( aClearance ) )
 
  101            *aActual = sqrt( closest_dist_sq );
 
  104            *aLocation = nearest;
 
 
  114    std::stringstream ss;
 
  116    ss << 
"SHAPE_RECT( ";
 
 
  160    return std::move( buffer.
Outline( 0 ) );
 
 
ERROR_LOC
When approximating an arc or circle, should the error be placed on the outside or inside of the curve...
 
constexpr bool Contains(const Vec &aPoint) const
 
A round rectangle shape, based on a rectangle and a radius.
 
void TransformToPolygon(SHAPE_POLY_SET &aBuffer, int aMaxError) const
Get the polygonal representation of the roundrect.
 
ecoord SquaredDistance(const SEG &aSeg) const
 
VECTOR2I::extended_type ecoord
 
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)
 
static int DefaultAccuracyForPCB()
 
Represent a polyline containing arcs as well as line segments: A chain of connected line and/or arc s...
 
void SetClosed(bool aClosed)
Mark the line chain as closed (i.e.
 
virtual bool Collide(const VECTOR2I &aP, int aClearance=0, int *aActual=nullptr, VECTOR2I *aLocation=nullptr) const override
Check if point aP lies closer to us than aClearance.
 
void Append(int aX, int aY, bool aAllowDuplication=false)
Append a new point at the end of the line chain.
 
Represent a set of closed polygons.
 
SHAPE_LINE_CHAIN & Outline(int aIndex)
Return the reference to aIndex-th outline in the set.
 
int NewOutline()
Creates a new empty polygon in the set and returns its index.
 
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.
 
virtual const std::string Format(bool aCplusPlus=true) const override
 
bool Collide(const SHAPE *aShape, int aClearance, VECTOR2I *aMTV) const override
Check if the boundary of shape (this) lies closer to the shape aShape than aClearance,...
 
VECTOR2I m_p0
Top-left corner.
 
const SHAPE_LINE_CHAIN Outline() const
 
void Normalize()
Ensure that the height and width are positive.
 
const BOX2I BBox(int aClearance=0) const override
Compute a bounding box of the shape, with a margin of aClearance a collision.
 
int m_radius
Corner radius.
 
static constexpr extended_type ECOORD_MAX
 
VECTOR2< int32_t > VECTOR2I