KiCad PCB EDA Suite
Loading...
Searching...
No Matches
SHAPE_ARC Class Reference

#include <shape_arc.h>

Inheritance diagram for SHAPE_ARC:
SHAPE SHAPE_BASE

Public Member Functions

 SHAPE_ARC ()
 
 SHAPE_ARC (const VECTOR2I &aArcCenter, const VECTOR2I &aArcStartPoint, const EDA_ANGLE &aCenterAngle, int aWidth=0)
 Construct and arc using center, start, angle.
 
 SHAPE_ARC (const VECTOR2I &aArcStart, const VECTOR2I &aArcMid, const VECTOR2I &aArcEnd, int aWidth)
 
 SHAPE_ARC (const SEG &aSegmentA, const SEG &aSegmentB, int aRadius, int aWidth=0)
 Build a SHAPE_ARC which is tangent to two segments and a given radius.
 
 SHAPE_ARC (const SHAPE_ARC &aOther)
 
virtual ~SHAPE_ARC ()
 
SHAPEClone () const override
 Return a dynamically allocated copy of the shape.
 
SHAPE_ARCConstructFromStartEndAngle (const VECTOR2I &aStart, const VECTOR2I &aEnd, const EDA_ANGLE &aAngle, double aWidth=0)
 Construct this arc from the given start, end and angle.
 
SHAPE_ARCConstructFromStartEndCenter (const VECTOR2I &aStart, const VECTOR2I &aEnd, const VECTOR2I &aCenter, bool aClockwise=false, double aWidth=0)
 Constructs this arc from the given start, end and center.
 
const VECTOR2IGetP0 () const
 
const VECTOR2IGetP1 () const
 
const VECTOR2IGetArcMid () const
 
const VECTOR2IGetCenter () const
 
const BOX2I BBox (int aClearance=0) const override
 Compute a bounding box of the shape, with a margin of aClearance a collision.
 
VECTOR2I NearestPoint (const VECTOR2I &aP) const
 
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, indicating a collision.
 
bool Collide (const VECTOR2I &aP, int aClearance=0, int *aActual=nullptr, VECTOR2I *aLocation=nullptr) const override
 Check if the boundary of shape (this) lies closer to the point aP than aClearance, indicating a collision.
 
bool Collide (const SHAPE *aShape, int aClearance=0, int *aActual=nullptr, VECTOR2I *aLocation=nullptr) const override
 
int IntersectLine (const SEG &aSeg, std::vector< VECTOR2I > *aIpsBuffer) const
 Find intersection points between this arc and aSeg, treating aSeg as an infinite line.
 
int Intersect (const CIRCLE &aArc, std::vector< VECTOR2I > *aIpsBuffer) const
 Find intersection points between this arc and a CIRCLE.
 
int Intersect (const SHAPE_ARC &aArc, std::vector< VECTOR2I > *aIpsBuffer) const
 Find intersection points between this arc and another arc.
 
void SetWidth (int aWidth)
 
int GetWidth () const
 
bool IsSolid () const override
 
void Move (const VECTOR2I &aVector) override
 
void Rotate (const EDA_ANGLE &aAngle, const VECTOR2I &aCenter) override
 Rotate the arc by a given angle about a point.
 
void Mirror (const VECTOR2I &aRef, FLIP_DIRECTION aFlipDirection)
 
void Mirror (const SEG &axis)
 
void Reverse ()
 
SHAPE_ARC Reversed () const
 
double GetRadius () const
 
SEG GetChord () const
 
EDA_ANGLE GetCentralAngle () const
 
EDA_ANGLE GetStartAngle () const
 
EDA_ANGLE GetEndAngle () const
 
double GetLength () const
 
const SHAPE_LINE_CHAIN ConvertToPolyline (double aAccuracy=DefaultAccuracyForPCB(), double *aEffectiveAccuracy=nullptr) const
 Construct a SHAPE_LINE_CHAIN of segments from a given arc.
 
