|
KiCad PCB EDA Suite
|
#include <algorithm>#include <cmath>#include <limits>#include <geometry/seg.h>#include <geometry/segment_index.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_ellipse.h>#include <geometry/shape_poly_set.h>#include <math/vector2d.h>Go to the source code of this file.
Typedefs | |
| typedef VECTOR2I::extended_type | ecoord |
Functions | |
| static bool | Collide (const SHAPE_CIRCLE &aA, const SHAPE_CIRCLE &aB, int aClearance, int *aActual, VECTOR2I *aLocation, VECTOR2I *aMTV) |
| static bool | Collide (const SHAPE_RECT &aA, const SHAPE_CIRCLE &aB, int aClearance, int *aActual, VECTOR2I *aLocation, VECTOR2I *aMTV) |
| static VECTOR2I | pushoutForce (const SHAPE_CIRCLE &aA, const SEG &aB, int aClearance) |
| template<typename SegmentSource, typename Containment> | |
| static bool | collideEllipseVsSegments (const SHAPE_ELLIPSE &aA, const SegmentSource &aSegSource, int aClearance, int aHalfWidth, Containment aContainment, int *aActual, VECTOR2I *aLocation) |
| static bool | Collide (const SHAPE_CIRCLE &aA, const SHAPE_LINE_CHAIN_BASE &aB, int aClearance, int *aActual, VECTOR2I *aLocation, VECTOR2I *aMTV) |
| static bool | Collide (const SHAPE_CIRCLE &aA, const SHAPE_SEGMENT &aSeg, int aClearance, int *aActual, VECTOR2I *aLocation, VECTOR2I *aMTV) |
| static bool | Collide (const SHAPE_LINE_CHAIN_BASE &aA, const SHAPE_LINE_CHAIN_BASE &aB, int aClearance, int *aActual, VECTOR2I *aLocation, VECTOR2I *aMTV) |
| static bool | Collide (const SHAPE_RECT &aA, const SHAPE_LINE_CHAIN_BASE &aB, int aClearance, int *aActual, VECTOR2I *aLocation, VECTOR2I *aMTV) |
| static bool | Collide (const SHAPE_SEGMENT &aA, const SHAPE_SEGMENT &aB, int aClearance, int *aActual, VECTOR2I *aLocation, VECTOR2I *aMTV) |
| static bool | Collide (const SHAPE_LINE_CHAIN_BASE &aA, const SHAPE_SEGMENT &aB, int aClearance, int *aActual, VECTOR2I *aLocation, VECTOR2I *aMTV) |
| static bool | Collide (const SHAPE_RECT &aA, const SHAPE_SEGMENT &aB, int aClearance, int *aActual, VECTOR2I *aLocation, VECTOR2I *aMTV) |
| static bool | Collide (const SHAPE_RECT &aA, const SHAPE_RECT &aB, int aClearance, int *aActual, VECTOR2I *aLocation, VECTOR2I *aMTV) |
| static bool | Collide (const SHAPE_ARC &aA, const SHAPE_CIRCLE &aB, int aClearance, int *aActual, VECTOR2I *aLocation, VECTOR2I *aMTV) |
| static bool | Collide (const SHAPE_ARC &aA, const SHAPE_LINE_CHAIN &aB, int aClearance, int *aActual, VECTOR2I *aLocation, VECTOR2I *aMTV) |
| static bool | Collide (const SHAPE_ARC &aA, const SHAPE_RECT &aB, int aClearance, int *aActual, VECTOR2I *aLocation, VECTOR2I *aMTV) |
| static bool | Collide (const SHAPE_ARC &aA, const SHAPE_SEGMENT &aB, int aClearance, int *aActual, VECTOR2I *aLocation, VECTOR2I *aMTV) |
| static bool | Collide (const SHAPE_ARC &aA, const SHAPE_LINE_CHAIN_BASE &aB, int aClearance, int *aActual, VECTOR2I *aLocation, VECTOR2I *aMTV) |
| static bool | Collide (const SHAPE_ARC &aA, const SHAPE_ARC &aB, int aClearance, int *aActual, VECTOR2I *aLocation, VECTOR2I *aMTV) |
| template<class T_a, class T_b> | |
| bool | CollCase (const SHAPE *aA, const SHAPE *aB, int aClearance, int *aActual, VECTOR2I *aLocation, VECTOR2I *aMTV) |
| template<class T_a, class T_b> | |
| bool | CollCaseReversed (const SHAPE *aA, const SHAPE *aB, int aClearance, int *aActual, VECTOR2I *aLocation, VECTOR2I *aMTV) |
| static bool | Collide (const SHAPE_ELLIPSE &aA, const SHAPE_SEGMENT &aSeg, int aClearance, int *aActual, VECTOR2I *aLocation, VECTOR2I *aMTV) |
| static bool | Collide (const SHAPE_ELLIPSE &aA, const SHAPE_CIRCLE &aB, int aClearance, int *aActual, VECTOR2I *aLocation, VECTOR2I *aMTV) |
| static bool | Collide (const SHAPE_ELLIPSE &aA, const SHAPE_RECT &aB, int aClearance, int *aActual, VECTOR2I *aLocation, VECTOR2I *aMTV) |
| static bool | Collide (const SHAPE_ELLIPSE &aA, const SHAPE_LINE_CHAIN_BASE &aB, int aClearance, int *aActual, VECTOR2I *aLocation, VECTOR2I *aMTV) |
| static bool | Collide (const SHAPE_ELLIPSE &aA, const SHAPE_ARC &aB, int aClearance, int *aActual, VECTOR2I *aLocation, VECTOR2I *aMTV) |
| static bool | Collide (const SHAPE_ELLIPSE &aA, const SHAPE_ELLIPSE &aB, int aClearance, int *aActual, VECTOR2I *aLocation, VECTOR2I *aMTV) |
| static bool | collideSingleShapes (const SHAPE *aA, const SHAPE *aB, int aClearance, int *aActual, VECTOR2I *aLocation, VECTOR2I *aMTV) |
| static bool | collideShapes (const SHAPE *aA, const SHAPE *aB, int aClearance, int *aActual, VECTOR2I *aLocation, VECTOR2I *aMTV) |
| typedef VECTOR2I::extended_type ecoord |
Definition at line 39 of file shape_collisions.cpp.
|
inline |
Definition at line 1116 of file shape_collisions.cpp.
References Collide().
Referenced by collideSingleShapes().
|
inline |
Definition at line 1126 of file shape_collisions.cpp.
References Collide().
Referenced by collideSingleShapes().
|
inlinestatic |
Definition at line 1070 of file shape_collisions.cpp.
References Collide(), delta, SHAPE_ARC::GetP0(), SHAPE_ARC::GetP1(), SHAPE_ARC::GetWidth(), SHAPE_ARC::IsEffectiveLine(), KiROUND(), SHAPE_ARC::NearestPoints(), and SEG::Square().
|
inlinestatic |
Definition at line 801 of file shape_collisions.cpp.
References Collide(), delta, SHAPE_ARC::GetP0(), SHAPE_ARC::GetP1(), SHAPE_ARC::GetWidth(), SHAPE_ARC::IsEffectiveLine(), KiROUND(), SHAPE_ARC::NearestPoints(), and SEG::Square().
|
inlinestatic |
Definition at line 840 of file shape_collisions.cpp.
References SHAPE_LINE_CHAIN::Arc(), SHAPE_LINE_CHAIN::ArcCount(), SHAPE_ARC::Collide(), SHAPE_ARC::GetP0(), SHAPE_LINE_CHAIN::GetSegment(), SHAPE_LINE_CHAIN::GetSegmentCount(), SHAPE_ARC::GetWidth(), SHAPE_LINE_CHAIN::IsArcSegment(), SHAPE_LINE_CHAIN::IsClosed(), SHAPE_LINE_CHAIN::PointInside(), and SHAPE_BASE::TypeName().
|
inlinestatic |
Definition at line 990 of file shape_collisions.cpp.
References SEG::A, EDA_ANGLE::AsDegrees(), SEG::B, SHAPE_ARC::BBox(), Collide(), SHAPE_ARC::Collide(), BOX2< Vec >::GetBottom(), SHAPE_ARC::GetCentralAngle(), BOX2< Vec >::GetLeft(), SHAPE_ARC::GetP0(), SHAPE_ARC::GetP1(), BOX2< Vec >::GetRight(), SHAPE_LINE_CHAIN_BASE::GetSegment(), SHAPE_LINE_CHAIN_BASE::GetSegmentCount(), BOX2< Vec >::GetTop(), SHAPE_ARC::GetWidth(), SHAPE_LINE_CHAIN_BASE::IsClosed(), SHAPE_ARC::IsEffectiveLine(), SHAPE_LINE_CHAIN_BASE::PointInside(), SEG::Square(), SHAPE_BASE::TypeName(), VECTOR2< T >::x, and VECTOR2< T >::y.
|
inlinestatic |
Definition at line 925 of file shape_collisions.cpp.
References Collide(), delta, SHAPE_ARC::GetP0(), SHAPE_ARC::GetP1(), SHAPE_RECT::GetRadius(), SHAPE_ARC::GetWidth(), SHAPE_ARC::IsEffectiveLine(), KiROUND(), SHAPE_ARC::NearestPoints(), SHAPE_RECT::Outline(), and SEG::Square().
|
inlinestatic |
Definition at line 967 of file shape_collisions.cpp.
References Collide(), SHAPE_ARC::Collide(), SHAPE_ARC::GetP0(), SHAPE_ARC::GetP1(), SHAPE_SEGMENT::GetSeg(), SHAPE_ARC::GetWidth(), SHAPE_SEGMENT::GetWidth(), SHAPE_ARC::IsEffectiveLine(), and SHAPE_BASE::TypeName().
|
inlinestatic |
Definition at line 42 of file shape_collisions.cpp.
References delta, SHAPE_CIRCLE::GetCenter(), and SHAPE_CIRCLE::GetRadius().
Referenced by 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(), CollCase(), CollCaseReversed(), Collide(), Collide(), Collide(), Collide(), Collide(), Collide(), Collide(), Collide(), Collide(), Collide(), PCB_TUNING_PATTERN::HitTest(), EDA_SHAPE::hitTest(), indexedCollision(), SCH_RULE_AREA::RefreshContainedItemsAndDirectives(), and DRC_TEST_PROVIDER_COPPER_CLEARANCE::testSingleLayerItemAgainstItem().
|
inlinestatic |
Definition at line 238 of file shape_collisions.cpp.
References SHAPE_CIRCLE::Collide(), SEG::Distance(), SHAPE_CIRCLE::GetCenter(), SHAPE_CIRCLE::GetRadius(), SHAPE_LINE_CHAIN_BASE::GetSegment(), SHAPE_LINE_CHAIN_BASE::GetSegmentCount(), SHAPE_LINE_CHAIN_BASE::IsClosed(), SEG::NearestPoint(), SHAPE_LINE_CHAIN_BASE::PointInside(), pushoutForce(), VECTOR2< T >::Resize(), and SHAPE_CIRCLE::SetCenter().
|
inlinestatic |
Definition at line 335 of file shape_collisions.cpp.
References SHAPE_CIRCLE::Collide(), SHAPE_SEGMENT::GetSeg(), SHAPE_SEGMENT::GetWidth(), and pushoutForce().
|
inlinestatic |
Definition at line 1218 of file shape_collisions.cpp.
References chain, collideEllipseVsSegments(), SHAPE_ARC::ConvertToPolyline(), and SHAPE_ARC::GetWidth().
|
inlinestatic |
Definition at line 1163 of file shape_collisions.cpp.
References SHAPE_CIRCLE::GetCenter(), SHAPE_CIRCLE::GetRadius(), and SHAPE_ELLIPSE::SquaredDistance().
|
inlinestatic |
Definition at line 1238 of file shape_collisions.cpp.
References Collide(), SHAPE_ELLIPSE::ConvertToPolyline(), SHAPE_ELLIPSE::GetCenter(), SHAPE_ELLIPSE::IsArc(), and SHAPE_ELLIPSE::PointInside().
|
inlinestatic |
Definition at line 1204 of file shape_collisions.cpp.
References collideEllipseVsSegments(), SHAPE_ELLIPSE::GetCenter(), SHAPE_LINE_CHAIN_BASE::GetSegmentCount(), SHAPE_LINE_CHAIN_BASE::IsClosed(), and SHAPE_LINE_CHAIN_BASE::PointInside().
|
inlinestatic |
Definition at line 1190 of file shape_collisions.cpp.
References collideEllipseVsSegments(), and SHAPE_RECT::Outline().
|
inlinestatic |
Definition at line 1139 of file shape_collisions.cpp.
References SHAPE_ELLIPSE::Collide(), SHAPE_SEGMENT::GetSeg(), and SHAPE_SEGMENT::GetWidth().
|
inlinestatic |
Definition at line 353 of file shape_collisions.cpp.
References SEG::A, SEG::B, candidates(), chain, Collide(), SEG::Collide(), SHAPE_ARC::Collide(), SHAPE_LINE_CHAIN_BASE::GetPoint(), SHAPE_LINE_CHAIN_BASE::GetPointCount(), SHAPE_LINE_CHAIN_BASE::GetSegment(), SHAPE_LINE_CHAIN_BASE::GetSegmentCount(), index, SHAPE_LINE_CHAIN::IsArcSegment(), SHAPE_LINE_CHAIN_BASE::IsClosed(), SEG::NearestPoint(), NONE, SHAPE_LINE_CHAIN_BASE::PointInside(), result, SH_LINE_CHAIN, SHAPE_BASE::Type(), SHAPE_BASE::TypeName(), VECTOR2< T >::x, and VECTOR2< T >::y.
|
inlinestatic |
Definition at line 749 of file shape_collisions.cpp.
References SHAPE_LINE_CHAIN_BASE::Collide(), SHAPE_SEGMENT::GetSeg(), SHAPE_SEGMENT::GetWidth(), and SHAPE_BASE::TypeName().
|
inlinestatic |
Definition at line 69 of file shape_collisions.cpp.
References delta, VECTOR2< int32_t >::ECOORD_MAX, SHAPE_CIRCLE::GetCenter(), SHAPE_RECT::GetPosition(), SHAPE_CIRCLE::GetRadius(), SHAPE_RECT::GetRadius(), SHAPE_RECT::GetSize(), SEG::NearestPoint(), SHAPE_RECT::Outline(), SEG::Square(), VECTOR2< T >::x, and VECTOR2< T >::y.
|
inlinestatic |
Definition at line 673 of file shape_collisions.cpp.
References SHAPE::Centre(), Collide(), SHAPE_RECT::Collide(), SHAPE_RECT::GetRadius(), SHAPE_LINE_CHAIN_BASE::GetSegment(), SHAPE_LINE_CHAIN_BASE::GetSegmentCount(), SHAPE_LINE_CHAIN_BASE::IsClosed(), SHAPE_RECT::Outline(), SHAPE_LINE_CHAIN_BASE::PointInside(), and SHAPE_BASE::TypeName().
|
inlinestatic |
Definition at line 784 of file shape_collisions.cpp.
References SHAPE_RECT::BBox(), Collide(), SHAPE_RECT::GetRadius(), BOX2< Vec >::Intersects(), and SHAPE_RECT::Outline().
|
inlinestatic |
Definition at line 765 of file shape_collisions.cpp.
References Collide(), SHAPE_RECT::Collide(), SHAPE_RECT::GetRadius(), SHAPE_SEGMENT::GetSeg(), SHAPE_SEGMENT::GetWidth(), SHAPE_RECT::Outline(), and SHAPE_BASE::TypeName().
|
inlinestatic |
Definition at line 733 of file shape_collisions.cpp.
References SHAPE_SEGMENT::Collide(), SHAPE_SEGMENT::GetSeg(), SHAPE_SEGMENT::GetWidth(), and SHAPE_BASE::TypeName().
|
inlinestatic |
Definition at line 184 of file shape_collisions.cpp.
References SHAPE_ELLIPSE::Collide(), and SHAPE_ELLIPSE::GetCenter().
|
static |
Definition at line 1527 of file shape_collisions.cpp.
References actual, clearance, collideSingleShapes(), location, SH_COMPOUND, SHAPE_COMPOUND::Shapes(), VECTOR2< T >::SquaredEuclideanNorm(), and SHAPE_BASE::Type().
Referenced by SHAPE::Collide(), and SHAPE::Collide().
|
static |
Definition at line 1267 of file shape_collisions.cpp.
References CollCase(), CollCaseReversed(), SHAPE_POLY_SET::Collide(), SH_ARC, SH_CIRCLE, SH_ELLIPSE, SH_LINE_CHAIN, SH_NULL, SH_POLY_SET, SH_POLY_SET_TRIANGLE, SH_RECT, SH_SEGMENT, SH_SIMPLE, SHAPE_TYPE_asString(), and SHAPE_BASE::Type().
Referenced by collideShapes().
|
static |
Definition at line 156 of file shape_collisions.cpp.
References SEG::Distance(), SHAPE_CIRCLE::GetCenter(), SHAPE_CIRCLE::GetRadius(), SEG::NearestPoint(), and VECTOR2< T >::Resize().