![]() |
KiCad PCB EDA Suite
|
#include <shape_segment.h>
Public Member Functions | |
SHAPE_SEGMENT () | |
SHAPE_SEGMENT (const VECTOR2I &aA, const VECTOR2I &aB, int aWidth=0) | |
SHAPE_SEGMENT (const SEG &aSeg, int aWidth=0) | |
~SHAPE_SEGMENT () | |
SHAPE * | Clone () const override |
Return a dynamically allocated copy of the shape. More... | |
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 SHAPE *aShape, int aClearance, VECTOR2I *aMTV) const override |
Check if the boundary of shape (this) lies closer to the shape aShape than aClearance, indicating a collision. More... | |
bool | Collide (const SHAPE *aShape, int aClearance=0, int *aActual=nullptr, VECTOR2I *aLocation=nullptr) 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, indicating a collision. More... | |
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. More... | |
void | SetSeg (const SEG &aSeg) |
const SEG & | GetSeg () const |
void | SetWidth (int aWidth) |
int | GetWidth () const |
bool | IsSolid () const override |
void | Rotate (double aAngle, const VECTOR2I &aCenter={ 0, 0 }) override |
void | Move (const VECTOR2I &aVector) override |
virtual const std::string | Format () const override |
bool | IsNull () const |
Return true if the shape is a null shape. More... | |
virtual VECTOR2I | Centre () const |
Compute a center-of-mass of the shape. More... | |
virtual bool | Parse (std::stringstream &aStream) |
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 | |
SEG | m_seg |
int | m_width |
Definition at line 35 of file shape_segment.h.
|
protectedinherited |
|
inline |
Definition at line 43 of file shape_segment.h.
|
inline |
Definition at line 49 of file shape_segment.h.
|
inline |
Definition at line 55 of file shape_segment.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 62 of file shape_segment.h.
References SEG::A, SEG::B, BOX2< Vec >::Inflate(), m_seg, and m_width.
|
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_segment.h.
References m_seg, m_width, and SHAPE_SEGMENT().
Referenced by DRC_ENGINE::GetShape(), and PNS_KICAD_IFACE_BASE::syncPad().
|
inlineoverridevirtual |
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 from SHAPE.
Definition at line 67 of file shape_segment.h.
References SHAPE::Collide().
Referenced by Collide().
|
inlineoverridevirtual |
Reimplemented from SHAPE.
Definition at line 72 of file shape_segment.h.
References SHAPE::Collide().
|
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 78 of file shape_segment.h.
References m_seg, m_width, SEG::NearestPoint(), SEG::Square(), and SEG::SquaredDistance().
|
inlineoverridevirtual |
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 from SHAPE.
Definition at line 98 of file shape_segment.h.
References m_seg, m_width, SEG::NearestPoint(), SEG::Square(), and SEG::SquaredDistance().
|
overridevirtual |
Reimplemented from SHAPE.
Definition at line 29 of file shape_segment.cpp.
References SEG::A, SEG::B, m_seg, m_width, VECTOR2< T >::x, and VECTOR2< T >::y.
|
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 123 of file shape_segment.h.
References m_seg.
Referenced by PNS::SEGMENT::Anchor(), PNS::ApproximateSegmentAsRect(), PNS::SEGMENT::CLine(), Collide(), SHAPE_POLY_SET::Collide(), PCB_GRID_HELPER::computeAnchors(), BOARD_ADAPTER::createPadWithClearance(), BOARD_ADAPTER::createPadWithDrill(), KIGFX::PCB_PAINTER::draw(), ROUTER_PREVIEW_ITEM::drawShape(), DIALOG_PAD_PROPERTIES::padValuesOK(), PlotLayerOutlines(), PNS::SEGMENT::Seg(), PNS::SegmentHull(), PNS::SEGMENT::SwapEnds(), DRC_TEST_PROVIDER_COPPER_CLEARANCE::testItemAgainstZones(), and PAD::TransformHoleWithClearanceToPolygon().
|
inline |
Definition at line 133 of file shape_segment.h.
References m_width.
Referenced by PNS::ApproximateSegmentAsRect(), Collide(), SHAPE_POLY_SET::Collide(), PCB_GRID_HELPER::computeAnchors(), BOARD_ADAPTER::createPadWithClearance(), BOARD_ADAPTER::createPadWithDrill(), KIGFX::PCB_PAINTER::draw(), ROUTER_PREVIEW_ITEM::drawShape(), DIALOG_PAD_PROPERTIES::padValuesOK(), PlotLayerOutlines(), PNS::SegmentHull(), PNS_KICAD_IFACE_BASE::syncPad(), DRC_TEST_PROVIDER_COPPER_CLEARANCE::testItemAgainstZones(), PAD::TransformHoleWithClearanceToPolygon(), and PNS::SEGMENT::Width().
|
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 |
|
inherited |
Definition at line 705 of file wrlfacet.cpp.
References SHAPE::facets.
Referenced by WRL1FACESET::TranslateToSG(), X3DIFACESET::TranslateToSG(), and WRL2FACESET::TranslateToSG().
|
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 143 of file shape_segment.h.
|
inline |
Definition at line 118 of file shape_segment.h.
References m_seg.
Referenced by PNS::SEGMENT::SetEnds(), and PNS::SEGMENT::SwapEnds().
|
inline |
Definition at line 128 of file shape_segment.h.
References m_width.
Referenced by PNS::SEGMENT::SetWidth(), and PNS_KICAD_IFACE_BASE::syncPad().
|
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 |
|
protectedinherited |
< type of our shape
Definition at line 110 of file shape.h.
Referenced by SHAPE::IsNull(), and SHAPE_BASE::Type().
|
private |
Definition at line 165 of file shape_segment.h.
Referenced by BBox(), Clone(), Collide(), Format(), GetWidth(), and SetWidth().
|
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().