bool operator== (SHAPE_ARC const &aArc) 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.
 
bool IsCCW () const
 
bool IsClockwise () const
 
int GetClearance (const SHAPE *aOther) const
 Return the actual minimum distance between two shapes.
 
bool IsNull () const
 Return true if the shape is a null shape.
 
virtual bool Collide (const SHAPE *aShape, int aClearance, VECTOR2I *aMTV) const
 Check if the boundary of shape (this) lies closer to the shape aShape than aClearance, indicating a collision.
 
virtual VECTOR2I Centre () const
 Compute a center-of-mass of the shape.
 
virtual int Distance (const VECTOR2I &aP) const
 Returns the minimum distance from a given point to this shape.
 
virtual SEG::ecoord SquaredDistance (const VECTOR2I &aP, bool aOutlineOnly=false) const
 
virtual bool PointInside (const VECTOR2I &aPt, int aAccuracy=0, bool aUseBBoxCache=false) const
 Check if point aP lies inside a closed shape.
 
virtual bool Parse (std::stringstream &aStream)
 
virtual const std::string Format (bool aCplusPlus=true) const
 
FACETNewFacet ()
 
SGNODECalcShape (SGNODE *aParent, SGNODE *aColor, WRL1_ORDER aVertexOrder, float aCreaseLimit=0.74317, bool isVRML2=false)
 
SHAPE_TYPE Type () const
 Return the type of the shape.
 
wxString TypeName () const
 
virtual bool HasIndexableSubshapes () const
 
virtual size_t GetIndexableSubshapeCount () const
 
virtual void GetIndexableSubshapes (std::vector< const SHAPE * > &aSubshapes) const
 

Static Public Member Functions

static double DefaultAccuracyForPCB ()
 

Static Public Attributes

static const int MIN_PRECISION_IU = 4
 This is the minimum precision for all the points in a shape.
 

Protected Types

typedef VECTOR2I::extended_type ecoord
 

Protected Attributes

SHAPE_TYPE m_type
 < type of our shape
 

Private Member Functions

void update_values ()
 
bool sliceContainsPoint (const VECTOR2I &p) const
 

Private Attributes

VECTOR2I m_start
 
VECTOR2I m_mid
 
VECTOR2I m_end
 
int m_width
 
BOX2I m_bbox
 
VECTOR2I m_center
 
double m_radius
 
std::list< FACET * > facets
 

Detailed Description

Definition at line 37 of file shape_arc.h.

Member Typedef Documentation

◆ ecoord

typedef VECTOR2I::extended_type SHAPE::ecoord
protectedinherited

Definition at line 284 of file shape.h.

Constructor & Destructor Documentation

◆ SHAPE_ARC() [1/5]

SHAPE_ARC::SHAPE_ARC ( )
inline

Definition at line 41 of file shape_arc.h.

Referenced by Clone(), and Reversed().

◆ SHAPE_ARC() [2/5]

SHAPE_ARC::SHAPE_ARC ( const VECTOR2I aArcCenter,
const VECTOR2I aArcStartPoint,
const EDA_ANGLE aCenterAngle,
int  aWidth = 0 
)

Construct and arc using center, start, angle.

Center and angle are used to calculate the mid and end points of the arc, and are not stored.

Parameters
aArcCenteris the arc center.
aArcStartPointis the arc start point.
aCenterAngleis the arc angle.
aWidthis the arc line thickness.

Definition at line 44 of file shape_arc.cpp.

References KiROUND(), m_end, m_mid, m_start, RotatePoint(), update_values(), VECTOR2< T >::x, and VECTOR2< T >::y.

◆ SHAPE_ARC() [3/5]

SHAPE_ARC::SHAPE_ARC ( const VECTOR2I aArcStart,
const VECTOR2I aArcMid,
const VECTOR2I aArcEnd,
int  aWidth 
)
Parameters
aArcStartis the arc start point.
aArcEndis the arc end point.
aArcMidis the arc mid point.
aWidthis the arc line thickness.

