![]() |
KiCad PCB EDA Suite
|
#include <shape_circle.h>
Public Member Functions | |
SHAPE_CIRCLE () | |
SHAPE_CIRCLE (const VECTOR2I &aCenter, int aRadius) | |
SHAPE_CIRCLE (const SHAPE_CIRCLE &aOther) | |
~SHAPE_CIRCLE () | |
SHAPE * | Clone () const override |
Return a dynamically allocated copy of the shape. More... | |
SHAPE_CIRCLE & | operator= (const SHAPE_CIRCLE &)=default |
const BOX2I | BBox (int aClearance=0) const override |
Compute a bounding box of the shape, with a margin of aClearance a collision. More... | |
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. More... | |
void | SetRadius (int aRadius) |
void | SetCenter (const VECTOR2I &aCenter) |
int | GetRadius () const |
const VECTOR2I | GetCenter () const |
const CIRCLE | GetCircle () const |
void | Move (const VECTOR2I &aVector) override |
void | Rotate (double aAngle, const VECTOR2I &aCenter={ 0, 0 }) override |
bool | IsSolid () const override |
bool | IsNull () const |
Return true if the shape is a null shape. More... | |
virtual bool | Collide (const VECTOR2I &aP, int aClearance=0, int *aActual=nullptr, VECTOR2I *aLocation=nullptr) const |
Check if the boundary of shape (this) lies closer to the point aP than aClearance, indicating a collision. More... | |
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. More... | |
virtual bool | Collide (const SHAPE *aShape, int aClearance=0, int *aActual=nullptr, VECTOR2I *aLocation=nullptr) const |
virtual VECTOR2I | Centre () const |
Compute a center-of-mass of the shape. More... | |
virtual bool | Parse (std::stringstream &aStream) |
virtual const std::string | Format () const |
FACET * | NewFacet () |
SGNODE * | CalcShape (SGNODE *aParent, SGNODE *aColor, WRL1_ORDER aVertexOrder, float aCreaseLimit=0.74317, bool isVRML2=false) |
SHAPE_TYPE | Type () const |
Return the type of the shape. More... | |
virtual bool | HasIndexableSubshapes () const |
virtual size_t | GetIndexableSubshapeCount () const |
virtual void | GetIndexableSubshapes (std::vector< SHAPE * > &aSubshapes) |
Static Public Attributes | |
static const int | MIN_PRECISION_IU = 4 |
This is the minimum precision for all the points in a shape. More... | |
Protected Types | |
typedef VECTOR2I::extended_type | ecoord |
Protected Attributes | |
SHAPE_TYPE | m_type |
< type of our shape More... | |
Private Attributes | |
CIRCLE | m_circle |
Definition at line 36 of file shape_circle.h.
|
protectedinherited |
|
inline |
|
inline |
Definition at line 44 of file shape_circle.h.
|
inline |
Definition at line 49 of file shape_circle.h.
|
inline |
Definition at line 54 of file shape_circle.h.
|
inlineoverridevirtual |
Compute a bounding box of the shape, with a margin of aClearance a collision.
aClearance | how much the bounding box is expanded wrs to the minimum enclosing rectangle for the shape. |
Implements SHAPE.
Definition at line 64 of file shape_circle.h.
References CIRCLE::Center, m_circle, and CIRCLE::Radius.
|
inherited |
Definition at line 713 of file wrlfacet.cpp.
References IFSG_NODE::AddChildNode(), IFSG_INDEX::AddIndex(), IFSG_NODE::AddRefNode(), colors, SHAPE::facets, IFSG_NODE::GetRawPtr(), S3D::GetSGNodeParent(), IFSG_FACESET::NewNode(), IFSG_SHAPE::NewNode(), NULL, IFSG_COLORS::SetColorList(), IFSG_COORDS::SetCoordsList(), IFSG_NORMALS::SetNormalList(), SGPOINT::x, SGPOINT::y, and SGPOINT::z.
Referenced by WRL1FACESET::TranslateToSG(), X3DIFACESET::TranslateToSG(), and WRL2FACESET::TranslateToSG().
|
inlinevirtualinherited |
Compute a center-of-mass of the shape.
Definition at line 216 of file shape.h.
References SHAPE::BBox(), and BOX2< Vec >::Centre().
Referenced by Collide().
|
inlineoverridevirtual |
Return a dynamically allocated copy of the shape.
copy | of the shape |
Reimplemented from SHAPE.
Definition at line 57 of file shape_circle.h.
References SHAPE_CIRCLE().
|
inlineoverridevirtual |
Check if the boundary of shape (this) lies closer to the segment aSeg than aClearance, indicating a collision.
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. |
Implements SHAPE.
Definition at line 71 of file shape_circle.h.
References CIRCLE::Center, m_circle, SEG::NearestPoint(), CIRCLE::Radius, and SEG::Square().
Referenced by Collide(), and SCH_JUNCTION::HitTest().
|
inlinevirtualinherited |
Check if the boundary of shape (this) lies closer to the point aP than aClearance, indicating a collision.
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. |
Reimplemented in SHAPE_POLY_SET, SHAPE_LINE_CHAIN_BASE, SHAPE_ARC, and SHAPE_SEGMENT.
Definition at line 165 of file shape.h.
Referenced by DRC_RTREE::CheckColliding(), SHAPE_COMPOUND::Collide(), SHAPE_SEGMENT::Collide(), collide(), SHAPE_RECT::Collide(), SHAPE_POLY_SET::Collide(), PNS::ITEM::collideSimple(), PNS::SHOVE::onCollidingVia(), PNS::HIT_VISITOR::operator()(), DRC_RTREE::QueryColliding(), PNS::OPTIMIZER::smartPadsSingle(), DRC_TEST_PROVIDER_EDGE_CLEARANCE::testAgainstEdge(), DRC_TEST_PROVIDER_COPPER_CLEARANCE::testPadAgainstItem(), and DRC_TEST_PROVIDER_COPPER_CLEARANCE::testTrackAgainstItem().
|
virtualinherited |
Check if the boundary of shape (this) lies closer to the shape aShape than aClearance, indicating a collision.
aShape | shape to check collision against |
aClearance | minimum clearance |
aMTV | 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. |
Reimplemented in SHAPE_RECT, SHAPE_SEGMENT, and SHAPE_COMPOUND.
Definition at line 881 of file shape_collisions.cpp.
References collideShapes().
|
virtualinherited |
Reimplemented in SHAPE_POLY_SET, SHAPE_RECT, SHAPE_SEGMENT, and SHAPE_COMPOUND.
Definition at line 887 of file shape_collisions.cpp.
References collideShapes().
|
virtualinherited |
Reimplemented in SHAPE_POLY_SET, SHAPE_LINE_CHAIN, SHAPE_RECT, SHAPE_SEGMENT, and SHAPE_COMPOUND.
Definition at line 35 of file shape.cpp.
Referenced by SHAPE_FILE_IO::Write().
|
inline |
Definition at line 107 of file shape_circle.h.
References CIRCLE::Center, and m_circle.
Referenced by PNS::buildHullForPrimitiveShape(), PNS::OPTIMIZER::circleBreakouts(), Collide(), SHAPE_POLY_SET::Collide(), PCB_GRID_HELPER::computeAnchors(), BOARD_ADAPTER::createPadWithClearance(), KIGFX::PCB_PAINTER::draw(), ROUTER_PREVIEW_ITEM::drawShape(), SCH_JUNCTION::Print(), pushoutForce(), DRC_TEST_PROVIDER_HOLE_CLEARANCE::testHoleAgainstHole(), and DIMENSION_BASE::TransformShapeWithClearanceToPolygon().
|
inline |
Definition at line 112 of file shape_circle.h.
References m_circle.
|
inlinevirtualinherited |
Reimplemented in SHAPE_POLY_SET, and SHAPE_COMPOUND.
|
inlinevirtualinherited |
Reimplemented in SHAPE_POLY_SET, and SHAPE_COMPOUND.
Definition at line 106 of file shape.h.
Referenced by SHAPE_COMPOUND::AddShape(), and ROUTER_PREVIEW_ITEM::ViewDraw().
|
inline |
Definition at line 102 of file shape_circle.h.
References m_circle, and CIRCLE::Radius.
Referenced by PNS::buildHullForPrimitiveShape(), PNS::OPTIMIZER::circleBreakouts(), Collide(), SHAPE_POLY_SET::Collide(), PCB_GRID_HELPER::computeAnchors(), BOARD_ADAPTER::createPadWithClearance(), KIGFX::PCB_PAINTER::draw(), ROUTER_PREVIEW_ITEM::drawShape(), SCH_JUNCTION::GetDiameter(), SCH_JUNCTION::Print(), pushoutForce(), DRC_TEST_PROVIDER_HOLE_CLEARANCE::testHoleAgainstHole(), and DIMENSION_BASE::TransformShapeWithClearanceToPolygon().
|
inlinevirtualinherited |
Reimplemented in SHAPE_POLY_SET, and SHAPE_COMPOUND.
Definition at line 99 of file shape.h.
Referenced by SHAPE_COMPOUND::AddShape(), and ROUTER_PREVIEW_ITEM::ViewDraw().
|
inlineinherited |
Return true if the shape is a null shape.
true | if null :-) |
Definition at line 150 of file shape.h.
References SHAPE_BASE::m_type, and SH_NULL.
|
inlineoverridevirtual |
|
inlineoverridevirtual |
Implements SHAPE.
Definition at line 117 of file shape_circle.h.
References CIRCLE::Center, and m_circle.
|
inherited |
Definition at line 705 of file wrlfacet.cpp.
References SHAPE::facets.
Referenced by WRL1FACESET::TranslateToSG(), X3DIFACESET::TranslateToSG(), and WRL2FACESET::TranslateToSG().
|
default |
|
virtualinherited |
Reimplemented in SHAPE_POLY_SET, and SHAPE_LINE_CHAIN.
|
inlineoverridevirtual |
aCenter | is the rotation center. |
aAngle | rotation angle in radians. |
Implements SHAPE.
Definition at line 122 of file shape_circle.h.
|
inline |
Definition at line 97 of file shape_circle.h.
References CIRCLE::Center, and m_circle.
Referenced by Collide(), and PNS::VIA::SetPos().
|
inline |
Definition at line 92 of file shape_circle.h.
References m_circle, and CIRCLE::Radius.
Referenced by PNS::VIA::SetDiameter().
|
inlineinherited |
Return the type of the shape.
the | type |
Definition at line 94 of file shape.h.
References SHAPE_BASE::m_type.
Referenced by PNS::DP_GATEWAYS::BuildFromPrimitivePair(), PNS::buildHullForPrimitiveShape(), Collide(), SHAPE_POLY_SET::Collide(), collideShapes(), collideSingleShapes(), PNS::OPTIMIZER::computeBreakouts(), ROUTER_PREVIEW_ITEM::drawShape(), PNS::SOLID::HoleHull(), PNS::SOLID::Hull(), and SHAPE_FILE_IO::Write().
|
private |
Definition at line 135 of file shape_circle.h.
Referenced by BBox(), Collide(), GetCenter(), GetCircle(), GetRadius(), Move(), SetCenter(), and SetRadius().
|
protectedinherited |
< type of our shape
Definition at line 110 of file shape.h.
Referenced by SHAPE::IsNull(), and SHAPE_BASE::Type().
|
staticinherited |
This is the minimum precision for all the points in a shape.
Definition at line 122 of file shape.h.
Referenced by BOOST_AUTO_TEST_CASE(), DIRECTION_45::BuildInitialTrace(), CompareLength(), EDIT_TOOL::FilletTracks(), and CIRCLE::Intersect().