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.
Typedefs | |
typedef VECTOR2I::extended_type | ecoord |
Functions | |
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 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_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 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. | |
typedef VECTOR2I::extended_type ecoord |
Definition at line 39 of file shape_nearest_points.cpp.
|
static |
Find the nearest points between two segments.
Definition at line 293 of file shape_nearest_points.cpp.
References SEG::NearestPoint().
|
static |
Find the nearest points between a segment and a line chain.
Definition at line 306 of file shape_nearest_points.cpp.
References SHAPE_LINE_CHAIN_BASE::GetSegment(), SHAPE_LINE_CHAIN_BASE::GetSegmentCount(), and NearestPoints().
|
static |
Handle compound shapes by finding nearest points between all sub-shape pairs.
Definition at line 837 of file shape_nearest_points.cpp.
References nearestPointsSingleShapes(), SH_COMPOUND, SHAPE_COMPOUND::Shapes(), and SHAPE_BASE::Type().
Referenced by SHAPE::NearestPoints().
|
static |
Find the nearest points between an arc and other shapes.
Uses the arc's built-in NearestPoints methods.
Definition at line 438 of file shape_nearest_points.cpp.
References SHAPE_ARC::NearestPoints().
|
static |
Definition at line 466 of file shape_nearest_points.cpp.
References SHAPE_LINE_CHAIN_BASE::GetSegment(), SHAPE_LINE_CHAIN_BASE::GetSegmentCount(), and SHAPE_ARC::NearestPoints().
|
static |
Definition at line 445 of file shape_nearest_points.cpp.
References SHAPE_ARC::NearestPoints().
|
static |
Definition at line 452 of file shape_nearest_points.cpp.
References SHAPE_SEGMENT::GetSeg(), and SHAPE_ARC::NearestPoints().
|
static |
Definition at line 459 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 51 of file shape_nearest_points.cpp.
References delta, SHAPE_CIRCLE::GetCenter(), SHAPE_CIRCLE::GetRadius(), and VECTOR2< T >::Resize().
Referenced by NearestPoints(), NearestPointsCase(), and NearestPointsCaseReversed().
|
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 146 of file shape_nearest_points.cpp.
References SEG::A, SEG::B, SHAPE_CIRCLE::GetCenter(), SHAPE_CIRCLE::GetRadius(), SEG::NearestPoint(), and VECTOR2< T >::Resize().
|
static |
Find the nearest points between a circle and a line chain.
Definition at line 170 of file shape_nearest_points.cpp.
References SHAPE_LINE_CHAIN_BASE::GetSegment(), SHAPE_LINE_CHAIN_BASE::GetSegmentCount(), and 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 84 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_ARC::NearestPoints(), and NearestPoints().
|
static |
Find the nearest points between two rectangles.
Definition at line 197 of file shape_nearest_points.cpp.
References SHAPE_LINE_CHAIN::CSegment(), SEG::NearestPoint(), SHAPE_RECT::Outline(), and SHAPE_LINE_CHAIN::SegmentCount().
|
static |
Find the nearest points between a rectangle and a segment.
Definition at line 233 of file shape_nearest_points.cpp.
References SHAPE_LINE_CHAIN::CSegment(), SEG::NearestPoint(), SHAPE_RECT::Outline(), and SHAPE_LINE_CHAIN::SegmentCount().
|
static |
Find the nearest points between a rectangle and a line chain.
Definition at line 260 of file shape_nearest_points.cpp.
References SHAPE_LINE_CHAIN::CSegment(), SHAPE_LINE_CHAIN_BASE::GetSegment(), SHAPE_LINE_CHAIN_BASE::GetSegmentCount(), SEG::NearestPoint(), SHAPE_RECT::Outline(), and SHAPE_LINE_CHAIN::SegmentCount().
|
static |
Find nearest points between SHAPE_SEGMENT and other shapes.
Definition at line 493 of file shape_nearest_points.cpp.
References SHAPE_SEGMENT::GetSeg(), SHAPE_SEGMENT::GetWidth(), and NearestPoints().
|
static |
Definition at line 540 of file shape_nearest_points.cpp.
References SHAPE_SEGMENT::GetSeg(), SHAPE_SEGMENT::GetWidth(), and NearestPoints().
|
static |
Definition at line 508 of file shape_nearest_points.cpp.
References SHAPE_SEGMENT::GetSeg(), SHAPE_SEGMENT::GetWidth(), and NearestPoints().
|
static |
Definition at line 522 of file shape_nearest_points.cpp.
References SHAPE_SEGMENT::GetSeg(), SHAPE_SEGMENT::GetWidth(), and NearestPoints().
|
inline |
Template functions to handle shape conversions and reversals.
Definition at line 559 of file shape_nearest_points.cpp.
References NearestPoints().
|
inline |
Definition at line 568 of file shape_nearest_points.cpp.
References NearestPoints().
|
static |
Main dispatcher for finding nearest points between arbitrary shapes.
Definition at line 580 of file shape_nearest_points.cpp.
References SHAPE_LINE_CHAIN::Arc(), SHAPE_LINE_CHAIN::ArcCount(), chain, SHAPE_POLY_SET::CIterateSegments(), SHAPE_LINE_CHAIN::CSegment(), SHAPE_LINE_CHAIN::GetSegment(), SHAPE_LINE_CHAIN::GetSegmentCount(), SHAPE_ARC::NearestPoints(), nearestPointsSingleShapes(), SHAPE_LINE_CHAIN::SegmentCount(), 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().