Definition at line 65 of file shape_arc.cpp.

References update_values().

◆ SHAPE_ARC() [4/5]

SHAPE_ARC::SHAPE_ARC ( const SEG aSegmentA,
const SEG aSegmentB,
int  aRadius,
int  aWidth = 0 
)

Build a SHAPE_ARC which is tangent to two segments and a given radius.

Parameters
aSegmentAis the first segment
aSegmentBis the second segment
aRadiusis the arc radius
aWidthis the arc line thickness

Definition at line 77 of file shape_arc.cpp.

References SEG::A, ANGLE_90, EDA_ANGLE::AsRadians(), SEG::B, SEG::Center(), EDA_ANGLE::Cos(), VECTOR2< T >::EuclideanNorm(), SEG::Intersect(), KiROUND(), SEG::Length(), SEG::LineProject(), m_end, m_mid, m_start, m_width, RotatePoint(), EDA_ANGLE::Sin(), update_values(), VECTOR2< T >::x, and VECTOR2< T >::y.

◆ SHAPE_ARC() [5/5]

SHAPE_ARC::SHAPE_ARC ( const SHAPE_ARC aOther)

Definition at line 181 of file shape_arc.cpp.

References m_bbox, m_center, m_end, m_mid, m_radius, m_start, and m_width.

◆ ~SHAPE_ARC()

virtual SHAPE_ARC::~SHAPE_ARC ( )
inlinevirtual

Definition at line 82 of file shape_arc.h.

Member Function Documentation

◆ BBox()

const BOX2I SHAPE_ARC::BBox ( int  aClearance = 0) const
overridevirtual

Compute a bounding box of the shape, with a margin of aClearance a collision.

Parameters
aClearancehow much the bounding box is expanded wrs to the minimum enclosing rectangle for the shape.
Returns
the bounding box.

Implements SHAPE.

Definition at line 403 of file shape_arc.cpp.

References BOX2< Vec >::Inflate(), KiROUND(), m_bbox, and m_width.

Referenced by BOOST_AUTO_TEST_CASE(), CheckArcGeom(), Collide(), drawShapes(), GERBER_DRAW_ITEM::GetBoundingBox(), and playground_main_func().

◆ CalcShape()

◆ Centre()

virtual VECTOR2I SHAPE::Centre ( ) const
inlinevirtualinherited

Compute a center-of-mass of the shape.

Returns
the center-of-mass point

Definition at line 232 of file shape.h.

References SHAPE::BBox(), and BOX2< Vec >::Centre().

Referenced by PNS::TOPOLOGY::AssembleDiffPair(), Collide(), SCH_EASYEDA_PARSER::ParseSchematic(), and pickSegment().

◆ Clone()

SHAPE * SHAPE_ARC::Clone ( ) const
inlineoverridevirtual

Return a dynamically allocated copy of the shape.

Return values
copyof the shape

Reimplemented from SHAPE.

Definition at line 84 of file shape_arc.h.

References SHAPE_ARC().

Referenced by CheckArc().

◆ Collide() [1/4]

bool SHAPE_ARC::Collide ( const SEG aSeg,
int  aClearance = 0,
int *  aActual = nullptr,
VECTOR2I aLocation = nullptr 
) const
overridevirtual

Check if the boundary of shape (this) lies closer to the segment aSeg than aClearance, indicating a collision.

Parameters
aActual[out] an optional pointer to an int to be updated with the actual distance int the event of a collision.
aLocation[out] an option pointer to a point to store a nearby location in the event of a collision.
Returns
true, if there is a collision.

Implements SHAPE.

Definition at line 244 of file shape_arc.cpp.

References SEG::A, SEG::B, Collide(), SHAPE_CIRCLE::Collide(), VECTOR2< T >::EuclideanNorm(), GetCenter(), GetCentralAngle(), SHAPE_CIRCLE::GetCircle(), CIRCLE::Intersect(), m_end, m_start, SEG::NearestPoint(), and SEG::Square().

