|
KiCad PCB EDA Suite
|
#include <cmath>#include <limits>#include <geometry/seg.h>#include <geometry/shape.h>#include <geometry/shape_arc.h>#include <geometry/shape_line_chain.h>#include <geometry/shape_circle.h>#include <geometry/shape_rect.h>#include <geometry/shape_segment.h>#include <geometry/shape_compound.h>#include <geometry/shape_poly_set.h>#include <geometry/shape_simple.h>#include <math/vector2d.h>Go to the source code of this file.
Functions | |
| static bool | NearestPoints (const SHAPE_LINE_CHAIN_BASE &aA, const SHAPE_LINE_CHAIN_BASE &aB, VECTOR2I &aPtA, VECTOR2I &aPtB) |
| Find the nearest points between two line chains. | |
| static bool | NearestPoints (const SEG &aSeg, const SHAPE_LINE_CHAIN_BASE &aChain, VECTOR2I &aPtA, VECTOR2I &aPtB) |
| Find the nearest points between a segment and a line chain. | |
| static bool | NearestPoints (const SHAPE_CIRCLE &aA, const SHAPE_CIRCLE &aB, VECTOR2I &aPtA, VECTOR2I &aPtB) |
| Find the nearest points between two circles. | |
| static bool | NearestPoints (const SHAPE_CIRCLE &aCircle, const SHAPE_RECT &aRect, VECTOR2I &aPtA, VECTOR2I &aPtB) |
| Find the nearest points between a circle and a rectangle. | |
| static bool | NearestPoints (const SHAPE_CIRCLE &aCircle, const SEG &aSeg, VECTOR2I &aPtA, VECTOR2I &aPtB) |
| Find the nearest points between a circle and a line segment. | |
| static bool | NearestPoints (const SHAPE_CIRCLE &aCircle, const SHAPE_LINE_CHAIN_BASE &aChain, VECTOR2I &aPtA, VECTOR2I &aPtB) |
| Find the nearest points between a circle and a line chain. | |
| static bool | NearestPoints (const SHAPE_RECT &aA, const SHAPE_RECT &aB, VECTOR2I &aPtA, VECTOR2I &aPtB) |
| Find the nearest points between two rectangles. | |
| static bool | NearestPoints (const SHAPE_RECT &aRect, const SEG &aSeg, VECTOR2I &aPtA, VECTOR2I &aPtB) |
| Find the nearest points between a rectangle and a segment. | |
| static bool | NearestPoints (const SHAPE_RECT &aRect, const SHAPE_LINE_CHAIN_BASE &aChain, VECTOR2I &aPtA, VECTOR2I &aPtB) |
| Find the nearest points between a rectangle and a line chain. | |
| static bool | NearestPoints (const SEG &aA, const SEG &aB, VECTOR2I &aPtA, VECTOR2I &aPtB) |
| Find the nearest points between two segments. | |
| static bool | NearestPoints (const SHAPE_ARC &aArc, const SHAPE_CIRCLE &aCircle, VECTOR2I &aPtA, VECTOR2I &aPtB) |
| Find the nearest points between an arc and other shapes. | |
| static bool | NearestPoints (const SHAPE_ARC &aArc, const SHAPE_RECT &aRect, VECTOR2I &aPtA, VECTOR2I &aPtB) |
| static bool | NearestPoints (const SHAPE_ARC &aArc, const SHAPE_SEGMENT &aSeg, VECTOR2I &aPtA, VECTOR2I &aPtB) |
| static bool | NearestPoints (const SHAPE_ARC &aArcA, const SHAPE_ARC &aArcB, VECTOR2I &aPtA, VECTOR2I &aPtB) |
| static bool | NearestPoints (const SHAPE_ARC &aArc, const SHAPE_LINE_CHAIN_BASE &aChain, VECTOR2I &aPtA, VECTOR2I &aPtB) |
| static bool | NearestPoints (const SHAPE_SEGMENT &aSeg, const SHAPE_CIRCLE &aCircle, VECTOR2I &aPtA, VECTOR2I &aPtB) |
| Find nearest points between SHAPE_SEGMENT and other shapes. | |
| static bool | NearestPoints (const SHAPE_SEGMENT &aSeg, const SHAPE_RECT &aRect, VECTOR2I &aPtA, VECTOR2I &aPtB) |
| static bool | NearestPoints (const SHAPE_SEGMENT &aSegA, const SHAPE_SEGMENT &aSegB, VECTOR2I &aPtA, VECTOR2I &aPtB) |
| static bool | NearestPoints (const SHAPE_SEGMENT &aSeg, const SHAPE_LINE_CHAIN_BASE &aChain, VECTOR2I &aPtA, VECTOR2I &aPtB) |
| template<class T_a, class T_b> | |
| bool | NearestPointsCase (const SHAPE *aA, const SHAPE *aB, VECTOR2I &aPtA, VECTOR2I &aPtB) |
| Template functions to handle shape conversions and reversals. | |
| template<class T_a, class T_b> | |
| bool | NearestPointsCaseReversed (const SHAPE *aA, const SHAPE *aB, VECTOR2I &aPtA, VECTOR2I &aPtB) |
| static bool | nearestPointsSingleShapes (const SHAPE *aA, const SHAPE *aB, VECTOR2I &aPtA, VECTOR2I &aPtB) |
| Main dispatcher for finding nearest points between arbitrary shapes. | |
| static bool | nearestPoints (const SHAPE *aA, const SHAPE *aB, VECTOR2I &aPtA, VECTOR2I &aPtB) |
| Handle compound shapes by finding nearest points between all sub-shape pairs. | |
|
static |
Find the nearest points between two segments.
Definition at line 267 of file shape_nearest_points.cpp.
References SEG::NearestPoint().
|
static |
Find the nearest points between a segment and a line chain.
Definition at line 280 of file shape_nearest_points.cpp.
References chain, SHAPE_LINE_CHAIN_BASE::GetSegment(), SHAPE_LINE_CHAIN_BASE::GetSegmentCount(), NearestPoints(), and SHAPE_ARC::NearestPoints().
|
static |
Find the nearest points between an arc and other shapes.
Uses the arc's built-in NearestPoints methods.
Definition at line 443 of file shape_nearest_points.cpp.
References SHAPE_ARC::NearestPoints().
|
static |
Definition at line 473 of file shape_nearest_points.cpp.
References chain, SHAPE_LINE_CHAIN_BASE::GetSegment(), SHAPE_LINE_CHAIN_BASE::GetSegmentCount(), and SHAPE_ARC::NearestPoints().
|
static |
Definition at line 449 of file shape_nearest_points.cpp.
References SHAPE_ARC::NearestPoints().
|
static |
Definition at line 455 of file shape_nearest_points.cpp.
References SHAPE_SEGMENT::GetSeg(), SHAPE_SEGMENT::GetWidth(), and SHAPE_ARC::NearestPoints().
|
static |
Definition at line 467 of file shape_nearest_points.cpp.
References SHAPE_ARC::NearestPoints().
|
static |
Find the nearest points between two circles.
| aA | first circle |
| aB | second circle |
| aPtA | [out] nearest point on first circle |
| aPtB | [out] nearest point on second circle |
Definition at line 57 of file shape_nearest_points.cpp.
References delta, SHAPE_CIRCLE::GetCenter(), and SHAPE_CIRCLE::GetRadius().
|
static |
Find the nearest points between a circle and a line segment.
| aCircle | the circle |
| aSeg | the segment |
| aPtA | [out] nearest point on circle |
| aPtB | [out] nearest point on segment |
Definition at line 151 of file shape_nearest_points.cpp.
References SEG::A, SEG::B, SHAPE_CIRCLE::GetCenter(), SHAPE_CIRCLE::GetRadius(), and SEG::NearestPoint().
|
static |
Find the nearest points between a circle and a line chain.
Definition at line 175 of file shape_nearest_points.cpp.
References chain, SHAPE_LINE_CHAIN_BASE::GetSegment(), SHAPE_LINE_CHAIN_BASE::GetSegmentCount(), NearestPoints(), and SHAPE_ARC::NearestPoints().
|
static |
Find the nearest points between a circle and a rectangle.
| aCircle | the circle |
| aRect | the rectangle |
| aPtA | [out] nearest point on circle |
| aPtB | [out] nearest point on rectangle |
Definition at line 89 of file shape_nearest_points.cpp.
References SHAPE_CIRCLE::GetCenter(), SHAPE_RECT::GetPosition(), SHAPE_CIRCLE::GetRadius(), SHAPE_RECT::GetSize(), VECTOR2< T >::x, and VECTOR2< T >::y.
|
static |
Find the nearest points between two line chains.
Definition at line 335 of file shape_nearest_points.cpp.
References SHAPE_LINE_CHAIN::Arc(), SHAPE_LINE_CHAIN::ArcCount(), SHAPE_LINE_CHAIN_BASE::GetSegment(), SHAPE_LINE_CHAIN_BASE::GetSegmentCount(), SHAPE_LINE_CHAIN::IsArcSegment(), NearestPoints(), and SHAPE_ARC::NearestPoints().
Referenced by NearestPoints(), NearestPoints(), NearestPoints(), NearestPoints(), NearestPoints(), NearestPoints(), NearestPoints(), NearestPoints(), NearestPoints(), NearestPoints(), NearestPointsCase(), and NearestPointsCaseReversed().
|
static |
Find the nearest points between two rectangles.
Definition at line 229 of file shape_nearest_points.cpp.
References NearestPoints(), and SHAPE_RECT::Outline().
|
static |
Find the nearest points between a rectangle and a segment.
Definition at line 243 of file shape_nearest_points.cpp.
References NearestPoints(), and SHAPE_RECT::Outline().
|
static |
Find the nearest points between a rectangle and a line chain.
Definition at line 255 of file shape_nearest_points.cpp.
References NearestPoints(), and SHAPE_RECT::Outline().
|
static |
Find nearest points between SHAPE_SEGMENT and other shapes.
Definition at line 522 of file shape_nearest_points.cpp.
References SHAPE_SEGMENT::GetSeg(), SHAPE_SEGMENT::GetWidth(), and NearestPoints().
|
static |
Definition at line 565 of file shape_nearest_points.cpp.
References SHAPE_SEGMENT::GetSeg(), SHAPE_SEGMENT::GetWidth(), and NearestPoints().
|
static |
Definition at line 535 of file shape_nearest_points.cpp.
References SHAPE_SEGMENT::GetSeg(), SHAPE_SEGMENT::GetWidth(), and NearestPoints().
|
static |
Definition at line 548 of file shape_nearest_points.cpp.
References SHAPE_SEGMENT::GetSeg(), SHAPE_SEGMENT::GetWidth(), and NearestPoints().
|
static |
Handle compound shapes by finding nearest points between all sub-shape pairs.
Definition at line 861 of file shape_nearest_points.cpp.
References nearestPointsSingleShapes(), SH_COMPOUND, SHAPE_COMPOUND::Shapes(), and SHAPE_BASE::Type().
Referenced by SHAPE::NearestPoints().
|
inline |
Template functions to handle shape conversions and reversals.
Definition at line 584 of file shape_nearest_points.cpp.
References NearestPoints().
Referenced by nearestPointsSingleShapes().
|
inline |
Definition at line 591 of file shape_nearest_points.cpp.
References NearestPoints().
Referenced by nearestPointsSingleShapes().
|
static |
Main dispatcher for finding nearest points between arbitrary shapes.
Definition at line 601 of file shape_nearest_points.cpp.
References chain, SHAPE_POLY_SET::CIterateSegments(), SHAPE_POLY_SET::CIterateSegmentsWithHoles(), SHAPE_ARC::NearestPoints(), NearestPointsCase(), NearestPointsCaseReversed(), nearestPointsSingleShapes(), SH_ARC, SH_CIRCLE, SH_LINE_CHAIN, SH_POLY_SET, SH_POLY_SET_TRIANGLE, SH_RECT, SH_SEGMENT, SH_SIMPLE, and SHAPE_BASE::Type().
Referenced by nearestPoints(), and nearestPointsSingleShapes().