KiCad PCB EDA Suite
|
#include <seg.h>
Public Types | |
using | ecoord = VECTOR2I::extended_type |
Public Member Functions | |
SEG () | |
Create an empty (0, 0) segment. | |
SEG (int aX1, int aY1, int aX2, int aY2) | |
Create a segment between (aX1, aY1) and (aX2, aY2). | |
SEG (const VECTOR2I &aA, const VECTOR2I &aB) | |
Create a segment between (aA) and (aB). | |
SEG (const VECTOR2I &aA, const VECTOR2I &aB, int aIndex) | |
Create a segment between (aA) and (aB), referenced to a multi-segment shape. | |
SEG (const SEG &aSeg) | |
Copy constructor. | |
SEG & | operator= (const SEG &aSeg) |
bool | operator== (const SEG &aSeg) const |
bool | operator!= (const SEG &aSeg) const |
VECTOR2I | LineProject (const VECTOR2I &aP) const |
Compute the perpendicular projection point of aP on a line passing through ends of the segment. | |
int | Side (const VECTOR2I &aP) const |
Determine on which side of directed line passing via segment ends point aP lies. | |
int | LineDistance (const VECTOR2I &aP, bool aDetermineSide=false) const |
Return the closest Euclidean distance between point aP and the line defined by the ends of segment (this). | |
EDA_ANGLE | Angle (const SEG &aOther) const |
Determine the smallest angle between two segments. | |
const VECTOR2I | NearestPoint (const VECTOR2I &aP) const |
Compute a point on the segment (this) that is closest to point aP. | |
const VECTOR2I | NearestPoint (const SEG &aSeg) const |
Compute a point on the segment (this) that is closest to any point on aSeg. | |
bool | NearestPoints (const SEG &aSeg, VECTOR2I &aPtA, VECTOR2I &aPtB, int64_t &aDistSq) const |
Compute closest points between this segment and aSeg. | |
const VECTOR2I | ReflectPoint (const VECTOR2I &aP) const |
Reflect a point using this segment as axis. | |
OPT_VECTOR2I | Intersect (const SEG &aSeg, bool aIgnoreEndpoints=false, bool aLines=false) const |
Compute intersection point of segment (this) with segment aSeg. | |
bool | Intersects (const SEG &aSeg) const |
OPT_VECTOR2I | IntersectLines (const SEG &aSeg) const |
Compute the intersection point of lines passing through ends of (this) and aSeg. | |
bool | IntersectsLine (double aSlope, double aOffset, VECTOR2I &aIntersection) const |
Check if this segment intersects a line defined by slope aSlope and offset aOffset. | |
SEG | PerpendicularSeg (const VECTOR2I &aP) const |
Compute a segment perpendicular to this one, passing through point aP. | |
SEG | ParallelSeg (const VECTOR2I &aP) const |
Compute a segment parallel to this one, passing through point aP. | |
bool | Collide (const SEG &aSeg, int aClearance, int *aActual=nullptr) const |
ecoord | SquaredDistance (const SEG &aSeg) const |
int | Distance (const SEG &aSeg) const |
Compute minimum Euclidean distance to segment aSeg. | |
ecoord | SquaredDistance (const VECTOR2I &aP) const |
int | Distance (const VECTOR2I &aP) const |
Compute minimum Euclidean distance to point aP. | |
void | CanonicalCoefs (ecoord &qA, ecoord &qB, ecoord &qC) const |
bool | Collinear (const SEG &aSeg) const |
Check if segment aSeg lies on the same line as (this). | |
bool | ApproxCollinear (const SEG &aSeg, int aDistanceThreshold=1) const |
bool | ApproxParallel (const SEG &aSeg, int aDistanceThreshold=1) const |
bool | ApproxPerpendicular (const SEG &aSeg) const |
bool | Overlaps (const SEG &aSeg) const |
bool | Contains (const SEG &aSeg) const |
int | Length () const |
Return the length (this). | |
ecoord | SquaredLength () const |
ecoord | TCoef (const VECTOR2I &aP) const |
int | Index () const |
Return the index of this segment in its parent shape (applicable only to non-local segments). | |
bool | Contains (const VECTOR2I &aP) const |
void | Reverse () |
SEG | Reversed () const |
Returns the center point of the line. | |
VECTOR2I | Center () const |
bool | operator< (const SEG &aSeg) const |
Static Public Member Functions | |
static SEG::ecoord | Square (int a) |
Public Attributes | |
VECTOR2I | A |
VECTOR2I | B |
Private Member Functions | |
bool | checkCollinearOverlap (const SEG &aSeg, bool useXAxis, bool aIgnoreEndpoints, VECTOR2I *aPt) const |
bool | intersects (const SEG &aSeg, bool aIgnoreEndpoints=false, bool aLines=false, VECTOR2I *aPt=nullptr) const |
bool | mutualDistanceSquared (const SEG &aSeg, ecoord &aD1, ecoord &aD2) const |
Private Attributes | |
int | m_index |
< index within the parent shape (used when m_is_local == false) | |
Friends | |
std::ostream & | operator<< (std::ostream &aStream, const SEG &aSeg) |
using SEG::ecoord = VECTOR2I::extended_type |
|
inline |
Create an empty (0, 0) segment.
Definition at line 55 of file seg.h.
References m_index.
Referenced by Angle(), ApproxCollinear(), ApproxParallel(), ApproxPerpendicular(), checkCollinearOverlap(), Collide(), Collinear(), Contains(), Distance(), Intersect(), IntersectLines(), Intersects(), intersects(), mutualDistanceSquared(), NearestPoint(), NearestPoints(), operator!=(), operator<(), operator<<, operator=(), operator==(), Overlaps(), ParallelSeg(), PerpendicularSeg(), Reversed(), SEG(), and SquaredDistance().
|
inline |
|
inline |
Determine the smallest angle between two segments.
aOther | point to determine the orientation wrs to self |
Definition at line 102 of file seg.cpp.
References A, std::abs(), B, EDA_ANGLE::Normalize180(), and SEG().
Referenced by PNS::AREA_CONSTRAINT::Check(), ComputeDogbone(), ConnectBoardShapes(), EDIT_TOOL::DragArcTrack(), KIGFX::PREVIEW::ANGLE_ITEM::drawPreviewShape(), EC_CONVERGING::EC_CONVERGING(), PCB_POINT_EDITOR::OnSelectionChange(), DOGBONE_CORNER_ROUTINE::ProcessLinePair(), and LINE_FILLET_ROUTINE::ProcessLinePair().
bool SEG::ApproxCollinear | ( | const SEG & | aSeg, |
int | aDistanceThreshold = 1 ) const |
Definition at line 766 of file seg.cpp.
References std::abs(), mutualDistanceSquared(), SEG(), and Square().
Referenced by PCB_TRACK::ApproxCollinear(), EDIT_TOOL::FilletTracks(), and SHAPE_POLY_SET::splitCollinearOutlines().
bool SEG::ApproxParallel | ( | const SEG & | aSeg, |
int | aDistanceThreshold = 1 ) const |
Definition at line 778 of file seg.cpp.
References std::abs(), mutualDistanceSquared(), SEG(), and Square().
Referenced by ApproxPerpendicular(), PNS::TOPOLOGY::AssembleDiffPair(), PNS::MEANDERED_LINE::CheckSelfIntersections(), CIRCLE::ConstructFromTanTanPt(), PNS::DIFF_PAIR::CoupledLength(), PNS::DIFF_PAIR::CoupledLength(), PNS::DIFF_PAIR::CoupledSegmentPairs(), PNS::DP_PRIMITIVE_PAIR::CursorOrientation(), and PNS::findCoupledVertices().
bool SEG::ApproxPerpendicular | ( | const SEG & | aSeg | ) | const |
Definition at line 790 of file seg.cpp.
References A, ApproxParallel(), PerpendicularSeg(), and SEG().
|
inline |
Definition at line 379 of file seg.h.
Referenced by PCB_GRID_HELPER::computeAnchors(), and CIRCLE::ConstructFromTanTanPt().
|
private |
Definition at line 211 of file seg.cpp.
References A, B, rescale(), SEG(), VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by intersects().
bool SEG::Collide | ( | const SEG & | aSeg, |
int | aClearance, | ||
int * | aActual = nullptr ) const |
Definition at line 536 of file seg.cpp.
References A, B, VECTOR2< int32_t >::ECOORD_MAX, intersects(), isqrt(), SEG(), and SquaredDistance().
Referenced by PCB_POINT::HitTest(), SHAPE_POLY_SET::IsPolygonSelfIntersecting(), DRC_TEST_PROVIDER_PHYSICAL_CLEARANCE::testShapeLineChain(), and BOARD::TestZoneIntersection().
|
inline |
Check if segment aSeg lies on the same line as (this).
aSeg | the segment to check colinearity with |
Definition at line 286 of file seg.h.
References A, std::abs(), B, CanonicalCoefs(), SEG(), VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by PNS::DP_GATEWAYS::BuildGeneric(), Contains(), SHAPE_LINE_CHAIN::Intersect(), PNS::OPTIMIZER::mergeColinear(), PNS::LINE_PLACER::Move(), and Overlaps().
|
inline |
Definition at line 324 of file seg.h.
References A, B, Collinear(), Contains(), and SEG().
Referenced by SCH_IO_EAGLE::adjustNetLabels(), BuildFootprintPolygonOutlines(), PNS::LINE::ChangedArea(), Contains(), DRAWING_TOOL::DrawVia(), findEndSegments(), PNS::MULTI_DRAGGER::findNewLeaderSegment(), CIRCLE::Intersect(), HALF_LINE::Intersect(), LINE::Intersect(), SHAPE_LINE_CHAIN::Intersect(), PNS::MEANDERED_LINE::MeanderSegment(), Overlaps(), LINE_EXTENSION_ROUTINE::ProcessLinePair(), SHAPE_LINE_CHAIN::SelfIntersecting(), SHAPE_LINE_CHAIN::SelfIntersectingWithArcs(), and PNS::LINE_PLACER::simplifyNewLine().
bool SEG::Contains | ( | const VECTOR2I & | aP | ) | const |
Definition at line 598 of file seg.cpp.
References SquaredDistance().
int SEG::Distance | ( | const SEG & | aSeg | ) | const |
Compute minimum Euclidean distance to segment aSeg.
aSeg | other segment |
Definition at line 673 of file seg.cpp.
References isqrt(), SEG(), and SquaredDistance().
Referenced by PCB_POINT_EDITOR::addCorner(), SCH_POINT_EDITOR::addCorner(), SHAPE_LINE_CHAIN::CheckClearance(), Collide(), SHAPE_ARC::ConvertToPolyline(), PNS::DIFF_PAIR::CoupledLength(), PNS::DIFF_PAIR::CoupledLength(), PNS::DIFF_PAIR::CoupledSegmentPairs(), DRAWING_TOOL::DrawVia(), SCH_SELECTION_TOOL::GuessSelectionCandidates(), SHAPE_LINE_CHAIN::NearestPoint(), SHAPE_LINE_CHAIN::NearestSegment(), pushoutForce(), SHAPE_LINE_CHAIN::Split(), and TransformArcToPolygon().
int SEG::Distance | ( | const VECTOR2I & | aP | ) | const |
Compute minimum Euclidean distance to point aP.
aP | the point |
Definition at line 679 of file seg.cpp.
References isqrt(), and SquaredDistance().
|
inline |
Return the index of this segment in its parent shape (applicable only to non-local segments).
Definition at line 361 of file seg.h.
References m_index.
Referenced by SHAPE_POLY_SET::IsPolygonSelfIntersecting(), PNS::OPTIMIZER::mergeDpStep(), PNS::OPTIMIZER::mergeObtuse(), and PNS::OPTIMIZER::mergeStep().
OPT_VECTOR2I SEG::Intersect | ( | const SEG & | aSeg, |
bool | aIgnoreEndpoints = false, | ||
bool | aLines = false ) const |
Compute intersection point of segment (this) with segment aSeg.
aSeg | segment to intersect with |
aIgnoreEndpoints | don't treat corner cases (i.e. end of one segment touching the other) as intersections. |
aLines | treat segments as infinite lines |
Definition at line 437 of file seg.cpp.
References intersects(), and SEG().
Referenced by EC_CONVERGING::Apply(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), SCH_LINE::BuildWireWithHopShape(), checkSelfIntersections(), PNS::LINE::dragSegment45(), extractDiffPairCoupledItems(), ALTIUM_PCB::HelperParseDimensions6Linear(), HALF_LINE::Intersect(), LINE::Intersect(), LINE::Intersect(), SHAPE_LINE_CHAIN::Intersect(), SHAPE_LINE_CHAIN::Intersect(), IntersectLines(), SCH_IO_EAGLE::loadSegments(), NearestPoint(), NearestPoints(), DRC_TEST_PROVIDER_TRACK_ANGLE::Run(), SegIntersectCorrect(), SHAPE_LINE_CHAIN::SelfIntersecting(), SHAPE_LINE_CHAIN::SelfIntersectingWithArcs(), SHAPE_ARC::SHAPE_ARC(), and DRC_TEST_PROVIDER_COPPER_CLEARANCE::testSingleLayerItemAgainstItem().
|
inline |
Compute the intersection point of lines passing through ends of (this) and aSeg.
aSeg | segment defining the line to intersect with |
Definition at line 220 of file seg.h.
References Intersect(), and SEG().
Referenced by PCB_GRID_HELPER::AlignToSegment(), EC_CONVERGING::Apply(), EC_LINE::Apply(), EC_PERPLINE::Apply(), BuildFootprintPolygonOutlines(), PNS::DP_GATEWAYS::BuildGeneric(), ConnectBoardShapes(), CIRCLE::ConstructFromTanTanPt(), PNS::ConvexHull(), CornerListToPolygon(), EDIT_TOOL::DragArcTrack(), PNS::LINE::dragSegment45(), EC_CONVERGING::EC_CONVERGING(), editArcCenterKeepEndpoints(), PNS::MULTI_DRAGGER::findNewLeaderSegment(), PNS::OPTIMIZER::mergeObtuse(), LINE_EXTENSION_ROUTINE::ProcessLinePair(), and PNS::LINE::snapDraggedCorner().
bool SEG::Intersects | ( | const SEG & | aSeg | ) | const |
Definition at line 431 of file seg.cpp.
References intersects(), and SEG().
Referenced by ConnectBoardShapes(), PATH_CONNECTION::isValid(), LINE_EXTENSION_ROUTINE::ProcessLinePair(), and SquaredDistance().
|
private |
Definition at line 303 of file seg.cpp.
References A, std::abs(), B, checkCollinearOverlap(), VECTOR2< T >::Cross(), rescale(), result, SEG(), VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by Collide(), Intersect(), and Intersects().
bool SEG::IntersectsLine | ( | double | aSlope, |
double | aOffset, | ||
VECTOR2I & | aIntersection ) const |
Check if this segment intersects a line defined by slope aSlope and offset aOffset.
aSlope | slope of the line |
aOffset | offset of the line |
aIntersection | output intersection point, if exists |
Definition at line 448 of file seg.cpp.
References A, std::abs(), B, VECTOR2< T >::Cross(), cross_product(), KiROUND(), VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), SHAPE_POLY_SET::GenerateHatchLines(), and SegLineIntersectCorrect().
|
inline |
Return the length (this).
Definition at line 343 of file seg.h.
Referenced by PNS::ArcHull(), ComputeChamferPoints(), TEARDROP_MANAGER::computeCurvedForRoundShape(), PNS::DIFF_PAIR::CoupledLength(), PNS::DIFF_PAIR::CoupledLength(), PNS::LINE_PLACER::cursorDistMinimum(), DIALOG_BOARD_STATISTICS::getDataFromPCB(), KIGEOM::GetLengthRatioFromStart(), PNS::MOUSE_TRAIL_TRACER::GetPosture(), isLine45Degree(), SHAPE_LINE_CHAIN::Length(), PNS::MEANDERED_LINE::MeanderSegment(), SHAPE_LINE_CHAIN::PathLength(), playground_main_func(), SHAPE_LINE_CHAIN::PointAlong(), OUTSET_ROUTINE::ProcessItem(), KIGFX::PCB_PAINTER::renderNetNameForSegment(), test::DRC_TEST_PROVIDER_DIFF_PAIR_COUPLING::Run(), PNS::SegmentHull(), SHAPE_ARC::SHAPE_ARC(), and PNS::tightenSegment().
int SEG::LineDistance | ( | const VECTOR2I & | aP, |
bool | aDetermineSide = false ) const |
Return the closest Euclidean distance between point aP and the line defined by the ends of segment (this).
aP | the point to test |
aDetermineSide | when true, the sign of the returned value indicates the side of the line at which we are (negative = left) |
Definition at line 717 of file seg.cpp.
References A, std::abs(), B, isqrt(), rescale(), sgn(), VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by CIRCLE::ConstructFromTanTanPt(), PNS::MULTI_DRAGGER::Drag(), SHAPE_LINE_CHAIN::NearestPoint(), RULE_AREA_CREATE_HELPER::OnComplete(), ZONE_CREATE_HELPER::OnComplete(), PNS::LINE::snapToNeighbourSegments(), and PCB_TUNING_PATTERN::UpdateFromEditPoints().
Compute the perpendicular projection point of aP on a line passing through ends of the segment.
aP | point to project |
Definition at line 656 of file seg.cpp.
References A, B, VECTOR2< T >::Dot(), rescale(), VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by PNS::LINE_PLACER::buildInitialLine(), PNS::DP_GATEWAYS::BuildOrthoProjections(), commonParallelProjection(), PNS::commonParallelProjection(), CIRCLE::ConstructFromTanTanPt(), PNS::MULTI_DRAGGER::Drag(), EDIT_TOOL::DragArcTrack(), PNS::findCoupledVertices(), CIRCLE::IntersectLine(), and PNS::DIFF_PAIR_PLACER::routeHead().
Definition at line 737 of file seg.cpp.
References A, B, rescale(), SEG(), sgn(), SquaredLength(), VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by ApproxCollinear(), and ApproxParallel().
Compute a point on the segment (this) that is closest to any point on aSeg.
Definition at line 111 of file seg.cpp.
References A, B, Intersect(), NearestPoint(), and SEG().
Compute a point on the segment (this) that is closest to point aP.
Definition at line 604 of file seg.cpp.
References A, B, VECTOR2< T >::Dot(), rescale(), VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by PCB_POINT_EDITOR::addCorner(), PNS::LINE::ClipToNearestObstacle(), Collide(), Collide(), SHAPE_ARC::Collide(), SHAPE_CIRCLE::Collide(), SHAPE_LINE_CHAIN::Collide(), SHAPE_LINE_CHAIN::Collide(), SHAPE_LINE_CHAIN_BASE::Collide(), SHAPE_LINE_CHAIN_BASE::Collide(), SHAPE_RECT::Collide(), PNS::LINE_PLACER::cursorDistMinimum(), SCH_LINE_WIRE_BUS_TOOL::doUnfoldBus(), EDIT_TOOL::DragArcTrack(), editArcMidKeepEndpoints(), KIGEOM::GetProjectedPointLengthRatio(), PNS::LINE_PLACER::Move(), SCH_MOVE_TOOL::moveItem(), NearestPoint(), SHAPE_LINE_CHAIN::NearestPoint(), NearestPoints(), NearestPoints(), NearestPoints(), NearestPoints(), NearestPoints(), NearestPoints(), SHAPE_ARC::NearestPoints(), KIGEOM::PointProjectsOntoSegment(), pushoutForce(), SCH_DRAWING_TOOLS::SingleClickPlace(), snapToNearestTrack(), SquaredDistance(), DRC_TEST_PROVIDER_PHYSICAL_CLEARANCE::testShapeLineChain(), and PNS::LINE::Walkaround().
bool SEG::NearestPoints | ( | const SEG & | aSeg, |
VECTOR2I & | aPtA, | ||
VECTOR2I & | aPtB, | ||
int64_t & | aDistSq ) const |
Compute closest points between this segment and aSeg.
aPtA | point on this segment (output) |
aPtB | point on the other segment (output) |
aDistSq | squared distance between points (output) |
Definition at line 153 of file seg.cpp.
References A, B, Intersect(), NearestPoint(), and SEG().
Referenced by SHAPE_LINE_CHAIN::ClosestSegments(), and extractDiffPairCoupledItems().
|
inline |
|
inline |
|
inline |
|
inline |
Definition at line 301 of file seg.h.
References A, B, Collinear(), Contains(), and SEG().
Referenced by PNS::LINE_PLACER::Move().
Compute a segment parallel to this one, passing through point aP.
aP | Point through which the new segment will pass |
Definition at line 527 of file seg.cpp.
Referenced by BOOST_DATA_TEST_CASE(), and CIRCLE::ConstructFromTanTanPt().
Compute a segment perpendicular to this one, passing through point aP.
aP | Point through which the new segment will pass |
Definition at line 518 of file seg.cpp.
References A, B, VECTOR2< T >::Perpendicular(), and SEG().
Referenced by ApproxPerpendicular(), BOOST_DATA_TEST_CASE(), CIRCLE::ConstructFromTanTanPt(), and EDIT_TOOL::DragArcTrack().
Reflect a point using this segment as axis.
Definition at line 635 of file seg.cpp.
References A, B, VECTOR2< T >::Dot(), rescale(), VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by CornerListToPolygon(), SHAPE_ARC::Mirror(), and SHAPE_LINE_CHAIN::Mirror().
|
inline |
Definition at line 368 of file seg.h.
Referenced by ZONE_FILLER::buildThermalSpokes(), and DRC_TEST_PROVIDER_COPPER_CLEARANCE::testZonesToZones().
|
inline |
Returns the center point of the line.
Definition at line 373 of file seg.h.
Referenced by KIGEOM::NormalisedSeg(), and PNS::LINE_PLACER::Start().
|
inline |
Determine on which side of directed line passing via segment ends point aP lies.
aP | point to determine the orientation wrs to self |
Definition at line 143 of file seg.h.
Referenced by PNS::ArcHull(), CornerListToPolygon(), PNS::MEANDER_PLACER::doMove(), EDIT_TOOL::DragArcTrack(), PCB_TUNING_PATTERN::EditStart(), PNS::DP_MEANDER_PLACER::Move(), SHAPE_LINE_CHAIN::OffsetLine(), PNS::DP_MEANDER_PLACER::pairOrientation(), PNS::SegmentHull(), and PCB_TUNING_PATTERN::UpdateFromEditPoints().
|
inlinestatic |
Definition at line 123 of file seg.h.
Referenced by ApproxCollinear(), ApproxParallel(), PNS::TOPOLOGY::AssembleDiffPair(), PNS::checkGap(), close_enough(), Collide(), Collide(), Collide(), Collide(), SHAPE_ARC::Collide(), SHAPE_CIRCLE::Collide(), SHAPE_LINE_CHAIN::Collide(), SHAPE_LINE_CHAIN::Collide(), SHAPE_LINE_CHAIN_BASE::Collide(), SHAPE_LINE_CHAIN_BASE::Collide(), SHAPE_POLY_SET::Collide(), SHAPE_POLY_SET::Collide(), SHAPE_RECT::Collide(), SHAPE_SEGMENT::Collide(), SHAPE_SEGMENT::Collide(), SHAPE_POLY_SET::CollideEdge(), SHAPE_POLY_SET::CollideVertex(), POLYGON_TEST::getKink(), VERTEX_CONNECTOR::getPoint(), PCB_SELECTION_TOOL::GuessSelectionCandidates(), PAD::HitTest(), PAD::HitTest(), CONVERT_TOOL::makePolysFromChainedSegs(), RN_NET::NearestBicoloredPair(), PNS::TOOL_BASE::snapToItem(), DRC_TEST_PROVIDER_HOLE_TO_HOLE::testHoleAgainstHole(), TestSegmentHit(), and DRC_TEST_PROVIDER_PHYSICAL_CLEARANCE::testShapeLineChain().
SEG::ecoord SEG::SquaredDistance | ( | const SEG & | aSeg | ) | const |
Definition at line 80 of file seg.cpp.
References A, B, VECTOR2< int32_t >::ECOORD_MAX, Intersects(), NearestPoint(), and SEG().
Referenced by PNS::MOUSE_TRAIL_TRACER::AddTrailPoint(), PCB_GRID_HELPER::AlignToSegment(), PNS::TOPOLOGY::AssembleDiffPair(), PNS::PRESERVE_VERTEX_CONSTRAINT::Check(), PNS::checkGap(), Collide(), SHAPE_LINE_CHAIN::Collide(), SHAPE_LINE_CHAIN_BASE::Collide(), SHAPE_RECT::Collide(), SHAPE_POLY_SET::CollideEdge(), Contains(), Distance(), Distance(), SHAPE_LINE_CHAIN_BASE::EdgeContainingPoint(), editArcCenterKeepEndpoints(), TestSegmentHit(), and PCB_CONTROL::UpdateMessagePanel().
SEG::ecoord SEG::SquaredDistance | ( | const VECTOR2I & | aP | ) | const |
Definition at line 685 of file seg.cpp.
References A, B, VECTOR2< T >::Dot(), KiROUND(), VECTOR2< T >::SquaredEuclideanNorm(), VECTOR2< T >::x, and VECTOR2< T >::y.
|
inline |
Definition at line 348 of file seg.h.
Referenced by commonParallelProjection(), PNS::commonParallelProjection(), extractDiffPairCoupledItems(), PNS::OPTIMIZER::mergeColinear(), mutualDistanceSquared(), KIGFX::PCB_PAINTER::renderNetNameForSegment(), and DRC_TEST_PROVIDER_PHYSICAL_CLEARANCE::testShapeLineChain().
|
inline |
Definition at line 405 of file seg.h.
References A, B, and VECTOR2< T >::Dot().
Referenced by commonParallelProjection(), and PNS::commonParallelProjection().
|
friend |
VECTOR2I SEG::A |
Definition at line 49 of file seg.h.
Referenced by PNS::NODE::Add(), STEP_PCB_MODEL::AddBarrel(), STEP_PCB_MODEL::AddHole(), PNS::NODE::addSegment(), FEATURES_MANAGER::AddShape(), PNS::DEBUG_DECORATOR::AddShape(), CREEPAGE_GRAPH::Addshape(), BOARD_ADAPTER::addShape(), SCH_IO_EAGLE::adjustNetLabels(), PCB_GRID_HELPER::AlignToSegment(), Angle(), PNS::ApproximateSegmentAsRect(), ApproxPerpendicular(), PNS::DP_MEANDER_PLACER::baselineSegment(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), PNS::DP_GATEWAYS::BuildFromPrimitivePair(), ZONE_FILLER::buildThermalSpokes(), CanonicalCoefs(), Center(), CheckArcGeom(), SHAPE_LINE_CHAIN::CheckClearance(), checkCollinearOverlap(), checkSelfIntersections(), PNS::DRAGGER::checkVirtualVia(), LENGTH_DELAY_CALCULATION::clipLineToPad(), CollectKnockedOutSegments(), Collide(), Collide(), SHAPE_ARC::Collide(), SHAPE_COMPOUND::Collide(), SHAPE_LINE_CHAIN::Collide(), SHAPE_LINE_CHAIN_BASE::Collide(), SHAPE_RECT::Collide(), SHAPE_SEGMENT::Collide(), collideArc2Arc(), Collinear(), commonParallelProjection(), PNS::commonParallelProjection(), PCB_GRID_HELPER::computeAnchors(), ConnectBoardShapes(), CIRCLE::ConstructFromTanTanPt(), Contains(), KIGEOM::ConvertToChain(), PNS_KICAD_IFACE::createBoardItem(), GENCAD_EXPORTER::createBoardSection(), BOARD_ADAPTER::createPadWithMargin(), PNS::LINE_PLACER::cursorDistMinimum(), PNS::DP_PRIMITIVE_PAIR::CursorOrientation(), DIRECTION_45::DIRECTION_45(), PNS::MEANDER_PLACER::doMove(), PNS::COMPONENT_DRAGGER::Drag(), PNS::MULTI_DRAGGER::Drag(), EDIT_TOOL::DragArcTrack(), PNS::LINE::dragSegment45(), KIGFX::PCB_PAINTER::draw(), KIGFX::PCB_PAINTER::draw(), KIGFX::DrawDashedLine(), ROUTER_PREVIEW_ITEM::drawLineChain(), KI_TEST::DrawSegment(), ROUTER_PREVIEW_ITEM::drawShape(), SHAPE_LINE_CHAIN_BASE::EdgeContainingPoint(), editArcCenterKeepEndpoints(), PCB_TUNING_PATTERN::EditStart(), findEndSegments(), PNS::NODE::findRedundantSegment(), PNS::NODE::findRedundantSegment(), PNS::MEANDER_SHAPE::Fit(), PNS::SHOVE::fixupViaCollisions(), PNS::NODE::FixupVirtualVias(), SHAPE_POLY_SET::GenerateHatchLines(), PNS::getDanglingAnchor(), KIGEOM::GetLengthRatioFromStart(), KIGEOM::GetNearestEndpoint(), KIGEOM::GetOtherEnd(), KIGEOM::GetProjectedPointLengthRatio(), KIGEOM::GetSharedEndpoint(), ALTIUM_PCB::HelperCreateBoardOutline(), PNS::HullIntersection(), HALF_LINE::Intersect(), SHAPE_LINE_CHAIN::Intersect(), SHAPE_LINE_CHAIN::Intersect(), CIRCLE::IntersectLine(), SHAPE_ARC::IntersectLine(), intersects(), IntersectsLine(), SHAPE_POLY_SET::isExteriorWaist(), isLine45Degree(), SHAPE_POLY_SET::IsPolygonSelfIntersecting(), PNS::IsSegment45Degree(), Length(), KIGFX::VIEW_OVERLAY::Line(), LineDistance(), LineProject(), SCH_IO_EAGLE::loadSegments(), PCB_TUNING_PATTERN::MakeEditPoints(), makeWireFromChain(), PNS::MEANDERED_LINE::MeanderSegment(), PNS::OPTIMIZER::mergeDpStep(), PNS::OPTIMIZER::mergeObtuse(), PNS::OPTIMIZER::mergeStep(), PNS_KICAD_IFACE::modifyBoardItem(), PNS::LINE_PLACER::Move(), PNS::MoveDiagonal(), mutualDistanceSquared(), NearestPoint(), NearestPoint(), SHAPE_LINE_CHAIN::NearestPoint(), NearestPoints(), NearestPoints(), SHAPE_ARC::NearestPoints(), KIGEOM::NormalisedSeg(), PCB_SHAPE::Normalize(), operator!=(), operator<(), operator<<, operator=(), operator==(), Overlaps(), PNS::DP_MEANDER_PLACER::pairOrientation(), ParallelSeg(), PCB_IO_EASYEDAPRO_PARSER::ParseBoard(), PCB_IO_EASYEDAPRO_PARSER::ParsePoly(), SCH_EASYEDA_PARSER::ParseSchematic(), SCH_EASYEDAPRO_PARSER::ParseSchematic(), SCH_EASYEDA_PARSER::ParseSymbolShapes(), PCB_IO_EASYEDA_PARSER::ParseToBoardItemContainer(), PCB_IO_KICAD_SEXPR_PARSER::parseZONE(), SHAPE_LINE_CHAIN::PathLength(), PerpendicularSeg(), playground_main_func(), BRDITEMS_PLOTTER::PlotDimension(), SHAPE_LINE_CHAIN::PointAlong(), KIGEOM::PointProjectsOntoSegment(), OUTSET_ROUTINE::ProcessItem(), DOGBONE_CORNER_ROUTINE::ProcessLinePair(), LINE_EXTENSION_ROUTINE::ProcessLinePair(), PNS::LINE_PLACER::reduceTail(), ReflectPoint(), PNS::NODE::removeSegmentIndex(), KIGFX::PCB_PAINTER::renderNetNameForSegment(), Reverse(), Reversed(), DRC_TEST_PROVIDER_CONNECTION_WIDTH::Run(), DRC_TEST_PROVIDER_EDGE_CLEARANCE::Run(), DRC_TEST_PROVIDER_TRACK_ANGLE::Run(), SEG(), SEG(), SEG(), SEG(), segCircleIntersection(), KIGEOM::SegIsInDirection(), GEOM_TEST::SegmentCompletelyInQuadrant(), GEOM_TEST::SegmentCompletelyWithinRadius(), GEOM_TEST::SegmentEndsInQuadrant(), PNS::SegmentHull(), GEOM_TEST::SegmentsHaveSameEndPoints(), segPolyIntersection(), SHAPE_LINE_CHAIN::SelfIntersecting(), SHAPE_LINE_CHAIN::SelfIntersectingWithArcs(), Side(), PNS::LINE::snapToNeighbourSegments(), SHAPE_LINE_CHAIN::Split(), PNS::LINE_PLACER::SplitAdjacentSegments(), SquaredDistance(), SquaredDistance(), SHAPE_POLY_SET::SquaredDistanceToPolygon(), SquaredLength(), PNS::LINE_PLACER::Start(), STROKE_PARAMS::Stroke(), PNS::SEGMENT::SwapEnds(), TCoef(), DRC_TEST_PROVIDER_PHYSICAL_CLEARANCE::testShapeLineChain(), DRC_TEST_PROVIDER_COPPER_CLEARANCE::testZonesToZones(), PNS::tightenSegment(), EDA_SHAPE::TransformShapeToPolygon(), PCB_DIMENSION_BASE::TransformShapeToPolygon(), PCB_TEXTBOX::TransformShapeToPolygon(), unfracture(), SHAPE_POLY_SET::unfractureSingle(), PCB_TUNING_PATTERN::UpdateEditPoints(), PCB_TUNING_PATTERN::UpdateFromEditPoints(), PCB_TUNING_PATTERN::ViewDraw(), and HYPERLYNX_EXPORTER::writeBoardInfo().
VECTOR2I SEG::B |
Definition at line 50 of file seg.h.
Referenced by PNS::NODE::Add(), STEP_PCB_MODEL::AddBarrel(), PCB_POINT_EDITOR::addCorner(), STEP_PCB_MODEL::AddHole(), PNS::MEANDERED_LINE::AddMeander(), PNS::NODE::addSegment(), FEATURES_MANAGER::AddShape(), PNS::DEBUG_DECORATOR::AddShape(), CREEPAGE_GRAPH::Addshape(), BOARD_ADAPTER::addShape(), SCH_IO_EAGLE::adjustNetLabels(), PCB_GRID_HELPER::AlignToSegment(), Angle(), PNS::ApproximateSegmentAsRect(), PNS::DP_MEANDER_PLACER::baselineSegment(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), PNS::DP_GATEWAYS::BuildFromPrimitivePair(), ZONE_FILLER::buildThermalSpokes(), CanonicalCoefs(), Center(), CheckArcGeom(), SHAPE_LINE_CHAIN::CheckClearance(), checkCollinearOverlap(), checkSelfIntersections(), PNS::DRAGGER::checkVirtualVia(), LENGTH_DELAY_CALCULATION::clipLineToPad(), CollectKnockedOutSegments(), Collide(), SHAPE_ARC::Collide(), SHAPE_RECT::Collide(), SHAPE_SEGMENT::Collide(), collideArc2Arc(), Collinear(), commonParallelProjection(), PNS::commonParallelProjection(), PCB_GRID_HELPER::computeAnchors(), ComputeChamferPoints(), ComputeDogbone(), ConnectBoardShapes(), CIRCLE::ConstructFromTanTanPt(), Contains(), KIGEOM::ConvertToChain(), PNS_KICAD_IFACE::createBoardItem(), GENCAD_EXPORTER::createBoardSection(), BOARD_ADAPTER::createPadWithMargin(), PNS::LINE_PLACER::cursorDistMinimum(), PNS::DP_PRIMITIVE_PAIR::CursorOrientation(), DIRECTION_45::DIRECTION_45(), PNS::MEANDER_PLACER::doMove(), PNS::COMPONENT_DRAGGER::Drag(), PNS::MULTI_DRAGGER::Drag(), EDIT_TOOL::DragArcTrack(), PNS::LINE::dragSegment45(), KIGFX::PCB_PAINTER::draw(), KIGFX::PCB_PAINTER::draw(), KIGFX::SCH_PAINTER::draw(), KIGFX::DrawDashedLine(), ROUTER_PREVIEW_ITEM::drawLineChain(), KI_TEST::DrawSegment(), ROUTER_PREVIEW_ITEM::drawShape(), SHAPE_LINE_CHAIN_BASE::EdgeContainingPoint(), editArcCenterKeepEndpoints(), PCB_TUNING_PATTERN::EditStart(), PNS::DIFF_PAIR::EndingPrimitives(), findEndSegments(), PNS::NODE::findRedundantSegment(), PNS::NODE::findRedundantSegment(), PNS::MEANDER_SHAPE::Fit(), PNS::SHOVE::fixupViaCollisions(), PNS::NODE::FixupVirtualVias(), SHAPE_POLY_SET::GenerateHatchLines(), PNS::getDanglingAnchor(), KIGEOM::GetNearestEndpoint(), KIGEOM::GetOtherEnd(), KIGEOM::GetProjectedPointLengthRatio(), KIGEOM::GetSharedEndpoint(), ALTIUM_PCB::HelperCreateBoardOutline(), PNS::HullIntersection(), HALF_LINE::Intersect(), SHAPE_LINE_CHAIN::Intersect(), CIRCLE::IntersectLine(), SHAPE_ARC::IntersectLine(), intersects(), IntersectsLine(), SHAPE_POLY_SET::isExteriorWaist(), isLine45Degree(), SHAPE_POLY_SET::IsPolygonSelfIntersecting(), PNS::IsSegment45Degree(), Length(), KIGFX::VIEW_OVERLAY::Line(), LineDistance(), LineProject(), SCH_IO_EAGLE::loadSegments(), PCB_TUNING_PATTERN::MakeEditPoints(), makeWireFromChain(), PNS::MEANDERED_LINE::MeanderSegment(), PNS::OPTIMIZER::mergeDpStep(), PNS::OPTIMIZER::mergeObtuse(), PNS::OPTIMIZER::mergeStep(), PNS_KICAD_IFACE::modifyBoardItem(), PNS::MoveDiagonal(), mutualDistanceSquared(), NearestPoint(), NearestPoint(), SHAPE_LINE_CHAIN::NearestPoint(), NearestPoints(), NearestPoints(), SHAPE_ARC::NearestPoints(), KIGEOM::NormalisedSeg(), PCB_SHAPE::Normalize(), operator!=(), operator<(), operator<<, operator=(), operator==(), Overlaps(), ParallelSeg(), PCB_IO_EASYEDAPRO_PARSER::ParseBoard(), PCB_IO_EASYEDAPRO_PARSER::ParsePoly(), SCH_EASYEDA_PARSER::ParseSchematic(), SCH_EASYEDAPRO_PARSER::ParseSchematic(), SCH_EASYEDA_PARSER::ParseSymbolShapes(), PCB_IO_EASYEDA_PARSER::ParseToBoardItemContainer(), PCB_IO_KICAD_SEXPR_PARSER::parseZONE(), PerpendicularSeg(), playground_main_func(), BRDITEMS_PLOTTER::PlotDimension(), SHAPE_LINE_CHAIN::PointAlong(), KIGEOM::PointProjectsOntoSegment(), OUTSET_ROUTINE::ProcessItem(), DOGBONE_CORNER_ROUTINE::ProcessLinePair(), LINE_EXTENSION_ROUTINE::ProcessLinePair(), ReflectPoint(), PNS::NODE::removeSegmentIndex(), KIGFX::PCB_PAINTER::renderNetNameForSegment(), Reverse(), Reversed(), DRC_TEST_PROVIDER_CONNECTION_WIDTH::Run(), DRC_TEST_PROVIDER_EDGE_CLEARANCE::Run(), DRC_TEST_PROVIDER_TRACK_ANGLE::Run(), SEG(), SEG(), SEG(), SEG(), segCircleIntersection(), KIGEOM::SegIsInDirection(), GEOM_TEST::SegmentCompletelyInQuadrant(), GEOM_TEST::SegmentCompletelyWithinRadius(), GEOM_TEST::SegmentEndsInQuadrant(), PNS::SegmentHull(), GEOM_TEST::SegmentsHaveSameEndPoints(), segPolyIntersection(), SHAPE_LINE_CHAIN::SelfIntersecting(), SHAPE_LINE_CHAIN::SelfIntersectingWithArcs(), Side(), SHAPE_LINE_CHAIN::Split(), PNS::LINE_PLACER::SplitAdjacentSegments(), SquaredDistance(), SquaredDistance(), SHAPE_POLY_SET::SquaredDistanceToPolygon(), SquaredLength(), PNS::LINE_PLACER::Start(), STROKE_PARAMS::Stroke(), PNS::SEGMENT::SwapEnds(), TCoef(), DRC_TEST_PROVIDER_PHYSICAL_CLEARANCE::testShapeLineChain(), DRC_TEST_PROVIDER_COPPER_CLEARANCE::testZonesToZones(), PNS::tightenSegment(), EDA_SHAPE::TransformShapeToPolygon(), PCB_DIMENSION_BASE::TransformShapeToPolygon(), PCB_TEXTBOX::TransformShapeToPolygon(), unfracture(), SHAPE_POLY_SET::unfractureSingle(), PCB_TUNING_PATTERN::UpdateEditPoints(), PCB_TUNING_PATTERN::UpdateFromEditPoints(), PCB_DIM_RADIAL::updateGeometry(), PCB_TUNING_PATTERN::ViewDraw(), and HYPERLYNX_EXPORTER::writeBoardInfo().
|
private |