Referenced by BOOST_AUTO_TEST_CASE(), Collide(), Collide(), SHAPE_LINE_CHAIN::Collide(), drawShapes(), GEOM_TEST::IsOutlineValid(), and SHAPE_LINE_CHAIN::SelfIntersectingWithArcs().

◆ Collide() [2/4]

bool SHAPE::Collide ( const SHAPE aShape,
int  aClearance,
VECTOR2I aMTV 
) const
virtualinherited

Check if the boundary of shape (this) lies closer to the shape aShape than aClearance, indicating a collision.

Parameters
aShapeshape to check collision against
aClearanceminimum clearance
aMTV[out] minimum translation vector
aActual[out] an optional pointer to an int to store the actual distance in the event of a collision.
aLocation[out] an option pointer to a point to store a nearby location in the event of a collision.
Returns
true, if there is a collision.

Reimplemented in SHAPE_COMPOUND, SHAPE_RECT, and SHAPE_SEGMENT.

Definition at line 1172 of file shape_collisions.cpp.

References collideShapes().

◆ Collide() [3/4]

bool SHAPE_ARC::Collide ( const SHAPE aShape,
int  aClearance = 0,
int *  aActual = nullptr,
VECTOR2I aLocation = nullptr 
) const
inlineoverridevirtual

Reimplemented from SHAPE.

Definition at line 129 of file shape_arc.h.

References SHAPE::Collide().

◆ Collide() [4/4]

bool SHAPE_ARC::Collide ( const VECTOR2I aP,
int  aClearance = 0,
int *  aActual = nullptr,
VECTOR2I aLocation = nullptr 
) const
overridevirtual

Check if the boundary of shape (this) lies closer to the point aP than aClearance, indicating a collision.

Parameters
aActual[out] an optional pointer to an int to store the actual distance in the event of a collision.
aLocation[out] an option pointer to a point to store a nearby location in the event of a collision.
Returns
true, if there is a collision.

Reimplemented from SHAPE.

Definition at line 440 of file shape_arc.cpp.

References ANGLE_0, BBox(), CIRCLE::Center, VECTOR2< T >::Distance(), VECTOR2< T >::EuclideanNorm(), GetCenter(), GetCentralAngle(), GetEndAngle(), GetStartAngle(), KiROUND(), m_end, m_start, m_width, CIRCLE::NearestPoint(), EDA_ANGLE::Normalize(), and RotatePoint().

◆ ConstructFromStartEndAngle()

SHAPE_ARC & SHAPE_ARC::ConstructFromStartEndAngle ( const VECTOR2I aStart,
const VECTOR2I aEnd,
const EDA_ANGLE aAngle,
double  aWidth = 0 
)

Construct this arc from the given start, end and angle.

Parameters
aStartis the arc starting point
aEndis the arc endpoint
aAngleis the arc included angle
aWidthis the arc line thickness
Returns
this arc.

Definition at line 194 of file shape_arc.cpp.

References CalcArcCenter(), m_end, m_mid, m_start, m_width, RotatePoint(), and update_values().

Referenced by DIRECTION_45::BuildInitialTrace(), SCH_IO_EAGLE::loadPolyLine(), SCH_IO_EAGLE::loadSymbolPolyLine(), and PNS::MEANDER_SHAPE::makeMiterShape().

◆ ConstructFromStartEndCenter()

SHAPE_ARC & SHAPE_ARC::ConstructFromStartEndCenter ( const VECTOR2I aStart,
const VECTOR2I aEnd,
const VECTOR2I aCenter,
bool  aClockwise = false,
double  aWidth = 0 
)

Constructs this arc from the given start, end and center.

Parameters
aStartis the arc starting point
aEndis the arc endpoint
aCenteris the arc center
aClockwisedetermines which of the two solutions to construct
aWidthis the arc line thickness
Returns
*this

Definition at line 212 of file shape_arc.cpp.

