KiCad PCB EDA Suite
|
Represent a polyline containing arcs as well as line segments: A chain of connected line and/or arc segments. More...
#include <shape_line_chain.h>
Classes | |
struct | compareOriginDistance |
struct | INTERSECTION |
Represent an intersection between two line segments. More... | |
class | POINT_INSIDE_TRACKER |
A dynamic state checking if a point lies within polygon with a dynamically built outline ( with each piece of the outline added by AddPolyline () More... | |
Public Types | |
typedef std::vector< INTERSECTION > | INTERSECTIONS |
Public Member Functions | |
SHAPE_LINE_CHAIN () | |
Initialize an empty line chain. More... | |
SHAPE_LINE_CHAIN (const SHAPE_LINE_CHAIN &aShape) | |
SHAPE_LINE_CHAIN (const std::vector< int > &aV) | |
SHAPE_LINE_CHAIN (const std::vector< VECTOR2I > &aV, bool aClosed=false) | |
SHAPE_LINE_CHAIN (const SHAPE_ARC &aArc, bool aClosed=false) | |
SHAPE_LINE_CHAIN (const ClipperLib::Path &aPath, const std::vector< CLIPPER_Z_VALUE > &aZValueBuffer, const std::vector< SHAPE_ARC > &aArcBuffer) | |
SHAPE_LINE_CHAIN (const Clipper2Lib::Path64 &aPath, const std::vector< CLIPPER_Z_VALUE > &aZValueBuffer, const std::vector< SHAPE_ARC > &aArcBuffer) | |
virtual | ~SHAPE_LINE_CHAIN () |
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. More... | |
virtual bool | Collide (const SEG &aSeg, int aClearance=0, int *aActual=nullptr, VECTOR2I *aLocation=nullptr) const override |
Check if segment aSeg lies closer to us than aClearance. More... | |
SHAPE_LINE_CHAIN & | operator= (const SHAPE_LINE_CHAIN &)=default |
SHAPE * | Clone () const override |
Return a dynamically allocated copy of the shape. More... | |
void | Clear () |
Remove all points from the line chain. More... | |
void | SetClosed (bool aClosed) |
Mark the line chain as closed (i.e. More... | |
bool | IsClosed () const override |
void | SetWidth (int aWidth) |
Set the width of all segments in the chain. More... | |
int | Width () const |
Get the current width of the segments in the chain. More... | |
int | SegmentCount () const |
Return the number of segments in this line chain. More... | |
int | ShapeCount () const |
Return the number of shapes (line segments or arcs) in this line chain. More... | |
int | PointCount () const |
Return the number of points (vertices) in this line chain. More... | |
SEG | Segment (int aIndex) |
Return a copy of the aIndex-th segment in the line chain. More... | |
const SEG | CSegment (int aIndex) const |
Return a constant copy of the aIndex segment in the line chain. More... | |
int | NextShape (int aPointIndex, bool aForwards=true) const |
Return the vertex index of the next shape in the chain, or -1 if aPointIndex is the last shape. More... | |
int | PrevShape (int aPointIndex) const |
void | SetPoint (int aIndex, const VECTOR2I &aPos) |
Move a point to a specific location. More... | |
const VECTOR2I & | CPoint (int aIndex) const |
Return a reference to a given point in the line chain. More... | |
const std::vector< VECTOR2I > & | CPoints () const |
const VECTOR2I & | CLastPoint () const |
Return the last point in the line chain. More... | |
const std::vector< SHAPE_ARC > & | CArcs () const |
const std::vector< std::pair< ssize_t, ssize_t > > & | CShapes () const |
const BOX2I | BBox (int aClearance=0) const override |
Compute a bounding box of the shape, with a margin of aClearance a collision. More... | |
void | GenerateBBoxCache () const |
BOX2I * | GetCachedBBox () const override |
int | Distance (const VECTOR2I &aP, bool aOutlineOnly=false) const |
Compute the minimum distance between the line chain and a point aP. More... | |
const SHAPE_LINE_CHAIN | Reverse () const |
Reverse point order in the line chain. More... | |
void | ClearArcs () |
Remove all arc references in the line chain, resulting in a chain formed only of straight segments. More... | |
long long int | Length () const |
Return length of the line chain in Euclidean metric. More... | |
void | ReservePoints (size_t aSize) |
Allocate a number of points all at once (for performance). More... | |
void | Append (int aX, int aY, bool aAllowDuplication=false) |
Append a new point at the end of the line chain. More... | |
void | Append (const VECTOR2I &aP, bool aAllowDuplication=false) |
Append a new point at the end of the line chain. More... | |
void | Append (const SHAPE_LINE_CHAIN &aOtherLine) |
Append another line chain at the end. More... | |
void | Append (const SHAPE_ARC &aArc) |
void | Append (const SHAPE_ARC &aArc, double aAccuracy) |
void | Insert (size_t aVertex, const VECTOR2I &aP) |
void | Insert (size_t aVertex, const SHAPE_ARC &aArc) |
void | Replace (int aStartIndex, int aEndIndex, const VECTOR2I &aP) |
Replace points with indices in range [start_index, end_index] with a single point aP. More... | |
void | Replace (int aStartIndex, int aEndIndex, const SHAPE_LINE_CHAIN &aLine) |
Replace points with indices in range [start_index, end_index] with the points from line chain aLine. More... | |
void | Remove (int aStartIndex, int aEndIndex) |
Remove the range of points [start_index, end_index] from the line chain. More... | |
void | Remove (int aIndex) |
Remove the aIndex-th point from the line chain. More... | |
void | RemoveShape (int aPointIndex) |
Remove the shape at the given index from the line chain. More... | |
int | Split (const VECTOR2I &aP) |
Insert the point aP belonging to one of the our segments, splitting the adjacent segment in two. More... | |
int | Find (const VECTOR2I &aP, int aThreshold=0) const |
Search for point aP. More... | |
int | FindSegment (const VECTOR2I &aP, int aThreshold=1) const |
Search for segment containing point aP. More... | |
const SHAPE_LINE_CHAIN | Slice (int aStartIndex, int aEndIndex=-1) const |
Return a subset of this line chain containing the [start_index, end_index] range of points. More... | |
bool | Intersects (const SHAPE_LINE_CHAIN &aChain) const |
int | Intersect (const SEG &aSeg, INTERSECTIONS &aIp) const |
Find all intersection points between our line chain and the segment aSeg. More... | |
int | Intersect (const SHAPE_LINE_CHAIN &aChain, INTERSECTIONS &aIp, bool aExcludeColinearAndTouching=false, BOX2I *aChainBBox=nullptr) const |
Find all intersection points between our line chain and the line chain aChain. More... | |
int | PathLength (const VECTOR2I &aP, int aIndex=-1) const |
Compute the walk path length from the beginning of the line chain and the point aP belonging to our line. More... | |
bool | CheckClearance (const VECTOR2I &aP, const int aDist) const |
Check if point aP is closer to (or on) an edge or vertex of the line chain. More... | |
const std::optional< INTERSECTION > | SelfIntersecting () const |
Check if the line chain is self-intersecting. More... | |
SHAPE_LINE_CHAIN & | Simplify (bool aRemoveColinear=true) |
Simplify the line chain by removing colinear adjacent segments and duplicate vertices. More... | |
int | NearestSegment (const VECTOR2I &aP) const |
Find the segment nearest the given point. More... | |
const VECTOR2I | NearestPoint (const VECTOR2I &aP, bool aAllowInternalShapePoints=true) const |
Find a point on the line chain that is closest to point aP. More... | |
const VECTOR2I | NearestPoint (const SEG &aSeg, int &dist) const |
Find a point on the line chain that is closest to the line defined by the points of segment aSeg, also returns the distance. More... | |
const std::string | Format (bool aCplusPlus=true) const override |
bool | Parse (std::stringstream &aStream) override |
bool | operator!= (const SHAPE_LINE_CHAIN &aRhs) const |
bool | CompareGeometry (const SHAPE_LINE_CHAIN &aOther) const |
void | Move (const VECTOR2I &aVector) override |
void | Mirror (bool aX=true, bool aY=false, const VECTOR2I &aRef={ 0, 0 }) |
Mirror the line points about y or x (or both). More... | |
void | Mirror (const SEG &axis) |
Mirror the line points using an given axis. More... | |
void | Rotate (const EDA_ANGLE &aAngle, const VECTOR2I &aCenter={ 0, 0 }) override |
Rotate all vertices by a given angle. More... | |
bool | IsSolid () const override |
const VECTOR2I | PointAlong (int aPathLength) const |
double | Area (bool aAbsolute=true) const |
Return the area of this chain. More... | |
size_t | ArcCount () const |
ssize_t | ArcIndex (size_t aSegment) const |
Return the arc index for the given segment index. More... | |
const SHAPE_ARC & | Arc (size_t aArc) const |
bool | IsSharedPt (size_t aIndex) const |
Test if a point is shared between multiple shapes. More... | |
bool | IsPtOnArc (size_t aPtIndex) const |
bool | IsArcSegment (size_t aSegment) const |
bool | IsArcStart (size_t aIndex) const |
bool | IsArcEnd (size_t aIndex) const |
virtual const VECTOR2I | GetPoint (int aIndex) const override |
virtual const SEG | GetSegment (int aIndex) const override |
virtual size_t | GetPointCount () const override |
virtual size_t | GetSegmentCount () const override |
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 |
SEG::ecoord | SquaredDistance (const VECTOR2I &aP, bool aOutlineOnly=false) const |
bool | PointInside (const VECTOR2I &aPt, int aAccuracy=0, bool aUseBBoxCache=false) const |
Check if point aP lies inside a polygon (any type) defined by the line chain. More... | |
bool | PointOnEdge (const VECTOR2I &aP, int aAccuracy=0) const |
Check if point aP lies on an edge or vertex of the line chain. More... | |
int | EdgeContainingPoint (const VECTOR2I &aP, int aAccuracy=0) const |
Check if point aP lies on an edge or vertex of the line chain. More... | |
int | GetClearance (const SHAPE *aOther) const |
Return the actual minimum distance between two shapes. More... | |
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... | |
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... | |
wxString | TypeName () const |
virtual bool | HasIndexableSubshapes () const |
virtual size_t | GetIndexableSubshapeCount () const |
virtual void | GetIndexableSubshapes (std::vector< const SHAPE * > &aSubshapes) const |
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 Member Functions | |
void | convertArc (ssize_t aArcIndex) |
Convert an arc to only a point chain by removing the arc and references. More... | |
void | splitArc (ssize_t aPtIndex, bool aCoincident=false) |
Splits an arc into two arcs at aPtIndex. More... | |
void | amendArc (size_t aArcIndex, const VECTOR2I &aNewStart, const VECTOR2I &aNewEnd) |
void | amendArcStart (size_t aArcIndex, const VECTOR2I &aNewStart) |
void | amendArcEnd (size_t aArcIndex, const VECTOR2I &aNewEnd) |
ssize_t | reversedArcIndex (size_t aSegment) const |
Return the arc index for the given segment index, looking backwards. More... | |
ClipperLib::Path | convertToClipper (bool aRequiredOrientation, std::vector< CLIPPER_Z_VALUE > &aZValueBuffer, std::vector< SHAPE_ARC > &aArcBuffer) const |
Create a new Clipper path from the SHAPE_LINE_CHAIN in a given orientation. More... | |
Clipper2Lib::Path64 | convertToClipper2 (bool aRequiredOrientation, std::vector< CLIPPER_Z_VALUE > &aZValueBuffer, std::vector< SHAPE_ARC > &aArcBuffer) const |
Create a new Clipper2 path from the SHAPE_LINE_CHAIN in a given orientation. More... | |
void | fixIndicesRotation () |
Fix indices of this chain to ensure arcs are not split between the end and start indices. More... | |
void | mergeFirstLastPointIfNeeded () |
Merge the first and last point if they are the same and this chain is closed. More... | |
Protected Attributes | |
SHAPE_TYPE | m_type |
< type of our shape More... | |
Private Types | |
typedef std::vector< VECTOR2I >::iterator | point_iter |
typedef std::vector< VECTOR2I >::const_iterator | point_citer |
Private Attributes | |
std::vector< VECTOR2I > | m_points |
array of vertices More... | |
std::vector< std::pair< ssize_t, ssize_t > > | m_shapes |
Array of indices that refer to the index of the shape if the point is part of a larger shape, e.g. More... | |
std::vector< SHAPE_ARC > | m_arcs |
bool | m_closed |
is the line chain closed? More... | |
int | m_width |
Width of the segments (for BBox calculations in RTree) TODO Adjust usage of SHAPE_LINE_CHAIN to account for where we need a width and where not Alternatively, we could split the class into a LINE_CHAIN (no width) and SHAPE_LINE_CHAIN that derives from SHAPE as well that does have a width. More... | |
BOX2I | m_bbox |
cached bounding box More... | |
std::list< FACET * > | facets |
Static Private Attributes | |
static const ssize_t | SHAPE_IS_PT = -1 |
static const std::pair< ssize_t, ssize_t > | SHAPES_ARE_PT = { SHAPE_IS_PT, SHAPE_IS_PT } |
Friends | |
class | SHAPE_POLY_SET |
Represent a polyline containing arcs as well as line segments: A chain of connected line and/or arc segments.
The arc shapes are piecewise approximated for the purpose of boolean operations but are used as arcs when doing collision checks.
It is purposely not named "polyline" to avoid confusion with the existing CPolyLine in Pcbnew.
Definition at line 81 of file shape_line_chain.h.
|
protectedinherited |
typedef std::vector<INTERSECTION> SHAPE_LINE_CHAIN::INTERSECTIONS |
Definition at line 151 of file shape_line_chain.h.
|
private |
Definition at line 85 of file shape_line_chain.h.
|
private |
Definition at line 84 of file shape_line_chain.h.
|
inline |
Initialize an empty line chain.
Definition at line 157 of file shape_line_chain.h.
Referenced by Clone().
|
inline |
Definition at line 163 of file shape_line_chain.h.
SHAPE_LINE_CHAIN::SHAPE_LINE_CHAIN | ( | const std::vector< int > & | aV | ) |
Definition at line 47 of file shape_line_chain.cpp.
References Append().
|
inline |
Definition at line 175 of file shape_line_chain.h.
References m_points, m_shapes, and SHAPES_ARE_PT.
|
inline |
Definition at line 184 of file shape_line_chain.h.
References SHAPE_ARC::ConvertToPolyline(), CPoints(), m_arcs, m_points, m_shapes, and SHAPE_IS_PT.
SHAPE_LINE_CHAIN::SHAPE_LINE_CHAIN | ( | const ClipperLib::Path & | aPath, |
const std::vector< CLIPPER_Z_VALUE > & | aZValueBuffer, | ||
const std::vector< SHAPE_ARC > & | aArcBuffer | ||
) |
Definition at line 57 of file shape_line_chain.cpp.
References Append(), fixIndicesRotation(), m_arcs, m_points, m_shapes, SHAPE_IS_PT, and X.
SHAPE_LINE_CHAIN::SHAPE_LINE_CHAIN | ( | const Clipper2Lib::Path64 & | aPath, |
const std::vector< CLIPPER_Z_VALUE > & | aZValueBuffer, | ||
const std::vector< SHAPE_ARC > & | aArcBuffer | ||
) |
Definition at line 101 of file shape_line_chain.cpp.
References Append(), fixIndicesRotation(), m_arcs, m_points, m_shapes, and SHAPE_IS_PT.
|
inlinevirtual |
Definition at line 203 of file shape_line_chain.h.
|
protected |
Definition at line 287 of file shape_line_chain.cpp.
References SHAPE_ARC::ConstructFromStartEndCenter(), SHAPE_ARC::GetCenter(), SHAPE_ARC::IsClockwise(), and m_arcs.
Referenced by amendArcEnd(), amendArcStart(), and splitArc().
|
inlineprotected |
Definition at line 909 of file shape_line_chain.h.
References amendArc(), and m_arcs.
|
inlineprotected |
Definition at line 904 of file shape_line_chain.h.
References amendArc(), and m_arcs.
void SHAPE_LINE_CHAIN::Append | ( | const SHAPE_ARC & | aArc | ) |
Definition at line 1326 of file shape_line_chain.cpp.
References Append(), and SHAPE_ARC::DefaultAccuracyForPCB().
void SHAPE_LINE_CHAIN::Append | ( | const SHAPE_ARC & | aArc, |
double | aAccuracy | ||
) |
Definition at line 1332 of file shape_line_chain.cpp.
References Append(), SHAPE_ARC::ConvertToPolyline(), SEG::Distance(), SHAPE_ARC::GetArcMid(), SHAPE_ARC::GetP0(), SHAPE_ARC::GetP1(), m_arcs, m_points, and m_shapes.
void SHAPE_LINE_CHAIN::Append | ( | const SHAPE_LINE_CHAIN & | aOtherLine | ) |
Append another line chain at the end.
aOtherLine | is the line chain to be appended. |
Definition at line 1260 of file shape_line_chain.cpp.
References ArcIndex(), CPoint(), CShapes(), IsArcSegment(), m_arcs, m_bbox, m_points, m_shapes, BOX2< Vec >::Merge(), mergeFirstLastPointIfNeeded(), PointCount(), alg::run_on_pair(), SHAPE_IS_PT, and SHAPES_ARE_PT.
|
inline |
Append a new point at the end of the line chain.
aP | is the new point. |
aAllowDuplication | set to true to append the new point even it is the same as the last entered point or false (default) to skip it if it is the same as the last entered point. |
Definition at line 519 of file shape_line_chain.h.
References CPoint(), m_bbox, m_points, m_shapes, BOX2< Vec >::Merge(), and SHAPES_ARE_PT.
|
inline |
Append a new point at the end of the line chain.
aX | is X coordinate of the new point. |
aY | is Y coordinate of the new point. |
aAllowDuplication | set to true to append the new point even if it is the same as the last entered point, false (default) to skip it if it is the same as the last entered point. |
Definition at line 505 of file shape_line_chain.h.
References Append().
Referenced by ZONE_FILLER::addHatchFillTypeOnZone(), PNS_PCBNEW_DEBUG_DECORATOR::AddPoint(), PNS_TEST_DEBUG_DECORATOR::AddPoint(), LIB_SHAPE::AddPoint(), SCH_SHAPE::AddPoint(), POLYGON_GEOM_MANAGER::AddPoint(), ZONE::AddPolygon(), PNS_PCBNEW_DEBUG_DECORATOR::AddShape(), PNS::DEBUG_DECORATOR::AddShape(), PNS::MOUSE_TRAIL_TRACER::AddTrailPoint(), PNS::DIFF_PAIR::Append(), SHAPE_SIMPLE::Append(), Append(), CADSTAR_ARCHIVE_PARSER::VERTEX::AppendToChain(), PNS::ArcHull(), PNS::NODE::AssembleLine(), EDA_SHAPE::beginEdit(), BOOST_AUTO_TEST_CASE(), buildBoardBoundingBoxPoly(), PNS::DP_GATEWAYS::buildDpContinuation(), PAD::BuildEffectiveShapes(), BuildFootprintPolygonOutlines(), PNS::DIFF_PAIR::BuildInitial(), DIRECTION_45::BuildInitialTrace(), SHAPE_POLY_SET::BuildPolysetFromOrientedPaths(), ZONE_FILLER::buildThermalSpokes(), SHAPE_POLY_SET::chamferFilletPolygon(), PNS::KEEP_TOPOLOGY_CONSTRAINT::Check(), PNS::OPTIMIZER::circleBreakouts(), KI_TEST::CommonTestData::CommonTestData(), PCB_GRID_HELPER::computeAnchors(), SCH_SHEET_PIN::ConstrainOnEdge(), EDA_SHAPE::continueEdit(), ConvertArcToPolyline(), ConvertOutlineToPolygon(), convertPolygon(), SHAPE_ARC::ConvertToPolyline(), PNS::ConvexHull(), PLACEFILE_GERBER_WRITER::CreatePlaceFile(), PNS::OPTIMIZER::customBreakouts(), PNS::MEANDER_PLACER::doMove(), PNS::LINE::dragSegment45(), PNS::MEANDER_SHAPE::forward(), SHAPE_POLY_SET::fractureSingle(), PNS::MEANDER_SHAPE::genMeanderShape(), CADSTAR_PCB_ARCHIVE_LOADER::getLineChainFromShapes(), PNS::MOUSE_TRAIL_TRACER::GetPosture(), KIFONT::OUTLINE_FONT::getTextAsGlyphsUnlocked(), HelperShapeLineChainFromAltiumVertices(), Insert(), POLYGON_GEOM_MANAGER::IsSelfIntersecting(), PNS::ROUTER::isStartingPointRoutable(), IteratorFixture::IteratorFixture(), PNS::TOPOLOGY::LeadingRatLine(), CADSTAR_SCH_ARCHIVE_LOADER::loadBusses(), FABMASTER::loadFootprints(), CADSTAR_SCH_ARCHIVE_LOADER::loadNets(), FABMASTER::loadShapePolySet(), FABMASTER::loadZone(), PNS::MEANDER_SHAPE::MakeArc(), PNS::MEANDER_SHAPE::MakeCorner(), PNS::MEANDER_SHAPE::makeMiterShape(), CONVERT_TOOL::makePolysFromChainedSegs(), GEOM_TEST::MakeSquarePolyLine(), PNS::LINE_PLACER::mergeHead(), PNS::OPTIMIZER::mergeObtuse(), PNS::MEANDER_SHAPE::miter(), PNS::DP_MEANDER_PLACER::Move(), PNS::OctagonalHull(), ZONE_CREATE_HELPER::OnComplete(), PNS::LINE_PLACER::optimizeTailHeadTransition(), SHAPE_RECT::Outline(), SHAPE_POLY_SET::Parse(), PCB_PARSER::parseOutlinePoints(), ALTIUM_PCB::ParseRegions6Data(), partitionPolyIntoRegularCellGrid(), BRDITEMS_PLOTTER::PlotPcbShape(), PNS::VIA::PushoutForce(), PNS::LINE_PLACER::rhWalkBase(), PNS::LINE_PLACER::routeStep(), PNS::SegmentHull(), SHAPE_LINE_CHAIN(), MARKER_BASE::ShapeToPolygon(), Slice(), PNS::OPTIMIZER::smartPadsSingle(), PNS::MEANDER_SHAPE::start(), TestConcaveSquareFillet(), PNS::tightenSegment(), PNS::LINE_PLACER::Trace(), TransformCircleToPolygon(), unfracture(), SHAPE_POLY_SET::unfractureSingle(), and PNS::LINE::Walkaround().
|
inline |
Definition at line 812 of file shape_line_chain.h.
References m_arcs.
Referenced by PNS::NODE::Add(), BOOST_AUTO_TEST_CASE(), Collide(), Collide(), PNS::MEANDER_PLACER::doMove(), PNS::LINE_PLACER::FixRoute(), PCB_PLUGIN::formatPolyPts(), ALTIUM_PCB::HelperCreateBoardOutline(), GEOM_TEST::IsOutlineValid(), PNS::DP_MEANDER_PLACER::Move(), NearestPoint(), GERBER_PLOTTER::PlotPoly(), and Slice().
|
inline |
Definition at line 796 of file shape_line_chain.h.
References m_arcs.
Referenced by PNS::NODE::Add(), PNS::LINE::ArcCount(), BOOST_AUTO_TEST_CASE(), KI_TEST::CheckShapePolySet(), Collide(), Collide(), ROUTER_PREVIEW_ITEM::drawLineChain(), PNS::LINE_PLACER::FixRoute(), and Length().
|
inline |
Return the arc index for the given segment index.
Definition at line 804 of file shape_line_chain.h.
References IsSharedPt(), and m_shapes.
Referenced by Append(), PNS::NODE::AssembleLine(), PNS::MEANDER_PLACER::doMove(), fixIndicesRotation(), PNS::LINE_PLACER::FixRoute(), PCB_PLUGIN::formatPolyPts(), PNS::LINE_PLACER::handlePullback(), ALTIUM_PCB::HelperCreateBoardOutline(), GEOM_TEST::IsOutlineValid(), PNS::LINE_PLACER::mergeHead(), PNS::DP_MEANDER_PLACER::Move(), NearestPoint(), NextShape(), GERBER_PLOTTER::PlotPoly(), RemoveShape(), Slice(), Split(), and splitArc().
double SHAPE_LINE_CHAIN::Area | ( | bool | aAbsolute = true | ) | const |
Return the area of this chain.
aAbsolute | If true, returns a positive value. Otherwise the value depends on the orientation of the chain |
Definition at line 2112 of file shape_line_chain.cpp.
References m_closed, and m_points.
Referenced by ZONE_FILLER::addHatchFillTypeOnZone(), SHAPE_POLY_SET::Area(), TEARDROP_MANAGER::computeAnchorPoints(), convertToClipper(), convertToClipper2(), ZONE_FILLER::Fill(), FOOTPRINT::GetCoverageArea(), DIALOG_BOARD_STATISTICS::getDataFromPCB(), PNS::MOUSE_TRAIL_TRACER::GetPosture(), unfracture(), and SHAPE_POLY_SET::unfractureSingle().
|
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 435 of file shape_line_chain.h.
References BOX2< Vec >::Compute(), BOX2< Vec >::Inflate(), m_points, and m_width.
Referenced by SHAPE_SIMPLE::BBox(), PNS::KEEP_TOPOLOGY_CONSTRAINT::Check(), AR_AUTOPLACER::fillMatrix(), POLYGON_TEST::FindPairs(), DIALOG_BOARD_STATISTICS::getDataFromPCB(), Intersect(), FABMASTER::loadZones(), PNS::COMPONENT_DRAGGER::Start(), and PolygonTriangulation::TesselatePolygon().
|
inherited |
Definition at line 703 of file wrlfacet.cpp.
References IFSG_NODE::AddChildNode(), IFSG_INDEX::AddIndex(), IFSG_NODE::AddRefNode(), SHAPE::facets, IFSG_NODE::GetRawPtr(), S3D::GetSGNodeParent(), IFSG_FACESET::NewNode(), IFSG_SHAPE::NewNode(), IFSG_COLORS::SetColorList(), IFSG_COORDS::SetCoordsList(), IFSG_NORMALS::SetNormalList(), SGPOINT::x, SGPOINT::y, and SGPOINT::z.
Referenced by WRL2FACESET::TranslateToSG(), X3DIFACESET::TranslateToSG(), and WRL1FACESET::TranslateToSG().
|
inline |
Definition at line 421 of file shape_line_chain.h.
References m_arcs.
Referenced by ROUTER_PREVIEW_ITEM::drawLineChain(), PNS::LINE_PLACER::handlePullback(), IsChainCircle(), Length(), STEP_PCB_MODEL::MakeShapeAsCylinder(), and PNS::LINE_PLACER::mergeHead().
|
inlinevirtualinherited |
Compute a center-of-mass of the shape.
Definition at line 230 of file shape.h.
References SHAPE::BBox(), and BOX2< Vec >::Centre().
Referenced by Collide().
bool SHAPE_LINE_CHAIN::CheckClearance | ( | const VECTOR2I & | aP, |
const int | aDist | ||
) | const |
Check if point aP is closer to (or on) an edge or vertex of the line chain.
aP | is the point to check. |
aDist | is the distance in internal units. |
Definition at line 1701 of file shape_line_chain.cpp.
References SEG::A, SEG::B, CSegment(), SEG::Distance(), m_points, PointCount(), and SegmentCount().
|
inline |
Return the last point in the line chain.
Definition at line 413 of file shape_line_chain.h.
References m_points, and PointCount().
Referenced by BOOST_AUTO_TEST_CASE(), PNS::DP_GATEWAYS::buildDpContinuation(), EDA_SHAPE::continueEdit(), POLYGON_GEOM_MANAGER::DeleteLastCorner(), EDA_SHAPE::endEdit(), and POLYGON_GEOM_MANAGER::updateTemporaryLines().
|
inline |
Remove all points from the line chain.
Definition at line 243 of file shape_line_chain.h.
References m_arcs, m_closed, m_points, and m_shapes.
Referenced by PNS::LINE_PLACER::buildInitialLine(), SHAPE_SIMPLE::Clear(), PNS::DIFF_PAIR::Clear(), PNS::LINE::Clear(), PNS::MOUSE_TRAIL_TRACER::Clear(), PNS::LINE::ClipToNearestObstacle(), KI_TEST::CommonTestData::CommonTestData(), PNS::MEANDER_PLACER::doMove(), PNS::LINE_PLACER::FixRoute(), PNS::MOUSE_TRAIL_TRACER::GetPosture(), PNS::LINE_PLACER::handlePullback(), PNS::LINE_PLACER::handleSelfIntersections(), PNS::LINE_PLACER::initPlacement(), IteratorFixture::IteratorFixture(), PNS::TOPOLOGY::LeadingRatLine(), PNS::MEANDER_SHAPE::MakeArc(), PNS::MEANDER_SHAPE::MakeCorner(), DSN::SPECCTRA_DB::makeIMAGE(), PNS::DP_MEANDER_PLACER::Move(), PNS::SHOVE::onReverseCollidingVia(), PNS::LINE_PLACER::optimizeTailHeadTransition(), PNS::LINE_PLACER::reduceTail(), POLYGON_GEOM_MANAGER::Reset(), PNS::LINE_PLACER::SetLayer(), PNS::MEANDER_SHAPE::start(), PNS::tightenSegment(), PNS::LINE_PLACER::UnfixRoute(), and POLYGON_GEOM_MANAGER::updateTemporaryLines().
void SHAPE_LINE_CHAIN::ClearArcs | ( | ) |
Remove all arc references in the line chain, resulting in a chain formed only of straight segments.
Any arcs in the chain are removed and only the piecewise linear approximation remains.
Definition at line 680 of file shape_line_chain.cpp.
References convertArc(), and m_arcs.
Referenced by ConvertOutlineToPolygon().
|
overridevirtual |
Return a dynamically allocated copy of the shape.
copy | of the shape |
Reimplemented from SHAPE.
Definition at line 2033 of file shape_line_chain.cpp.
References SHAPE_LINE_CHAIN().
|
overridevirtual |
Check if segment aSeg lies closer to us than aClearance.
Note: This is overridden as we want to ensure we test collisions with the arcs in this chain as true arcs rather than segment approximations.
aSeg | the segment to check for collisions with |
aClearance | minimum distance that does not qualify as a collision. |
aActual | an optional pointer to an int to store the actual distance in the event of a collision. |
Reimplemented from SHAPE_LINE_CHAIN_BASE.
Definition at line 571 of file shape_line_chain.cpp.
References SEG::A, Arc(), ArcCount(), SHAPE_ARC::Collide(), VECTOR2< int >::ECOORD_MAX, GetSegment(), GetSegmentCount(), SHAPE_ARC::GetWidth(), IsArcSegment(), IsClosed(), SEG::NearestPoint(), SHAPE_LINE_CHAIN_BASE::PointInside(), SEG::Square(), and SEG::SquaredDistance().
|
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_COMPOUND, SHAPE_RECT, and SHAPE_SEGMENT.
Definition at line 1109 of file shape_collisions.cpp.
References collideShapes().
|
virtualinherited |
Reimplemented in SHAPE_ARC, SHAPE_COMPOUND, SHAPE_POLY_SET, SHAPE_RECT, and SHAPE_SEGMENT.
Definition at line 1115 of file shape_collisions.cpp.
References collideShapes().
|
overridevirtual |
Check if point aP lies closer to us than aClearance.
Note: This is overridden as we want to ensure we test collisions with the arcs in this chain as true arcs rather than segment approximations.
aP | the point to check for collisions with |
aClearance | minimum distance that does not qualify as a collision. |
aActual | an optional pointer to an int to store the actual distance in the event of a collision. |
Reimplemented from SHAPE_LINE_CHAIN_BASE.
Definition at line 438 of file shape_line_chain.cpp.
References Arc(), ArcCount(), SHAPE_ARC::Collide(), VECTOR2< int >::ECOORD_MAX, GetSegment(), GetSegmentCount(), SHAPE_ARC::GetWidth(), IsArcSegment(), IsClosed(), SEG::NearestPoint(), SHAPE_LINE_CHAIN_BASE::PointInside(), and SEG::Square().
Referenced by PNS::MEANDERED_LINE::CheckSelfIntersections(), SHAPE_SIMPLE::Collide(), PCB_SELECTION_TOOL::hitTestDistance(), DRC_RTREE::QueryColliding(), and DRC_TEST_PROVIDER_PHYSICAL_CLEARANCE::testZoneLayer().
bool SHAPE_LINE_CHAIN::CompareGeometry | ( | const SHAPE_LINE_CHAIN & | aOther | ) | const |
Definition at line 2007 of file shape_line_chain.cpp.
References CPoint(), m_points, and Simplify().
Referenced by PNS::LINE::CompareGeometry().
|
protected |
Convert an arc to only a point chain by removing the arc and references.
aArcIndex | index of the arc to convert to points |
Definition at line 258 of file shape_line_chain.cpp.
References m_arcs, m_shapes, alg::run_on_pair(), and SHAPE_IS_PT.
Referenced by ClearArcs(), Remove(), and SetPoint().
|
protected |
Create a new Clipper path from the SHAPE_LINE_CHAIN in a given orientation.
Definition at line 145 of file shape_line_chain.cpp.
References Area(), CPoint(), m_arcs, m_shapes, PointCount(), Reverse(), VECTOR2< T >::x, and VECTOR2< T >::y.
|
protected |
Create a new Clipper2 path from the SHAPE_LINE_CHAIN in a given orientation.
Definition at line 179 of file shape_line_chain.cpp.
References Area(), CPoint(), m_arcs, m_shapes, PointCount(), Reverse(), VECTOR2< T >::x, and VECTOR2< T >::y.
|
inline |
Return a reference to a given point in the line chain.
aIndex | is the index of the point. |
Definition at line 395 of file shape_line_chain.h.
References m_points, and PointCount().
Referenced by LABEL_MANAGER::Add(), EE_POINT_EDITOR::addCorner(), POLYGON_GEOM_MANAGER::AddPoint(), SHAPE_LINE_CHAIN::POINT_INSIDE_TRACKER::AddPolyline(), TRIANGLE_DISPLAY_LIST::AddToMiddleContourns(), PNS::MOUSE_TRAIL_TRACER::AddTrailPoint(), PNS_LOG_VIEWER_OVERLAY::AnnotatedPolyline(), Append(), PNS::LINE::AppendVia(), ArePolylineEndPointsNearCircle(), ArePolylineMidPointsNearCircle(), PNS::NODE::AssembleLine(), PNS::TOPOLOGY::AssembleTuningPath(), BOOST_AUTO_TEST_CASE(), build45DegLeader(), BuildBoardPolygonOutlines(), BuildConvexHull(), PAD::BuildEffectivePolygon(), PAD::BuildEffectiveShapes(), PNS::LINE_PLACER::buildInitialLine(), SHAPE_POLY_SET::chamferFilletPolygon(), PNS::LINE::ChangedArea(), PNS::KEEP_TOPOLOGY_CONSTRAINT::Check(), CN_VISITOR::checkZoneZoneConnection(), CompareGeometry(), EDA_SHAPE::continueEdit(), ConvertOutlineToPolygon(), convertPolygon(), convertToClipper(), convertToClipper2(), PNS::coupledBypass(), PNS::LINE::CPoint(), SHAPE_SIMPLE::CPoint(), PolygonTriangulation::createList(), POLYGON_TEST::createList(), CreatePadsShapesSection(), PNS::LINE_PLACER::cursorDistMinimum(), PNS::LINE::dragCorner45(), PNS::dragCornerInternal(), KIGFX::PCB_PAINTER::draw(), KIGFX::CAIRO_GAL_BASE::drawPoly(), KIGFX::OPENGL_GAL::DrawPolygon(), KIGFX::OPENGL_GAL::DrawPolyline(), KIGFX::CAIRO_GAL_BASE::DrawSegmentChain(), KIGFX::OPENGL_GAL::DrawSegmentChain(), EDA_SHAPE::endEdit(), EXPORTER_PCB_VRML::ExportVrmlBoard(), EXPORTER_PCB_VRML::ExportVrmlPolygonSet(), DSN::SPECCTRA_DB::fillBOUNDARY(), AR_AUTOPLACER::fillMatrix(), Find(), TEARDROP_MANAGER::findAnchorPointsOnTrack(), PNS::LINE_PLACER::FixRoute(), CADSTAR_SCH_ARCHIVE_LOADER::fixUpLibraryPins(), GERBER_PLOTTER::FlashPadChamferRoundRect(), DXF_PLOTTER::FlashPadCustom(), HPGL_PLOTTER::FlashPadCustom(), PSLIKE_PLOTTER::FlashPadCustom(), GERBER_PLOTTER::FlashPadCustom(), DXF_PLOTTER::FlashPadRoundRect(), GERBER_PLOTTER::FlashPadRoundRect(), HPGL_PLOTTER::FlashPadRoundRect(), PSLIKE_PLOTTER::FlashPadRoundRect(), PNS::TOPOLOGY::followTrivialPath(), PCB_PLUGIN::formatPolyPts(), APERTURE_MACRO::GetApertureMacroShape(), PCB_SHAPE::GetFocusPosition(), GetPoint(), SHAPE_SIMPLE::GetPoint(), PNS::MOUSE_TRAIL_TRACER::GetPosture(), CADSTAR_SCH_ARCHIVE_LOADER::getScaledLibPart(), PNS::MOUSE_TRAIL_TRACER::GetTrailLeadVector(), PNS::LINE_PLACER::handleSelfIntersections(), DS_DRAW_ITEM_POLYPOLYGONS::HitTest(), GEOM_TEST::IsOutlineValid(), POLYGON_GEOM_MANAGER::IsSelfIntersecting(), DSN::SPECCTRA_DB::makeIMAGE(), DSN::SPECCTRA_DB::makePADSTACK(), STEP_PCB_MODEL::MakeShape(), PNS::LINE_PLACER::mergeHead(), PNS::MEANDER_SHAPE::miter(), PNS::DP_MEANDER_PLACER::Move(), PNS::LINE_PLACER::Move(), NearestPoint(), POLYGON_GEOM_MANAGER::NewPointClosesOutline(), ZONE_CREATE_HELPER::OnComplete(), operator!=(), BOOST_TEST_PRINT_NAMESPACE_OPEN::print_log_value< SHAPE_LINE_CHAIN >::operator()(), BITMAPCONV_INFO::outputOnePolygon(), SCH_SEXPR_PARSER::ParseSchematic(), PlotDrawingSheet(), PLOTTER::PlotPoly(), GERBER_PLOTTER::PlotPoly(), PointAlong(), PNS::pointInside2(), polygon_Convert(), SCH_SHAPE::Print(), LIB_SHAPE::print(), SCH_SHAPE::PrintBackground(), GERBER_DRAW_ITEM::PrintGerberPoly(), DS_DRAW_ITEM_POLYPOLYGONS::PrintWsItem(), DRC_RTREE::QueryColliding(), PNS::LINE_PLACER::removeLoops(), PNS::LINE_PLACER::rhWalkBase(), PNS::DIFF_PAIR_PLACER::routeHead(), DRC_TEST_PROVIDER_CONNECTION_WIDTH::Run(), PNS::OPTIMIZER::runSmartPads(), KIGFX::PREVIEW::POLYGON_ITEM::SetPoints(), PNS::shovedArea(), PNS::SHOVE::shoveLineFromLoneVia(), PNS::SHOVE::shoveLineToHullSet(), Simplify(), PNS::OPTIMIZER::smartPadsSingle(), PNS::COMPONENT_DRAGGER::Start(), unfracture(), SHAPE_POLY_SET::unfractureSingle(), PNS::MEANDER_SHAPE::updateBaseSegment(), PNS::LINE_PLACER::updatePStart(), PNS::LINE::Walkaround(), HYPERLYNX_EXPORTER::writeNetObjects(), GBR_TO_PCB_EXPORTER::writePcbPolygon(), and GBR_TO_PCB_EXPORTER::writePcbZoneItem().
|
inline |
Definition at line 405 of file shape_line_chain.h.
References m_points.
Referenced by PNS::TOPOLOGY::AssembleTuningPath(), BOOST_AUTO_TEST_CASE(), TEARDROP_MANAGER::computeAnchorPoints(), DIALOG_PAD_PRIMITIVE_POLY_PROPS::DIALOG_PAD_PRIMITIVE_POLY_PROPS(), DIALOG_PAD_PRIMITIVE_POLY_PROPS::doValidate(), KIGFX::SCH_PAINTER::draw(), KIGFX::GERBVIEW_PAINTER::draw(), KIGFX::GERBVIEW_PAINTER::drawPolygon(), formatPoly(), PCB_SHAPE::GetCorners(), CONNECTIVITY_DATA::IsConnectedOnLayer(), CADSTAR_SCH_ARCHIVE_LOADER::loadNets(), FABMASTER::loadZones(), EDIT_POINTS_FACTORY::Make(), RN_NET::OptimizeRNEdges(), SCH_SHAPE::Plot(), LIB_SHAPE::Plot(), GERBER_PLOTTER::PlotPoly(), EE_POINT_EDITOR::removeCornerCondition(), DRC_TEST_PROVIDER_SLIVER_CHECKER::Run(), SCH_LEGACY_PLUGIN_CACHE::savePolyLine(), EDA_SHAPE::scale(), SHAPE_LINE_CHAIN(), PNS_KICAD_IFACE_BASE::syncTextItem(), and EE_POINT_EDITOR::updatePoints().
|
inline |
Return a constant copy of the aIndex segment in the line chain.
aIndex | is the index of the segment in the line chain. Negative values are counted from the end (i.e. -1 means the last segment in the line chain). |
Definition at line 350 of file shape_line_chain.h.
References m_closed, m_points, and SegmentCount().
Referenced by PNS::NODE::Add(), PNS::MOUSE_TRAIL_TRACER::AddTrailPoint(), PNS::ArcHull(), PNS::LINE_PLACER::buildInitialLine(), PNS::LINE::ChangedArea(), PNS::PRESERVE_VERTEX_CONSTRAINT::Check(), CheckClearance(), PNS::NODE::CheckColliding(), PNS::DIFF_PAIR::CheckConnectionAngle(), PNS::checkGap(), PNS::MEANDERED_LINE::CheckSelfIntersections(), PNS::LINE::ClipToNearestObstacle(), PNS::closestProjectedPoint(), PNS::COST_ESTIMATOR::CornerCost(), PNS::LINE::CountCorners(), PNS::coupledBypass(), PNS::DIFF_PAIR::CoupledLength(), PNS::LINE::CSegment(), PNS::LINE_PLACER::cursorDistMinimum(), PNS::MEANDER_PLACER_BASE::cutTunedLine(), PNS::MEANDER_PLACER::doMove(), PNS::dragCornerInternal(), PNS::findCoupledVertices(), FindSegment(), PNS::DIFF_PAIR_PLACER::FixRoute(), PNS::LINE_PLACER::FixRoute(), EDA_SHAPE::GetLength(), PNS::MOUSE_TRAIL_TRACER::GetPosture(), GetSegment(), SHAPE_SIMPLE::GetSegment(), PNS::LINE_PLACER::handlePullback(), PNS::LINE_PLACER::handleSelfIntersections(), PNS::HullIntersection(), Intersect(), isLine45Degree(), Length(), PNS::OPTIMIZER::mergeColinear(), PNS::OPTIMIZER::mergeDpStep(), PNS::LINE_PLACER::mergeHead(), PNS::OPTIMIZER::mergeObtuse(), PNS::OPTIMIZER::mergeStep(), PNS::NODE::NearestObstacle(), NearestPoint(), NearestSegment(), PathLength(), PointAlong(), KIGFX::VIEW_OVERLAY::Polyline(), PNS::LINE_PLACER::reduceTail(), DRC_TEST_PROVIDER_EDGE_CLEARANCE::Run(), PNS::SegmentHull(), SelfIntersecting(), PNS::OPTIMIZER::smartPadsSingle(), PNS::LINE::snapDraggedCorner(), PNS::LINE::snapToNeighbourSegments(), Split(), DRC_TEST_PROVIDER_PHYSICAL_CLEARANCE::testShapeLineChain(), PNS::tightenSegment(), SHAPE_POLY_SET::unfractureSingle(), and HYPERLYNX_EXPORTER::writeBoardInfo().
|
inline |
Definition at line 429 of file shape_line_chain.h.
References m_shapes.
Referenced by Append(), and BOOST_AUTO_TEST_CASE().
int SHAPE_LINE_CHAIN::Distance | ( | const VECTOR2I & | aP, |
bool | aOutlineOnly = false |
||
) | const |
Compute the minimum distance between the line chain and a point aP.
aP | the point. |
Definition at line 878 of file shape_line_chain.cpp.
References SHAPE_LINE_CHAIN_BASE::SquaredDistance().
Referenced by PAD::GetBestAnchorPosition().
|
inherited |
Check if point aP lies on an edge or vertex of the line chain.
aP | point to check |
Definition at line 1674 of file shape_line_chain.cpp.
References SEG::A, SEG::B, SEG::Distance(), SHAPE_LINE_CHAIN_BASE::GetPoint(), SHAPE_LINE_CHAIN_BASE::GetPointCount(), SHAPE_LINE_CHAIN_BASE::GetSegment(), SHAPE_LINE_CHAIN_BASE::GetSegmentCount(), VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by SHAPE_LINE_CHAIN_BASE::PointOnEdge().
int SHAPE_LINE_CHAIN::Find | ( | const VECTOR2I & | aP, |
int | aThreshold = 0 |
||
) | const |
Search for point aP.
aP | is the point to be looked for. |
Definition at line 951 of file shape_line_chain.cpp.
References CPoint(), and PointCount().
Referenced by PNS::MEANDER_PLACER_BASE::cutTunedLine(), PNS::DRAGGER::dragViaMarkObstacles(), PNS::DRAGGER::dragViaWalkaround(), PNS::NODE::FindLinesBetweenJoints(), PNS::DRAGGER::optimizeAndUpdateDraggedLine(), Split(), PNS::LINE_PLACER::splitHeadTail(), and PNS::LINE::Walkaround().
int SHAPE_LINE_CHAIN::FindSegment | ( | const VECTOR2I & | aP, |
int | aThreshold = 1 |
||
) | const |
Search for segment containing point aP.
aP | is the point to be looked for. |
Definition at line 971 of file shape_line_chain.cpp.
References CSegment(), SEG::Distance(), and SegmentCount().
Referenced by PNS::MEANDER_PLACER_BASE::cutTunedLine(), and CADSTAR_SCH_ARCHIVE_LOADER::loadNets().
|
protected |
Fix indices of this chain to ensure arcs are not split between the end and start indices.
Definition at line 213 of file shape_line_chain.cpp.
References ArcIndex(), m_arcs, m_points, m_shapes, and SHAPE_IS_PT.
Referenced by mergeFirstLastPointIfNeeded(), and SHAPE_LINE_CHAIN().
|
overridevirtual |
Reimplemented from SHAPE.
Definition at line 1978 of file shape_line_chain.cpp.
References m_closed, m_points, and PointCount().
Referenced by PNS::SHOVE::shoveLineToHullSet().
|
inline |
Definition at line 446 of file shape_line_chain.h.
References BOX2< Vec >::Compute(), BOX2< Vec >::Inflate(), m_bbox, m_points, and m_width.
Referenced by SHAPE_POLY_SET::BuildBBoxCaches().
|
inlineoverridevirtual |
Reimplemented from SHAPE_LINE_CHAIN_BASE.
Definition at line 454 of file shape_line_chain.h.
References m_bbox.
|
inherited |
Return the actual minimum distance between two shapes.
distance | in IU |
Definition at line 49 of file shape.cpp.
References SHAPE_BASE::GetIndexableSubshapeCount(), and SHAPE_BASE::GetIndexableSubshapes().
|
inlinevirtualinherited |
Reimplemented in SHAPE_COMPOUND, and SHAPE_POLY_SET.
Definition at line 111 of file shape.h.
Referenced by SHAPE::GetClearance().
|
inlinevirtualinherited |
Reimplemented in SHAPE_COMPOUND, and SHAPE_POLY_SET.
Definition at line 113 of file shape.h.
Referenced by SHAPE_COMPOUND::AddShape(), SHAPE::GetClearance(), and ROUTER_PREVIEW_ITEM::ViewDraw().
|
inlineoverridevirtual |
Implements SHAPE_LINE_CHAIN_BASE.
Definition at line 873 of file shape_line_chain.h.
References CPoint().
Referenced by CADSTAR_ARCHIVE_PARSER::VERTEX::AppendToChain(), PNS::TOPOLOGY::AssembleTuningPath(), BOOST_AUTO_TEST_CASE(), BuildFootprintPolygonOutlines(), KI_TEST::CheckShapePolySet(), PNS::LINE::dragCornerFree(), CADSTAR_PCB_ARCHIVE_LOADER::getLineChainFromShapes(), EDA_SHAPE::hitTest(), CONVERT_TOOL::makePolysFromChainedSegs(), RN_NET::OptimizeRNEdges(), Split(), EDA_SHAPE::TransformShapeToPolygon(), and PCB_TEXTBOX::TransformShapeToPolygon().
|
inlineoverridevirtual |
Implements SHAPE_LINE_CHAIN_BASE.
Definition at line 875 of file shape_line_chain.h.
References PointCount().
Referenced by EE_POINT_EDITOR::addCorner(), EDA_SHAPE::calcEdit(), EDA_SHAPE::continueEdit(), EDA_SHAPE::endEdit(), CADSTAR_SCH_ARCHIVE_LOADER::fixUpLibraryPins(), LIB_SHAPE::GetItemDescription(), SCH_SHAPE::GetItemDescription(), CADSTAR_SCH_ARCHIVE_LOADER::getScaledLibPart(), EDA_SHAPE::hitTest(), SCH_SHAPE::Print(), LIB_SHAPE::print(), SCH_SHAPE::PrintBackground(), EE_POINT_EDITOR::removeCorner(), EE_POINT_EDITOR::removeCornerCondition(), SCH_LEGACY_PLUGIN_CACHE::savePolyLine(), and EDA_SHAPE::TransformShapeToPolygon().
|
inlineoverridevirtual |
Implements SHAPE_LINE_CHAIN_BASE.
Definition at line 874 of file shape_line_chain.h.
References CSegment().
Referenced by Collide(), Collide(), PCB_GRID_HELPER::computeAnchors(), ConvertOutlineToPolygon(), EDA_SHAPE::TransformShapeToPolygon(), and PCB_TEXTBOX::TransformShapeToPolygon().
|
inlineoverridevirtual |
Implements SHAPE_LINE_CHAIN_BASE.
Definition at line 876 of file shape_line_chain.h.
References SegmentCount().
Referenced by Collide(), Collide(), PCB_GRID_HELPER::computeAnchors(), and DRC_TEST_PROVIDER_EDGE_CLEARANCE::Run().
|
inlinevirtualinherited |
Reimplemented in SHAPE_COMPOUND, and SHAPE_POLY_SET.
Definition at line 106 of file shape.h.
Referenced by SHAPE_COMPOUND::AddShape(), and ROUTER_PREVIEW_ITEM::ViewDraw().
void SHAPE_LINE_CHAIN::Insert | ( | size_t | aVertex, |
const SHAPE_ARC & | aArc | ||
) |
Step 1: Find the position for the new arc in the existing arc vector
Step 2: Add the arc polyline points to the chain
Step 3: Add the vector of indices to the shape vector
Definition at line 1381 of file shape_line_chain.cpp.
References SHAPE_ARC::ConvertToPolyline(), IsPtOnArc(), m_arcs, m_points, m_shapes, alg::run_on_pair(), SHAPE_ARC::SetWidth(), SHAPES_ARE_PT, and splitArc().
void SHAPE_LINE_CHAIN::Insert | ( | size_t | aVertex, |
const VECTOR2I & | aP | ||
) |
Definition at line 1360 of file shape_line_chain.cpp.
References Append(), IsPtOnArc(), m_points, m_shapes, SHAPES_ARE_PT, and splitArc().
Referenced by EE_POINT_EDITOR::addCorner(), PNS::TOPOLOGY::AssembleTuningPath(), PNS::LINE::dragCorner45(), PNS::LINE::dragCornerFree(), CONVERT_TOOL::makePolysFromChainedSegs(), Replace(), and Split().
int SHAPE_LINE_CHAIN::Intersect | ( | const SEG & | aSeg, |
INTERSECTIONS & | aIp | ||
) | const |
Find all intersection points between our line chain and the segment aSeg.
aSeg | is the segment chain to find intersections with. |
aIp | is the reference to a vector to store found intersections. Intersection points are sorted with increasing distances from point aSeg.a. |
Definition at line 1447 of file shape_line_chain.cpp.
References SEG::A, CSegment(), SHAPE_LINE_CHAIN::INTERSECTION::index_our, SHAPE_LINE_CHAIN::INTERSECTION::index_their, SEG::Intersect(), SHAPE_LINE_CHAIN::INTERSECTION::is_corner_our, SHAPE_LINE_CHAIN::INTERSECTION::is_corner_their, SHAPE_LINE_CHAIN::INTERSECTION::p, SegmentCount(), and SHAPE_LINE_CHAIN::INTERSECTION::valid.
Referenced by PNS::OPTIMIZER::customBreakouts(), TEARDROP_MANAGER::findAnchorPointsOnTrack(), PNS::LINE_PLACER::handleSelfIntersections(), PNS::HullIntersection(), Intersects(), and CADSTAR_SCH_ARCHIVE_LOADER::loadNets().
int SHAPE_LINE_CHAIN::Intersect | ( | const SHAPE_LINE_CHAIN & | aChain, |
INTERSECTIONS & | aIp, | ||
bool | aExcludeColinearAndTouching = false , |
||
BOX2I * | aChainBBox = nullptr |
||
) | const |
Find all intersection points between our line chain and the line chain aChain.
aChain | is the line chain to find intersections with. |
aIp | is reference to a vector to store found intersections. Intersection points are sorted with increasing path lengths from the starting point of aChain. |
Definition at line 1485 of file shape_line_chain.cpp.
References SEG::A, addIntersection(), SEG::B, BBox(), SEG::Collinear(), SEG::Contains(), CSegment(), SHAPE_LINE_CHAIN::INTERSECTION::index_our, SHAPE_LINE_CHAIN::INTERSECTION::index_their, SEG::Intersect(), BOX2< Vec >::Intersects(), SHAPE_LINE_CHAIN::INTERSECTION::is_corner_our, SHAPE_LINE_CHAIN::INTERSECTION::is_corner_their, SHAPE_LINE_CHAIN::INTERSECTION::p, PointCount(), SegmentCount(), and SHAPE_LINE_CHAIN::INTERSECTION::valid.
bool SHAPE_LINE_CHAIN::Intersects | ( | const SHAPE_LINE_CHAIN & | aChain | ) | const |
Definition at line 2026 of file shape_line_chain.cpp.
References dummy, and Intersect().
Referenced by PNS::DIFF_PAIR::BuildInitial().
|
inline |
Definition at line 868 of file shape_line_chain.h.
References IsArcSegment(), IsPtOnArc(), and IsSharedPt().
Referenced by BOOST_AUTO_TEST_CASE(), NearestPoint(), and splitArc().
|
inline |
Definition at line 836 of file shape_line_chain.h.
References IsPtOnArc(), IsSharedPt(), m_closed, and m_shapes.
Referenced by PNS::NODE::Add(), Append(), PNS::LINE::ClipToNearestObstacle(), Collide(), Collide(), PNS::MEANDER_PLACER::doMove(), PNS::LINE::dragCornerFree(), IsArcEnd(), IsArcStart(), isLine45Degree(), Length(), PNS::LINE_PLACER::mergeHead(), PNS::OPTIMIZER::mergeStep(), PNS::DP_MEANDER_PLACER::Move(), NearestPoint(), PNS::SHOVE::ShoveObstacleLine(), Slice(), and Split().
|
inline |
Definition at line 859 of file shape_line_chain.h.
References IsArcSegment(), IsPtOnArc(), and IsSharedPt().
Referenced by BOOST_AUTO_TEST_CASE(), ALTIUM_PCB::HelperCreateBoardOutline(), NearestPoint(), Slice(), and splitArc().
|
inlineoverridevirtual |
Implements SHAPE_LINE_CHAIN_BASE.
Definition at line 266 of file shape_line_chain.h.
References m_closed.
Referenced by SHAPE_POLY_SET::AddOutline(), ZONE::AddPolygon(), BuildFootprintPolygonOutlines(), Collide(), Collide(), KIGFX::CAIRO_GAL_BASE::drawPoly(), KIGFX::OPENGL_GAL::DrawPolyline(), KIGFX::CAIRO_GAL_BASE::DrawSegmentChain(), KIGFX::OPENGL_GAL::DrawSegmentChain(), EDA_SHAPE::hitTest(), EDA_SHAPE::IsClosed(), STEP_PCB_MODEL::MakeShape(), STEP_PCB_MODEL::MakeShapeAsCylinder(), PLOTTER::PlotPoly(), GERBER_PLOTTER::PlotPoly(), PNS::pointInside2(), SelfIntersecting(), and DRC_TEST_PROVIDER_PHYSICAL_CLEARANCE::testShapeLineChain().
|
inlineinherited |
Return true if the shape is a null shape.
true | if null :-) |
Definition at line 164 of file shape.h.
References SHAPE_BASE::m_type, and SH_NULL.
|
inline |
Definition at line 830 of file shape_line_chain.h.
References m_shapes, and SHAPES_ARE_PT.
Referenced by BOOST_AUTO_TEST_CASE(), PNS::LINE::dragCorner45(), PNS::LINE::dragCornerFree(), PNS::LINE_PLACER::FixRoute(), PNS::LINE_PLACER::handlePullback(), Insert(), IsArcEnd(), IsArcSegment(), IsArcStart(), PNS::OPTIMIZER::mergeColinear(), PNS::LINE_PLACER::mergeHead(), Remove(), splitArc(), and PNS::DRAGGER::startDragSegment().
|
inline |
Test if a point is shared between multiple shapes.
aIndex |
Definition at line 822 of file shape_line_chain.h.
References m_shapes, and SHAPE_IS_PT.
Referenced by ArcIndex(), BOOST_AUTO_TEST_CASE(), IsArcEnd(), IsArcSegment(), IsArcStart(), GEOM_TEST::IsOutlineValid(), Remove(), RemoveShape(), reversedArcIndex(), and splitArc().
|
inlineoverridevirtual |
Implements SHAPE.
Definition at line 782 of file shape_line_chain.h.
long long int SHAPE_LINE_CHAIN::Length | ( | ) | const |
Return length of the line chain in Euclidean metric.
Definition at line 687 of file shape_line_chain.cpp.
References ArcCount(), CArcs(), CSegment(), IsArcSegment(), SEG::Length(), and SegmentCount().
Referenced by PNS::COST_ESTIMATOR::Add(), PNS::LINE_PLACER::clipAndCheckCollisions(), PNS::MEANDER_SHAPE::CurrentLength(), PNS::MEANDER_PLACER::doMove(), PNS::LINE::dragSegment45(), PNS::OPTIMIZER::fanoutCleanup(), PNS::DP_MEANDER_PLACER::Move(), PNS::SHOVE::onCollidingArc(), PNS::SHOVE::onCollidingSegment(), PNS::COST_ESTIMATOR::Remove(), PNS::COST_ESTIMATOR::Replace(), PNS::LINE_PLACER::rhWalkBase(), PNS::WALKAROUND::Route(), PNS::SHOVE::shoveLineFromLoneVia(), PNS::DIFF_PAIR::Skew(), PNS::OPTIMIZER::smartPadsSingle(), PNS::DIFF_PAIR::TotalLength(), and PNS::DRAGGER::tryWalkaround().
|
protected |
Merge the first and last point if they are the same and this chain is closed.
Definition at line 237 of file shape_line_chain.cpp.
References fixIndicesRotation(), m_closed, m_points, m_shapes, and SHAPES_ARE_PT.
Referenced by Append(), and SetClosed().
void SHAPE_LINE_CHAIN::Mirror | ( | bool | aX = true , |
bool | aY = false , |
||
const VECTOR2I & | aRef = { 0, 0 } |
||
) |
Mirror the line points about y or x (or both).
aX | If true, mirror about the y axis (flip X coordinate). |
aY | If true, mirror about the x axis (flip Y coordinate). |
aRef | sets the reference point about which to mirror. |
Definition at line 705 of file shape_line_chain.cpp.
References m_arcs, m_points, VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by GBR_TO_PCB_EXPORTER::export_flashed_copper_item(), and PNS::MEANDER_SHAPE::genMeanderShape().
void SHAPE_LINE_CHAIN::Mirror | ( | const SEG & | axis | ) |
Mirror the line points using an given axis.
axis | is the axis on which to mirror. |
Definition at line 721 of file shape_line_chain.cpp.
References m_arcs, m_points, and SEG::ReflectPoint().
|
inlineoverridevirtual |
Implements SHAPE.
Definition at line 747 of file shape_line_chain.h.
References m_arcs, m_bbox, m_points, and BOX2< Vec >::Move().
Referenced by ZONE_FILLER::addHatchFillTypeOnZone(), PAD::BuildEffectiveShapes(), PCB_GRID_HELPER::computeAnchors(), PLACEFILE_GERBER_WRITER::CreatePlaceFile(), PCB_SELECTION_TOOL::hitTestDistance(), and SHAPE_SIMPLE::Move().
Find a point on the line chain that is closest to the line defined by the points of segment aSeg, also returns the distance.
aSeg | is the segment defining the line. |
dist | is the reference receiving the distance to the nearest point. |
Definition at line 1931 of file shape_line_chain.cpp.
References CPoint(), SEG::LineDistance(), and PointCount().
const VECTOR2I SHAPE_LINE_CHAIN::NearestPoint | ( | const VECTOR2I & | aP, |
bool | aAllowInternalShapePoints = true |
||
) | const |
Find a point on the line chain that is closest to point aP.
aP | is the point to find. |
aAllowInternalShapePoints | if false will not return points internal to an arc (i.e. only the arc endpoints are possible candidates) |
Definition at line 1873 of file shape_line_chain.cpp.
References SEG::A, Arc(), ArcIndex(), SEG::B, CSegment(), SEG::Distance(), VECTOR2< T >::EuclideanNorm(), SHAPE_ARC::GetP0(), SHAPE_ARC::GetP1(), IsArcEnd(), IsArcSegment(), IsArcStart(), m_points, SEG::NearestPoint(), PointCount(), and SegmentCount().
Referenced by FOOTPRINT::CheckNetTies(), PCB_GRID_HELPER::computeAnchors(), PNS::MEANDER_PLACER_BASE::cutTunedLine(), CADSTAR_SCH_ARCHIVE_LOADER::loadBusses(), PNS::MoveDiagonal(), and PNS::DRAGGER::optimizeAndUpdateDraggedLine().
int SHAPE_LINE_CHAIN::NearestSegment | ( | const VECTOR2I & | aP | ) | const |
Find the segment nearest the given point.
aP | is the point to compare with. |
Definition at line 1958 of file shape_line_chain.cpp.
References CSegment(), SEG::Distance(), and SegmentCount().
Referenced by PNS::LINE::ClipToNearestObstacle(), and SCH_SHEET_PIN::ConstrainOnEdge().
|
inherited |
Definition at line 695 of file wrlfacet.cpp.
References SHAPE::facets.
Referenced by WRL2FACESET::TranslateToSG(), X3DIFACESET::TranslateToSG(), and WRL1FACESET::TranslateToSG().
int SHAPE_LINE_CHAIN::NextShape | ( | int | aPointIndex, |
bool | aForwards = true |
||
) | const |
Return the vertex index of the next shape in the chain, or -1 if aPointIndex is the last shape.
If aPointIndex is the start of a segment, this will be ( aPointIndex + 1 ). If aPointIndex is part of an arc, this will be the index of the start of the next shape after the arc, in other words, the last point of the arc.
aPointIndex | is a vertex in the chain. |
aForwards | is true if the next shape is desired, false for previous shape. |
Definition at line 1033 of file shape_line_chain.cpp.
References ArcIndex(), delta, m_closed, m_shapes, alg::pair_contains(), PointCount(), reversedArcIndex(), SHAPE_IS_PT, and SHAPES_ARE_PT.
Referenced by PNS::LINE::ClipVertexRange(), PNS::MEANDER_PLACER::doMove(), ALTIUM_PCB::HelperCreateBoardOutline(), PNS::DP_MEANDER_PLACER::Move(), PrevShape(), and Slice().
|
inline |
Definition at line 731 of file shape_line_chain.h.
References CPoint(), and PointCount().
|
default |
|
overridevirtual |
Reimplemented from SHAPE.
Definition at line 2039 of file shape_line_chain.cpp.
References DEGREES_T, m_arcs, m_closed, m_points, m_shapes, SHAPE_IS_PT, VECTOR2< T >::x, and VECTOR2< T >::y.
int SHAPE_LINE_CHAIN::PathLength | ( | const VECTOR2I & | aP, |
int | aIndex = -1 |
||
) | const |
Compute the walk path length from the beginning of the line chain and the point aP belonging to our line.
Definition at line 1582 of file shape_line_chain.cpp.
References SEG::A, CSegment(), EuclideanNorm(), SEG::Length(), and SegmentCount().
Referenced by PNS::NODE::NearestObstacle().
const VECTOR2I SHAPE_LINE_CHAIN::PointAlong | ( | int | aPathLength | ) | const |
Definition at line 2087 of file shape_line_chain.cpp.
References SEG::A, SEG::B, CPoint(), CSegment(), SEG::Length(), VECTOR2< T >::Resize(), and SegmentCount().
|
inline |
Return the number of points (vertices) in this line chain.
Definition at line 320 of file shape_line_chain.h.
References m_points.
Referenced by LABEL_MANAGER::Add(), STEP_PCB_MODEL::AddCopperPolygonShapes(), POLYGON_GEOM_MANAGER::AddPoint(), SHAPE_LINE_CHAIN::POINT_INSIDE_TRACKER::AddPolyline(), TRIANGLE_DISPLAY_LIST::AddToMiddleContourns(), PNS_LOG_VIEWER_OVERLAY::AnnotatedPolyline(), Append(), CADSTAR_ARCHIVE_PARSER::VERTEX::AppendToChain(), PNS::LINE::AppendVia(), ArePolylineEndPointsNearCircle(), ArePolylineMidPointsNearCircle(), PNS::NODE::AssembleLine(), PNS::TOPOLOGY::AssembleTuningPath(), BOOST_AUTO_TEST_CASE(), build45DegLeader(), BuildConvexHull(), PAD::BuildEffectivePolygon(), PAD::BuildEffectiveShapes(), PNS_LOG_VIEWER_FRAME::buildListTree(), PNS::LINE::ChangedArea(), PNS::KEEP_TOPOLOGY_CONSTRAINT::Check(), CheckClearance(), KI_TEST::CheckShapePolySet(), CN_VISITOR::checkZoneZoneConnection(), CLastPoint(), PNS::LINE::ClipVertexRange(), ConvertOutlineToPolygon(), convertPolygon(), ALTIUM_PCB::ConvertShapeBasedRegions6ToBoardItem(), ALTIUM_PCB::ConvertShapeBasedRegions6ToBoardItemOnLayer(), ALTIUM_PCB::ConvertShapeBasedRegions6ToFootprintItem(), ALTIUM_PCB::ConvertShapeBasedRegions6ToFootprintItemOnLayer(), convertToClipper(), convertToClipper2(), PNS::coupledBypass(), CPoint(), PolygonTriangulation::createList(), POLYGON_TEST::createList(), CreatePadsShapesSection(), STEP_PCB_MODEL::CreatePCB(), PLACEFILE_GERBER_WRITER::CreatePlaceFile(), PNS::LINE_PLACER::cursorDistMinimum(), POLYGON_GEOM_MANAGER::DeleteLastCorner(), DIALOG_PAD_PRIMITIVE_POLY_PROPS::doValidate(), PNS::LINE::dragCornerFree(), PNS::dragCornerInternal(), PNS::LINE::dragSegment45(), PNS::DRAGGER::dragWalkaround(), KIGFX::PCB_PAINTER::draw(), KIGFX::GERBVIEW_PAINTER::draw(), KIGFX::CAIRO_GAL_BASE::drawPoly(), KIGFX::OPENGL_GAL::DrawPolygon(), KIGFX::OPENGL_GAL::DrawPolyline(), KIGFX::PREVIEW::POLYGON_ITEM::drawPreviewShape(), KIGFX::CAIRO_GAL_BASE::DrawSegmentChain(), KIGFX::OPENGL_GAL::DrawSegmentChain(), EDA_SHAPE::DupPolyPointsList(), EXPORTER_PCB_VRML::ExportVrmlBoard(), EXPORTER_PCB_VRML::ExportVrmlPolygonSet(), DSN::SPECCTRA_DB::fillBOUNDARY(), AR_AUTOPLACER::fillMatrix(), Find(), TEARDROP_MANAGER::findAnchorPointsOnTrack(), PNS::LINE_PLACER::FixRoute(), GERBER_PLOTTER::FlashPadChamferRoundRect(), DXF_PLOTTER::FlashPadCustom(), HPGL_PLOTTER::FlashPadCustom(), PSLIKE_PLOTTER::FlashPadCustom(), GERBER_PLOTTER::FlashPadCustom(), DXF_PLOTTER::FlashPadRoundRect(), GERBER_PLOTTER::FlashPadRoundRect(), HPGL_PLOTTER::FlashPadRoundRect(), PSLIKE_PLOTTER::FlashPadRoundRect(), Format(), PCB_PLUGIN::formatPolyPts(), APERTURE_MACRO::GetApertureMacroShape(), CADSTAR_PCB_ARCHIVE_LOADER::getLineChainFromShapes(), GetPointCount(), SHAPE_SIMPLE::GetPointCount(), CADSTAR_PCB_ARCHIVE_LOADER::getPolySetFromCadstarShape(), PNS::MOUSE_TRAIL_TRACER::GetPosture(), SHAPE_POLY_SET::GetRelativeIndices(), PNS::MOUSE_TRAIL_TRACER::GetTrailLeadVector(), PNS::LINE_PLACER::handlePullback(), PNS::LINE_PLACER::handleSelfIntersections(), ALTIUM_PCB::HelperCreateBoardOutline(), DS_DRAW_ITEM_POLYPOLYGONS::HitTest(), PNS::HullIntersection(), Intersect(), GEOM_TEST::IsOutlineValid(), POLYGON_GEOM_MANAGER::IsPolygonInProgress(), EDA_SHAPE::IsPolyShapeValid(), POLYGON_GEOM_MANAGER::IsSelfIntersecting(), FABMASTER::loadFootprints(), FABMASTER::loadGraphics(), FABMASTER::loadPolygon(), FABMASTER::loadZone(), DSN::SPECCTRA_DB::makeIMAGE(), DSN::SPECCTRA_DB::makePADSTACK(), CONVERT_TOOL::makePolysFromChainedSegs(), STEP_PCB_MODEL::MakeShape(), PNS::LINE_PLACER::mergeHead(), PNS::OPTIMIZER::mergeObtuse(), PNS::DP_MEANDER_PLACER::Move(), NearestPoint(), POLYGON_GEOM_MANAGER::NewPointClosesOutline(), NextShape(), ZONE_CREATE_HELPER::OnComplete(), operator!=(), BOOST_TEST_PRINT_NAMESPACE_OPEN::print_log_value< SHAPE_LINE_CHAIN >::operator()(), PNS::LINE_PLACER::optimizeTailHeadTransition(), BITMAPCONV_INFO::outputOnePolygon(), ALTIUM_PCB::ParsePolygons6Data(), PlotDrawingSheet(), GERBER_PLOTTER::PlotGerberRegion(), PLOTTER::PlotPoly(), GERBER_PLOTTER::PlotPoly(), SHAPE_SIMPLE::PointCount(), PNS::LINE::PointCount(), PNS::pointInside2(), polygon_Convert(), GERBER_DRAW_ITEM::PrintGerberPoly(), DS_DRAW_ITEM_POLYPOLYGONS::PrintWsItem(), Remove(), RemoveShape(), Replace(), PNS::OPTIMIZER::runSmartPads(), SetPoint(), KIGFX::PREVIEW::POLYGON_ITEM::SetPoints(), PNS::shovedArea(), PNS::SHOVE::shoveLineFromLoneVia(), PNS::SHOVE::shoveLineToHullSet(), Simplify(), PNS::TOPOLOGY::SimplifyLine(), PNS::LINE_PLACER::simplifyNewLine(), Slice(), PNS::OPTIMIZER::smartPadsSingle(), splitArc(), PNS::LINE_PLACER::Trace(), PCB_TEXTBOX::TransformShapeToPolygon(), PNS::DRAGGER::tryWalkaround(), PNS::LINE_PLACER::updatePStart(), POLYGON_GEOM_MANAGER::updateTemporaryLines(), PNS::LINE::Walkaround(), HYPERLYNX_EXPORTER::writeNetObjects(), GBR_TO_PCB_EXPORTER::writePcbPolygon(), and GBR_TO_PCB_EXPORTER::writePcbZoneItem().
|
inherited |
Check if point aP lies inside a polygon (any type) defined by the line chain.
For closed shapes only.
aPt | point to check |
aUseBBoxCache | gives better performance if the bounding box caches have been generated. |
Definition at line 1616 of file shape_line_chain.cpp.
References SHAPE_LINE_CHAIN_BASE::GetCachedBBox(), SHAPE_LINE_CHAIN_BASE::GetPoint(), SHAPE_LINE_CHAIN_BASE::GetPointCount(), SHAPE_LINE_CHAIN_BASE::IsClosed(), SHAPE_LINE_CHAIN_BASE::PointOnEdge(), rescale(), VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by BuildBoardPolygonOutlines(), Collide(), SHAPE_LINE_CHAIN_BASE::Collide(), Collide(), SHAPE_POLY_SET::containsSingle(), ConvertOutlineToPolygon(), ZONE::HitTestCutout(), MARKER_BASE::HitTestMarker(), CONNECTIVITY_DATA::IsConnectedOnLayer(), PNS::WALKAROUND::singleStep(), SHAPE_LINE_CHAIN_BASE::SquaredDistance(), DRC_TEST_PROVIDER_ZONE_CONNECTIONS::testZoneLayer(), and PNS::LINE::Walkaround().
|
inherited |
Check if point aP lies on an edge or vertex of the line chain.
aP | point to check |
Definition at line 1668 of file shape_line_chain.cpp.
References SHAPE_LINE_CHAIN_BASE::EdgeContainingPoint().
Referenced by FABMASTER::loadZones(), SHAPE_LINE_CHAIN_BASE::PointInside(), PNS::WALKAROUND::singleStep(), PNS::LINE_PLACER::splitHeadTail(), and PNS::LINE::Walkaround().
|
inline |
Definition at line 376 of file shape_line_chain.h.
References NextShape().
Referenced by PNS::LINE_PLACER::handlePullback().
|
inline |
Remove the aIndex-th point from the line chain.
aIndex | is the index of the point to be removed. |
Definition at line 578 of file shape_line_chain.h.
References Remove().
void SHAPE_LINE_CHAIN::Remove | ( | int | aStartIndex, |
int | aEndIndex | ||
) |
Remove the range of points [start_index, end_index] from the line chain.
aStartIndex | is the start of the point range to be replaced (inclusive). |
aEndIndex | is the end of the point range to be replaced (inclusive). |
Definition at line 809 of file shape_line_chain.cpp.
References convertArc(), IsPtOnArc(), IsSharedPt(), m_points, m_shapes, PointCount(), alg::run_on_pair(), SHAPE_IS_PT, and splitArc().
Referenced by POLYGON_GEOM_MANAGER::AddPoint(), PNS::TOPOLOGY::AssembleTuningPath(), PNS::LINE_PLACER::buildInitialLine(), PNS::LINE::ClipToNearestObstacle(), POLYGON_GEOM_MANAGER::DeleteLastCorner(), EDA_SHAPE::endEdit(), PNS::DIFF_PAIR_PLACER::FixRoute(), PNS::LINE_PLACER::handleSelfIntersections(), PNS::OPTIMIZER::mergeColinear(), PNS::LINE_PLACER::mergeHead(), ZONE_CREATE_HELPER::OnComplete(), PNS::LINE_PLACER::reduceTail(), Remove(), EE_POINT_EDITOR::removeCorner(), RemoveShape(), Replace(), and Simplify().
void SHAPE_LINE_CHAIN::RemoveShape | ( | int | aPointIndex | ) |
Remove the shape at the given index from the line chain.
If the given index is inside an arc, the entire arc will be removed. Otherwise this is equivalent to Remove( aPointIndex ).
aPointIndex | is the index of the point to remove. |
Definition at line 1110 of file shape_line_chain.cpp.
References ArcIndex(), IsSharedPt(), m_shapes, PointCount(), Remove(), and SHAPES_ARE_PT.
Referenced by PNS::LINE_PLACER::handlePullback().
void SHAPE_LINE_CHAIN::Replace | ( | int | aStartIndex, |
int | aEndIndex, | ||
const SHAPE_LINE_CHAIN & | aLine | ||
) |
Replace points with indices in range [start_index, end_index] with the points from line chain aLine.
aStartIndex | is the start of the point range to be replaced (inclusive). |
aEndIndex | is the end of the point range to be replaced (inclusive). |
aLine | is the replacement line chain. |
Definition at line 739 of file shape_line_chain.cpp.
References m_arcs, m_points, m_shapes, PointCount(), Remove(), alg::run_on_pair(), and SHAPE_IS_PT.
void SHAPE_LINE_CHAIN::Replace | ( | int | aStartIndex, |
int | aEndIndex, | ||
const VECTOR2I & | aP | ||
) |
Replace points with indices in range [start_index, end_index] with a single point aP.
aStartIndex | is the start of the point range to be replaced (inclusive). |
aEndIndex | is the end of the point range to be replaced (inclusive). |
aP | is the replacement point. |
Definition at line 731 of file shape_line_chain.cpp.
References Insert(), m_points, m_shapes, and Remove().
Referenced by PNS::TOPOLOGY::AssembleTuningPath(), BOOST_AUTO_TEST_CASE(), PNS::CORNER_COUNT_LIMIT_CONSTRAINT::Check(), PNS::coupledBypass(), PNS::LINE::dragSegment45(), CADSTAR_SCH_ARCHIVE_LOADER::loadNets(), PNS::OPTIMIZER::mergeDpStep(), PNS::OPTIMIZER::mergeObtuse(), PNS::LINE_PLACER::optimizeTailHeadTransition(), and PNS::Tighten().
|
inline |
Allocate a number of points all at once (for performance).
Definition at line 491 of file shape_line_chain.h.
References m_points.
Referenced by KIFONT::OUTLINE_FONT::getTextAsGlyphsUnlocked().
const SHAPE_LINE_CHAIN SHAPE_LINE_CHAIN::Reverse | ( | ) | const |
Reverse point order in the line chain.
Definition at line 641 of file shape_line_chain.cpp.
References m_arcs, m_closed, m_points, m_shapes, SHAPE_ARC::Reverse(), alg::run_on_pair(), SHAPE_IS_PT, and SHAPES_ARE_PT.
Referenced by PNS::ArcHull(), PNS::DP_GATEWAYS::buildEntries(), PNS::KEEP_TOPOLOGY_CONSTRAINT::Check(), PNS::SHOVE::checkShoveDirection(), convertToClipper(), convertToClipper2(), PNS::coupledBypass(), PNS::MEANDER_PLACER_BASE::cutTunedLine(), PNS::LINE::dragCorner45(), PNS::MOUSE_TRAIL_TRACER::GetPosture(), CADSTAR_SCH_ARCHIVE_LOADER::loadNets(), PNS::DP_GATEWAY::Reverse(), PNS::LINE::Reverse(), PNS::SegmentHull(), PNS::OPTIMIZER::smartPadsSingle(), POLYGON_GEOM_MANAGER::updateTemporaryLines(), and PNS::LINE::Walkaround().
|
inlineprotected |
Return the arc index for the given segment index, looking backwards.
Definition at line 917 of file shape_line_chain.h.
References IsSharedPt(), and m_shapes.
Referenced by NextShape().
|
overridevirtual |
Rotate all vertices by a given angle.
aCenter | is the rotation center. |
aAngle | is the rotation angle. |
Implements SHAPE.
Definition at line 507 of file shape_line_chain.cpp.
References m_arcs, m_points, and RotatePoint().
Referenced by PAD::BuildEffectiveShapes(), PCB_GRID_HELPER::computeAnchors(), and PLACEFILE_GERBER_WRITER::CreatePlaceFile().
|
inline |
Return a copy of the aIndex-th segment in the line chain.
aIndex | is the index of the segment in the line chain. Negative values are counted from the end (i.e. -1 means the last segment in the line chain). |
Definition at line 332 of file shape_line_chain.h.
References m_closed, m_points, and SegmentCount().
Referenced by BuildFootprintPolygonOutlines(), PNS::DIFF_PAIR::CoupledSegmentPairs(), BOARD_ADAPTER::createPadWithMargin(), findEndSegments(), ALTIUM_PCB::HelperCreateBoardOutline(), EDA_SHAPE::makeEffectiveShapes(), DRC_TEST_PROVIDER_PHYSICAL_CLEARANCE::testZoneLayer(), and unfracture().
|
inline |
Return the number of segments in this line chain.
Definition at line 296 of file shape_line_chain.h.
References m_closed, and m_points.
Referenced by PNS::NODE::Add(), PNS::MOUSE_TRAIL_TRACER::AddTrailPoint(), PNS::NODE::AssembleLine(), build45DegLeader(), BuildFootprintPolygonOutlines(), PNS::LINE_PLACER::buildInitialLine(), PNS::PRESERVE_VERTEX_CONSTRAINT::Check(), CheckClearance(), PNS::NODE::CheckColliding(), PNS::DIFF_PAIR::CheckConnectionAngle(), PNS::checkGap(), PNS::MEANDERED_LINE::CheckSelfIntersections(), PNS::closestProjectedPoint(), PNS::COST_ESTIMATOR::CornerCost(), PNS::LINE::CountCorners(), PNS::DIFF_PAIR::CoupledLength(), PNS::DIFF_PAIR::CoupledSegmentPairs(), BOARD_ADAPTER::createPadWithMargin(), CSegment(), PNS::LINE_PLACER::cursorDistMinimum(), PNS::MEANDER_PLACER::doMove(), PNS::LINE::dragCorner45(), PNS::dragCornerInternal(), PNS::LINE::dragSegment45(), KIGFX::OPENGL_GAL::DrawPolygon(), PNS::DIFF_PAIR::Empty(), PNS::findCoupledVertices(), findEndSegments(), FindSegment(), PNS::DIFF_PAIR_PLACER::FixRoute(), PNS::LINE_PLACER::FixRoute(), GetSegmentCount(), SHAPE_SIMPLE::GetSegmentCount(), PNS::LINE_PLACER::handlePullback(), PNS::DIFF_PAIR_PLACER::HasPlacedAnything(), PNS::DP_MEANDER_PLACER::HasPlacedAnything(), PNS::HullIntersection(), Intersect(), isLine45Degree(), Length(), EDA_SHAPE::makeEffectiveShapes(), PNS::OPTIMIZER::mergeColinear(), PNS::OPTIMIZER::mergeDpSegments(), PNS::OPTIMIZER::mergeDpStep(), PNS::OPTIMIZER::mergeFull(), PNS::OPTIMIZER::mergeObtuse(), PNS::OPTIMIZER::mergeStep(), PNS::NODE::NearestObstacle(), NearestPoint(), NearestSegment(), PathLength(), PointAlong(), PNS::pointInside2(), KIGFX::VIEW_OVERLAY::Polyline(), PNS::LINE_PLACER::reduceTail(), Segment(), PNS::LINE::SegmentCount(), SelfIntersecting(), PNS::OPTIMIZER::smartPadsSingle(), PNS::LINE::snapDraggedCorner(), PNS::LINE::snapToNeighbourSegments(), Split(), DRC_TEST_PROVIDER_PHYSICAL_CLEARANCE::testShapeLineChain(), DRC_TEST_PROVIDER_PHYSICAL_CLEARANCE::testZoneLayer(), PNS::Tighten(), EDA_SHAPE::TransformShapeToPolygon(), PCB_TEXTBOX::TransformShapeToPolygon(), SHAPE_POLY_SET::unfractureSingle(), PNS::LINE::Walkaround(), and HYPERLYNX_EXPORTER::writeBoardInfo().
const std::optional< SHAPE_LINE_CHAIN::INTERSECTION > SHAPE_LINE_CHAIN::SelfIntersecting | ( | ) | const |
Check if the line chain is self-intersecting.
Definition at line 1723 of file shape_line_chain.cpp.
References SEG::A, SEG::B, CSegment(), SHAPE_LINE_CHAIN::INTERSECTION::index_our, SHAPE_LINE_CHAIN::INTERSECTION::index_their, SEG::Intersect(), IsClosed(), SHAPE_LINE_CHAIN::INTERSECTION::p, and SegmentCount().
Referenced by PNS::DIFF_PAIR::BuildInitial(), DIALOG_PAD_PRIMITIVE_POLY_PROPS::doValidate(), and POLYGON_GEOM_MANAGER::IsSelfIntersecting().
|
inline |
Mark the line chain as closed (i.e.
with a segment connecting the last point with the first point).
aClosed | whether the line chain is to be closed or not. |
Definition at line 257 of file shape_line_chain.h.
References m_closed, and mergeFirstLastPointIfNeeded().
Referenced by ZONE_FILLER::addHatchFillTypeOnZone(), ZONE::AddPolygon(), PNS::ArcHull(), EDA_SHAPE::beginEdit(), BOOST_AUTO_TEST_CASE(), buildBoardBoundingBoxPoly(), BuildFootprintPolygonOutlines(), KI_TEST::BuildRectChain(), ZONE_FILLER::buildThermalSpokes(), SHAPE_POLY_SET::chamferFilletPolygon(), PNS::KEEP_TOPOLOGY_CONSTRAINT::Check(), KI_TEST::CommonTestData::CommonTestData(), PCB_GRID_HELPER::computeAnchors(), ConvertOutlineToPolygon(), convertPolygon(), ConvertPolygonToBlocks(), CADSTAR_ARCHIVE_PARSER::SHAPE::ConvertToPolySet(), PNS::ConvexHull(), PLACEFILE_GERBER_WRITER::CreatePlaceFile(), KIGFX::GERBVIEW_PAINTER::draw(), EDA_SHAPE::endEdit(), TEARDROP_MANAGER::findAnchorPointsOnTrack(), SHAPE_POLY_SET::fractureSingle(), CADSTAR_PCB_ARCHIVE_LOADER::getLineChainFromShapes(), PNS::MOUSE_TRAIL_TRACER::GetPosture(), KIFONT::OUTLINE_FONT::getTextAsGlyphsUnlocked(), HelperShapeLineChainFromAltiumVertices(), POLYGON_GEOM_MANAGER::IsSelfIntersecting(), IteratorFixture::IteratorFixture(), EDA_SHAPE::makeEffectiveShapes(), CONVERT_TOOL::makePolysFromChainedSegs(), GEOM_TEST::MakeSquarePolyLine(), SHAPE_POLY_SET::NewHole(), SHAPE_POLY_SET::NewOutline(), PNS::OctagonalHull(), ZONE_CREATE_HELPER::OnComplete(), SHAPE_RECT::Outline(), CADSTAR_ARCHIVE_PARSER::SHAPE::OutlineAsChain(), EAGLE_PLUGIN::packagePolygon(), SHAPE_POLY_SET::Parse(), ALTIUM_PCB::ParseRegions6Data(), PCB_PARSER::parseRenderCache(), PCB_PARSER::parseZONE(), BRDITEMS_PLOTTER::PlotPcbShape(), polygonArea(), RENDER_3D_OPENGL::reload(), DRC_TEST_PROVIDER_ANNULAR_WIDTH::Run(), PNS::SegmentHull(), SHAPE_POLY_SET::SHAPE_POLY_SET(), SHAPE_SIMPLE::SHAPE_SIMPLE(), MARKER_BASE::ShapeToPolygon(), TestConcaveSquareFillet(), TransformCircleToPolygon(), unfracture(), and SHAPE_POLY_SET::unfractureSingle().
void SHAPE_LINE_CHAIN::SetPoint | ( | int | aIndex, |
const VECTOR2I & | aPos | ||
) |
Move a point to a specific location.
aIndex | is the index of the point to move. |
aPos | is the new absolute location of the point. |
Definition at line 1092 of file shape_line_chain.cpp.
References convertArc(), m_points, m_shapes, PointCount(), alg::run_on_pair(), and SHAPE_IS_PT.
Referenced by PNS::LINE_PLACER::buildInitialLine(), EDA_SHAPE::calcEdit(), PNS::LINE::dragCornerFree(), APERTURE_MACRO::GetApertureMacroShape(), and CADSTAR_SCH_ARCHIVE_LOADER::getScaledLibPart().
|
inline |
Set the width of all segments in the chain.
aWidth | is the width in internal units. |
Definition at line 276 of file shape_line_chain.h.
References m_width.
Referenced by PNS_PCBNEW_DEBUG_DECORATOR::AddPoint(), PNS_PCBNEW_DEBUG_DECORATOR::AddShape(), BOOST_AUTO_TEST_CASE(), PNS::LINE::SetShape(), PNS::DIFF_PAIR::SetWidth(), and PNS::LINE::SetWidth().
int SHAPE_LINE_CHAIN::ShapeCount | ( | ) | const |
Return the number of shapes (line segments or arcs) in this line chain.
This is kind of like SegmentCount() but will only count arcs as 1 segment.
Definition at line 983 of file shape_line_chain.cpp.
References m_points, m_shapes, SHAPE_IS_PT, and SHAPES_ARE_PT.
Referenced by PNS::LINE_PLACER::mergeHead(), PNS::LINE_PLACER::optimizeTailHeadTransition(), and PNS::LINE::ShapeCount().
SHAPE_LINE_CHAIN & SHAPE_LINE_CHAIN::Simplify | ( | bool | aRemoveColinear = true | ) |
Simplify the line chain by removing colinear adjacent segments and duplicate vertices.
aRemoveColinear | controls the removal of colinear adjacent segments. |
Definition at line 1771 of file shape_line_chain.cpp.
References CPoint(), m_arcs, m_points, m_shapes, PointCount(), Remove(), and SHAPES_ARE_PT.
Referenced by PNS::MOUSE_TRAIL_TRACER::AddTrailPoint(), PNS::NODE::AssembleLine(), PNS::DIFF_PAIR_PLACER::attemptWalk(), BOOST_AUTO_TEST_CASE(), DIRECTION_45::BuildInitialTrace(), PNS_LOG_VIEWER_FRAME::buildListTree(), PNS::LINE::ChangedArea(), PNS::CORNER_COUNT_LIMIT_CONSTRAINT::Check(), CompareGeometry(), PNS::DIFF_PAIR::CoupledSegmentPairs(), PNS::MEANDER_PLACER_BASE::cutTunedLine(), PNS::MEANDER_PLACER::doMove(), DIALOG_PAD_PRIMITIVE_POLY_PROPS::doValidate(), PNS::LINE::dragCornerFree(), PNS::LINE::dragSegment45(), PNS::MOUSE_TRAIL_TRACER::GetPosture(), PNS::OPTIMIZER::mergeDpStep(), PNS::OPTIMIZER::mergeFull(), PNS::LINE_PLACER::mergeHead(), PNS::DP_MEANDER_PLACER::Move(), PNS::SHOVE::onCollidingSolid(), ZONE_CREATE_HELPER::OnComplete(), PNS::LINE_PLACER::optimizeTailHeadTransition(), PNS::LINE_PLACER::rhWalkBase(), PNS::WALKAROUND::Route(), PNS::OPTIMIZER::runSmartPads(), PNS::TOPOLOGY::SimplifyLine(), PNS::LINE_PLACER::simplifyNewLine(), PNS::WALKAROUND::singleStep(), PNS::OPTIMIZER::smartPadsSingle(), PNS::Tighten(), PNS::LINE_PLACER::Trace(), and SHAPE_POLY_SET::unfractureSingle().
const SHAPE_LINE_CHAIN SHAPE_LINE_CHAIN::Slice | ( | int | aStartIndex, |
int | aEndIndex = -1 |
||
) | const |
Return a subset of this line chain containing the [start_index, end_index] range of points.
aStartIndex | is the start of the point range to be returned (inclusive). |
aEndIndex | is the end of the point range to be returned (inclusive). |
Definition at line 1146 of file shape_line_chain.cpp.
References Append(), Arc(), ArcIndex(), SHAPE_ARC::ConstructFromStartEndCenter(), SHAPE_ARC::GetCenter(), SHAPE_ARC::GetP0(), SHAPE_ARC::GetP1(), IsArcSegment(), IsArcStart(), SHAPE_ARC::IsClockwise(), m_arcs, m_bbox, m_points, m_shapes, BOX2< Vec >::Merge(), NextShape(), PointCount(), and SHAPE_IS_PT.
Referenced by PNS::MOUSE_TRAIL_TRACER::AddTrailPoint(), BOOST_AUTO_TEST_CASE(), PNS::KEEP_TOPOLOGY_CONSTRAINT::Check(), PNS::LINE_PLACER::clipAndCheckCollisions(), PNS::LINE::ClipVertexRange(), PNS::MEANDER_PLACER_BASE::cutTunedLine(), PNS::LINE::dragCorner45(), PNS::dragCornerInternal(), PNS::LINE_PLACER::optimizeTailHeadTransition(), PNS::LINE_PLACER::splitHeadTail(), and PNS::Tighten().
int SHAPE_LINE_CHAIN::Split | ( | const VECTOR2I & | aP | ) |
Insert the point aP belonging to one of the our segments, splitting the adjacent segment in two.
aP | is the point to be inserted. |
Definition at line 898 of file shape_line_chain.cpp.
References SEG::A, ArcIndex(), SEG::B, CSegment(), SEG::Distance(), Find(), GetPoint(), Insert(), IsArcSegment(), m_points, m_shapes, SegmentCount(), SHAPE_IS_PT, and splitArc().
Referenced by BOOST_AUTO_TEST_CASE(), PNS::LINE_PLACER::clipAndCheckCollisions(), PNS::LINE::ClipToNearestObstacle(), PNS::MEANDER_PLACER_BASE::cutTunedLine(), PNS::LINE_PLACER::splitHeadTail(), and PNS::LINE::Walkaround().
|
protected |
Splits an arc into two arcs at aPtIndex.
Parameter aCoincident
controls whether the two arcs are to be coincident at aPtIndex or whether a short straight segment should be created instead
aPtIndex | index of the point in the chain in which to split the arc |
aCoincident | If true, the end point of the first arc will be coincident with the start point of the second arc at aPtIndex. If false, the end point of the first arc will be at aPtIndex-1 and the start point of the second arc will be at aPtIndex, resulting in a short straight line segment between aPtIndex-1 and aPtIndex. |
Definition at line 304 of file shape_line_chain.cpp.
References amendArc(), ArcIndex(), SHAPE_ARC::ConstructFromStartEndCenter(), SHAPE_ARC::GetCenter(), SHAPE_ARC::GetP0(), SHAPE_ARC::GetP1(), IsArcEnd(), IsArcStart(), SHAPE_ARC::IsClockwise(), IsPtOnArc(), IsSharedPt(), m_arcs, m_points, m_shapes, PointCount(), alg::run_on_pair(), SHAPE_IS_PT, and SHAPES_ARE_PT.
|
inherited |
Definition at line 884 of file shape_line_chain.cpp.
References VECTOR2< int >::ECOORD_MAX, SHAPE_LINE_CHAIN_BASE::GetSegment(), SHAPE_LINE_CHAIN_BASE::GetSegmentCount(), SHAPE_LINE_CHAIN_BASE::IsClosed(), SHAPE_LINE_CHAIN_BASE::PointInside(), and SEG::SquaredDistance().
Referenced by Distance().
|
inlineinherited |
Return the type of the shape.
the | type |
Definition at line 96 of file shape.h.
References SHAPE_BASE::m_type.
Referenced by PNS::DP_GATEWAYS::BuildFromPrimitivePair(), PNS::BuildHullForPrimitiveShape(), PNS_LOG_VIEWER_FRAME::buildListTree(), SHAPE_POLY_SET::Collide(), Collide(), collideShapes(), collideSingleShapes(), PNS::OPTIMIZER::computeBreakouts(), ROUTER_PREVIEW_ITEM::drawShape(), PNS_LOG_VIEWER_FRAME::drawSimpleShape(), PNS::HOLE::Hull(), PNS::SOLID::Hull(), PNS::HOLE::Radius(), PNS::HOLE::SetCenter(), PNS::HOLE::SetRadius(), STROKE_PARAMS::Stroke(), and SHAPE_FILE_IO::Write().
|
inlineinherited |
Definition at line 101 of file shape.h.
References SHAPE_BASE::m_type, and SHAPE_TYPE_asString().
Referenced by Collide().
|
inline |
Get the current width of the segments in the chain.
Definition at line 286 of file shape_line_chain.h.
References m_width.
Referenced by PNS_PCBNEW_DEBUG_DECORATOR::AddPoint(), and PNS::LINE::dragCorner45().
|
friend |
Definition at line 879 of file shape_line_chain.h.
|
privateinherited |
Definition at line 143 of file wrlfacet.h.
Referenced by SHAPE::CalcShape(), and SHAPE::NewFacet().
|
private |
Definition at line 974 of file shape_line_chain.h.
Referenced by amendArc(), amendArcEnd(), amendArcStart(), Append(), Arc(), ArcCount(), CArcs(), Clear(), ClearArcs(), convertArc(), convertToClipper(), convertToClipper2(), fixIndicesRotation(), Insert(), Mirror(), Move(), Parse(), Replace(), Reverse(), Rotate(), SHAPE_LINE_CHAIN(), Simplify(), Slice(), and splitArc().
|
mutableprivate |
cached bounding box
Definition at line 987 of file shape_line_chain.h.
Referenced by Append(), GenerateBBoxCache(), GetCachedBBox(), Move(), and Slice().
|
private |
is the line chain closed?
Definition at line 977 of file shape_line_chain.h.
Referenced by Area(), Clear(), CSegment(), Format(), IsArcSegment(), IsClosed(), mergeFirstLastPointIfNeeded(), NextShape(), Parse(), Reverse(), Segment(), SegmentCount(), and SetClosed().
|
private |
array of vertices
Definition at line 956 of file shape_line_chain.h.
Referenced by Append(), Area(), BBox(), CheckClearance(), CLastPoint(), Clear(), CompareGeometry(), CPoint(), CPoints(), CSegment(), fixIndicesRotation(), Format(), GenerateBBoxCache(), Insert(), mergeFirstLastPointIfNeeded(), Mirror(), Move(), NearestPoint(), Parse(), PointCount(), Remove(), Replace(), ReservePoints(), Reverse(), Rotate(), Segment(), SegmentCount(), SetPoint(), SHAPE_LINE_CHAIN(), ShapeCount(), Simplify(), Slice(), Split(), and splitArc().
|
private |
Array of indices that refer to the index of the shape if the point is part of a larger shape, e.g.
arc or spline. If the value is -1, the point is just a point.
There can be up to two shapes associated with a single point (e.g. the end point of one arc might be the start point of another).
Generally speaking only the first element of the pair will be populated (i.e. with a value not equal to SHAPE_IS_PT), unless the point is shared between two arc shapes. If the point is shared, then both the first and second element of the pair should be populated.
The second element must always be SHAPE_IS_PT if the first element is SHAPE_IS_PT.
Definition at line 972 of file shape_line_chain.h.
Referenced by Append(), ArcIndex(), Clear(), convertArc(), convertToClipper(), convertToClipper2(), CShapes(), fixIndicesRotation(), Insert(), IsArcSegment(), IsPtOnArc(), IsSharedPt(), mergeFirstLastPointIfNeeded(), NextShape(), Parse(), Remove(), RemoveShape(), Replace(), Reverse(), reversedArcIndex(), SetPoint(), SHAPE_LINE_CHAIN(), ShapeCount(), Simplify(), Slice(), Split(), and splitArc().
|
protectedinherited |
< type of our shape
Definition at line 117 of file shape.h.
Referenced by SHAPE::Format(), SHAPE::IsNull(), SHAPE_BASE::Type(), and SHAPE_BASE::TypeName().
|
private |
Width of the segments (for BBox calculations in RTree) TODO Adjust usage of SHAPE_LINE_CHAIN to account for where we need a width and where not Alternatively, we could split the class into a LINE_CHAIN (no width) and SHAPE_LINE_CHAIN that derives from SHAPE as well that does have a width.
Not sure yet on the correct path. TODO Note that we also have SHAPE_SIMPLE which is a closed, filled SHAPE_LINE_CHAIN.
Definition at line 984 of file shape_line_chain.h.
Referenced by BBox(), GenerateBBoxCache(), SetWidth(), and Width().
|
staticinherited |
This is the minimum precision for all the points in a shape.
Definition at line 129 of file shape.h.
Referenced by BOOST_AUTO_TEST_CASE(), DIRECTION_45::BuildInitialTrace(), CompareLength(), CIRCLE::Contains(), EDIT_TOOL::FilletTracks(), and CIRCLE::IntersectLine().
|
staticprivate |
Definition at line 951 of file shape_line_chain.h.
Referenced by Append(), convertArc(), fixIndicesRotation(), IsSharedPt(), NextShape(), Parse(), Remove(), Replace(), Reverse(), SetPoint(), SHAPE_LINE_CHAIN(), ShapeCount(), Slice(), Split(), and splitArc().
|
staticprivate |
Definition at line 953 of file shape_line_chain.h.
Referenced by Append(), Insert(), IsPtOnArc(), mergeFirstLastPointIfNeeded(), NextShape(), RemoveShape(), Reverse(), SHAPE_LINE_CHAIN(), ShapeCount(), Simplify(), and splitArc().