References ANGLE_360, m_end, m_mid, m_start, EDA_ANGLE::Normalize(), RotatePoint(), and update_values().

Referenced by SHAPE_LINE_CHAIN::amendArc(), BOOST_AUTO_TEST_CASE(), CADSTAR_ARCHIVE_PARSER::VERTEX::BuildArc(), DIRECTION_45::BuildInitialTrace(), PCB_IO_EASYEDAPRO_PARSER::ParseBoard(), PCB_IO_EASYEDAPRO_PARSER::ParseContour(), EASYEDA_PARSER_BASE::ParseLineChains(), SHAPE_LINE_CHAIN::Slice(), and SHAPE_LINE_CHAIN::splitArc().

◆ ConvertToPolyline()

const SHAPE_LINE_CHAIN SHAPE_ARC::ConvertToPolyline ( double  aAccuracy = DefaultAccuracyForPCB(),
double *  aEffectiveAccuracy = nullptr 
) const

Construct a SHAPE_LINE_CHAIN of segments from a given arc.

Note
The default is ARC_HIGH_DEF in Pcbnew units. This is to allow common geometry collision functions. Other programs should call this using explicit accuracy values.
Todo:
Unify KiCad internal units.
Parameters
aAccuracymaximum divergence from true arc given in internal units.
aEffectiveAccuracyis the actual divergence from true arc given. the approximation error is between -aEffectiveAccuracy/2 and +aEffectiveAccuracy/2 in internal units
Returns
a SHAPE_LINE_CHAIN.

Definition at line 560 of file shape_arc.cpp.

References SHAPE_LINE_CHAIN::Append(), EDA_ANGLE::AsDegrees(), CircleToEndSegmentDeltaRadius(), EDA_ANGLE::Cos(), SEG::Distance(), GetArcMid(), GetArcToSegmentCount(), GetCenter(), GetCentralAngle(), GetP0(), GetP1(), GetRadius(), GetStartAngle(), KiROUND(), m_end, m_start, m_width, EDA_ANGLE::Sin(), VECTOR2< T >::x, and VECTOR2< T >::y.

Referenced by SHAPE_LINE_CHAIN::Append(), PNS::ArcHull(), BOARD_ADAPTER::createPadWithMargin(), KIGFX::PCB_PAINTER::draw(), TEARDROP_MANAGER::findAnchorPointsOnTrack(), and SHAPE_LINE_CHAIN::Insert().

◆ DefaultAccuracyForPCB()

static double SHAPE_ARC::DefaultAccuracyForPCB ( )
inlinestatic
Note
The default is ARC_HIGH_DEF in Pcbnew units. This is to allow common geometry collision functions. Other programs should call this using explicit accuracy values.
Todo:
Unify KiCad internal units.
Returns
a default accuracy value for ConvertToPolyline() to build the polyline.

Definition at line 232 of file shape_arc.h.

References PCB_IU_PER_MM.

Referenced by SHAPE_LINE_CHAIN::Append(), PNS::ArcHull(), BOOST_AUTO_TEST_CASE(), GEOM_TEST::IsOutlineValid(), and PNS::SHOVE::ShoveObstacleLine().

◆ Distance()

int SHAPE::Distance ( const VECTOR2I aP) const
virtualinherited

Returns the minimum distance from a given point to this shape.

Always returns zero if the point is inside a closed shape and aOutlineOnly is false.

Parameters
aPis the point to test
Returns
the distance from the shape to aP

Reimplemented in SHAPE_COMPOUND, and SHAPE_LINE_CHAIN.

Definition at line 108 of file shape.cpp.

References SHAPE::SquaredDistance().

◆ Format()

const std::string SHAPE::Format ( bool  aCplusPlus = true) const
virtualinherited

◆ GetArcMid()

◆ GetCenter()

◆ GetCentralAngle()

◆ GetChord()

SEG SHAPE_ARC::GetChord ( ) const
inline

Definition at line 198 of file shape_arc.h.

References m_end, and m_start.

Referenced by PNS::ArcHull(), and CheckArcGeom().

◆ GetClearance()

int SHAPE::GetClearance ( const SHAPE aOther) const
inherited

Return the actual minimum distance between two shapes.

Return values
distancein IU

POLY_SETs contain a bunch of polygons that are triangulated. But there are way more triangles than necessary for collision detection. Triangles check three vertices each but for the outline, we only need one. These are also fractured, so we don't need to worry about holes

Definition at line 54 of file shape.cpp.

References SHAPE_POLY_SET::COutline(), SHAPE_BASE::GetIndexableSubshapeCount(), SHAPE_BASE::GetIndexableSubshapes(), SHAPE_POLY_SET::OutlineCount(), and SHAPE_BASE::Type().

◆ GetEndAngle()

EDA_ANGLE SHAPE_ARC::GetEndAngle ( ) const
Returns
the end angle of the arc shape, normalized between 0..360 deg.

Definition at line 515 of file shape_arc.cpp.

References GetCenter(), m_end, and EDA_ANGLE::Normalize().

Referenced by CheckArcGeom(), Collide(), and commonParallelProjection().

◆ GetIndexableSubshapeCount()

virtual size_t SHAPE_BASE::GetIndexableSubshapeCount ( ) const
inlinevirtualinherited

Reimplemented in SHAPE_COMPOUND, and SHAPE_POLY_SET.

Definition at line 113 of file shape.h.

Referenced by SHAPE::GetClearance().

◆ GetIndexableSubshapes()

virtual void SHAPE_BASE::GetIndexableSubshapes ( std::vector< const SHAPE * > &  aSubshapes) const
inlinevirtualinherited

Reimplemented in SHAPE_COMPOUND, and SHAPE_POLY_SET.

Definition at line 115 of file shape.h.

Referenced by SHAPE_COMPOUND::AddShape(), SHAPE::GetClearance(), and ROUTER_PREVIEW_ITEM::ViewDraw().

◆ GetLength()

double SHAPE_ARC::GetLength ( ) const
Returns
the length of the arc shape.

Definition at line 529 of file shape_arc.cpp.

References std::abs(), EDA_ANGLE::AsRadians(), GetCentralAngle(), and GetRadius().

◆ GetP0()

◆ GetP1()

◆ GetRadius()

◆ GetStartAngle()

EDA_ANGLE SHAPE_ARC::GetStartAngle ( ) const

◆ GetWidth()

◆ HasIndexableSubshapes()

virtual bool SHAPE_BASE::HasIndexableSubshapes ( ) const
inlinevirtualinherited

Reimplemented in SHAPE_COMPOUND, and SHAPE_POLY_SET.

Definition at line 108 of file shape.h.

Referenced by ROUTER_PREVIEW_ITEM::ViewDraw().

◆ Intersect() [1/2]

int SHAPE_ARC::Intersect ( const CIRCLE aArc,
std::vector< VECTOR2I > *  aIpsBuffer 
) const

Find intersection points between this arc and a CIRCLE.

Ignores arc width.

Parameters
aCircleCircle to intersect against
aIpsBufferBuffer to store the resulting intersection points (if any)
Returns
Number of intersection points found

Definition at line 316 of file shape_arc.cpp.

References GetCenter(), GetRadius(), CIRCLE::Intersect(), and sliceContainsPoint().

Referenced by Collide(), collideArc2Arc(), and SHAPE_LINE_CHAIN::SelfIntersectingWithArcs().

◆ Intersect() [2/2]

int SHAPE_ARC::Intersect ( const SHAPE_ARC aArc,
std::vector< VECTOR2I > *  aIpsBuffer 
) const

Find intersection points between this arc and another arc.

Ignores arc width.

Parameters
aArcArc to intersect against
aIpsBufferBuffer to store the resulting intersection points (if any)
Returns
Number of intersection points found

Definition at line 334 of file shape_arc.cpp.

References GetCenter(), GetRadius(), CIRCLE::Intersect(), and sliceContainsPoint().

◆ IntersectLine()

int SHAPE_ARC::IntersectLine ( const SEG aSeg,
std::vector< VECTOR2I > *  aIpsBuffer 
) const

Find intersection points between this arc and aSeg, treating aSeg as an infinite line.

Ignores arc width.

Parameters
aSegLine to intersect against (treated as an infinite line)
aIpsBufferBuffer to store the resulting intersection points (if any)
Returns
Number of intersection points found

Definition at line 295 of file shape_arc.cpp.

References SEG::A, SEG::B, GetCenter(), GetRadius(), CIRCLE::IntersectLine(), and sliceContainsPoint().

Referenced by PCB_GRID_HELPER::AlignToArc(), Collide(), collideArc2Arc(), and ConnectBoardShapes().

◆ IsCCW()

bool SHAPE_ARC::IsCCW ( ) const
inline
Returns
true if the arc is counter-clockwise.

Definition at line 264 of file shape_arc.h.

References VECTOR3< T >::Cross(), m_end, m_mid, m_start, v1, and v2.

Referenced by IsClockwise().

◆ IsClockwise()

◆ IsNull()

bool SHAPE::IsNull ( ) const
inlineinherited

Return true if the shape is a null shape.

Return values
trueif null :-)

Definition at line 166 of file shape.h.

References SHAPE_BASE::m_type, and SH_NULL.

◆ IsSolid()

bool SHAPE_ARC::IsSolid ( ) const
inlineoverridevirtual

Implements SHAPE.

Definition at line 173 of file shape_arc.h.

Referenced by CheckArcGeom().

◆ Mirror() [1/2]

void SHAPE_ARC::Mirror ( const SEG axis)

Definition at line 664 of file shape_arc.cpp.

References m_end, m_mid, m_start, SEG::ReflectPoint(), and update_values().

◆ Mirror() [2/2]

void SHAPE_ARC::Mirror ( const VECTOR2I aRef,
FLIP_DIRECTION  aFlipDirection 
)

Definition at line 645 of file shape_arc.cpp.

References m_end, m_mid, m_start, update_values(), VECTOR2< T >::x, and VECTOR2< T >::y.

◆ Move()

void SHAPE_ARC::Move ( const VECTOR2I aVector)
overridevirtual

Implements SHAPE.

Definition at line 626 of file shape_arc.cpp.

References m_end, m_mid, m_start, and update_values().

Referenced by PNS::COMPONENT_DRAGGER::Drag().

◆ NearestPoint()

VECTOR2I SHAPE_ARC::NearestPoint ( const VECTOR2I aP) const

◆ NewFacet()

FACET * SHAPE::NewFacet ( )
inherited

◆ operator==()

bool SHAPE_ARC::operator== ( SHAPE_ARC const &  aArc) const
inline

Definition at line 252 of file shape_arc.h.

References m_end, m_mid, m_start, and m_width.

◆ Parse()

bool SHAPE::Parse ( std::stringstream &  aStream)
virtualinherited

Reimplemented in SHAPE_LINE_CHAIN, and SHAPE_POLY_SET.

Definition at line 39 of file shape.cpp.

◆ PointInside()

bool SHAPE::PointInside ( const VECTOR2I aPt,
int  aAccuracy = 0,
bool  aUseBBoxCache = false 
) const
virtualinherited

Check if point aP lies inside a closed shape.

Always returns false if this shape is not closed.

Parameters
aPtpoint to check
aUseBBoxCachegives better performance if the bounding box caches have been generated.
Returns
true if the point is inside the shape (edge is not treated as being inside).

Reimplemented in SHAPE_LINE_CHAIN_BASE, and SHAPE_POLY_SET.

Definition at line 126 of file shape.cpp.

References SHAPE_POLY_SET::COutline(), ERROR_INSIDE, SHAPE_POLY_SET::OutlineCount(), SHAPE_LINE_CHAIN_BASE::PointInside(), and SHAPE::TransformToPolygon().

◆ Reverse()

◆ Reversed()

SHAPE_ARC SHAPE_ARC::Reversed ( ) const

◆ Rotate()

void SHAPE_ARC::Rotate ( const EDA_ANGLE aAngle,
const VECTOR2I aCenter 
)
overridevirtual

Rotate the arc by a given angle about a point.

Parameters
aCenteris the rotation center.
aAnglerotation angle.

Implements SHAPE.

Definition at line 635 of file shape_arc.cpp.

References m_end, m_mid, m_start, RotatePoint(), and update_values().

Referenced by commonParallelProjection().

◆ SetWidth()

void SHAPE_ARC::SetWidth ( int  aWidth)
inline

Definition at line 163 of file shape_arc.h.

References m_width.

Referenced by BOOST_AUTO_TEST_CASE(), SHAPE_LINE_CHAIN::Insert(), and PNS::ARC::SetWidth().

◆ sliceContainsPoint()

bool SHAPE_ARC::sliceContainsPoint ( const VECTOR2I p) const
private

◆ SquaredDistance()

SEG::ecoord SHAPE::SquaredDistance ( const VECTOR2I aP,
bool  aOutlineOnly = false 
) const
virtualinherited

◆ TransformToPolygon()

void SHAPE_ARC::TransformToPolygon ( SHAPE_POLY_SET aBuffer,
int  aError,
ERROR_LOC  aErrorLoc 
) const
overridevirtual

Fills a SHAPE_POLY_SET with a polygon representation of this shape.

Parameters
aBuffer[out] will be filled with the polygonal representation of this shape.
aErrorcontrols the maximum allowed deviation when converting rounded shapes to segments
aErrorLoccontrols where the error is placed when approximating rounded shapes

Implements SHAPE.

Definition at line 712 of file shape_arc.cpp.

References m_end, m_mid, m_start, m_width, and TransformArcToPolygon().

◆ Type()

◆ TypeName()

wxString SHAPE_BASE::TypeName ( ) const
inlineinherited

Definition at line 103 of file shape.h.

References SHAPE_BASE::m_type, and SHAPE_TYPE_asString().

Referenced by Collide().

◆ update_values()

Member Data Documentation

◆ facets

std::list< FACET* > SHAPE::facets
privateinherited

Definition at line 143 of file wrlfacet.h.

Referenced by SHAPE::CalcShape(), and SHAPE::NewFacet().

◆ m_bbox

BOX2I SHAPE_ARC::m_bbox
private

Definition at line 286 of file shape_arc.h.

Referenced by BBox(), SHAPE_ARC(), and update_values().

◆ m_center

VECTOR2I SHAPE_ARC::m_center
private

Definition at line 287 of file shape_arc.h.

Referenced by GetCenter(), SHAPE_ARC(), and update_values().

◆ m_end

◆ m_mid

◆ m_radius

double SHAPE_ARC::m_radius
private

Definition at line 288 of file shape_arc.h.

Referenced by GetRadius(), SHAPE_ARC(), and update_values().

◆ m_start

◆ m_type

SHAPE_TYPE SHAPE_BASE::m_type
protectedinherited

< type of our shape

Definition at line 119 of file shape.h.

Referenced by SHAPE::Format(), SHAPE::IsNull(), SHAPE_BASE::Type(), and SHAPE_BASE::TypeName().

◆ m_width

int SHAPE_ARC::m_width
private

◆ MIN_PRECISION_IU

const int SHAPE::MIN_PRECISION_IU = 4
staticinherited

This is the minimum precision for all the points in a shape.

Definition at line 131 of file shape.h.

Referenced by BOOST_AUTO_TEST_CASE(), DIRECTION_45::BuildInitialTrace(), CompareLength(), CIRCLE::Contains(), EDIT_TOOL::FilletTracks(), CIRCLE::IntersectLine(), and LINE_FILLET_ROUTINE::ProcessLinePair().


The documentation for this class was generated from the following files: