KiCad PCB EDA Suite
|
Classes | |
struct | Vertex |
Public Member Functions | |
POLYGON_TEST (int aLimit) | |
bool | FindPairs (const SHAPE_LINE_CHAIN &aPoly) |
std::set< std::pair< int, int > > & | GetVertices () |
Private Member Functions | |
int32_t | zOrder (const double aX, const double aY) const |
Calculate the Morton code of the Vertex http://www.graphics.stanford.edu/~seander/bithacks.html#InterleaveBMN. | |
constexpr bool | same_point (const Vertex *aA, const Vertex *aB) const |
Vertex * | getNextOutlineVertex (const Vertex *aPt) const |
Vertex * | getPrevOutlineVertex (const Vertex *aPt) const |
bool | isSubstantial (const Vertex *aA, const Vertex *aB) const |
Checks to see if there is a "substantial" protrusion in each polygon produced by the cut from aA to aB. | |
Vertex * | createList (const SHAPE_LINE_CHAIN &points) |
Take a SHAPE_LINE_CHAIN and links each point into a circular, doubly-linked list. | |
Vertex * | getKink (Vertex *aPt) const |
double | area (const Vertex *p, const Vertex *q, const Vertex *r) const |
Return the twice the signed area of the triangle formed by vertices p, q, and r. | |
bool | locallyInside (const Vertex *a, const Vertex *b) const |
Check whether the segment from vertex a -> vertex b is inside the polygon around the immediate area of vertex a. | |
Vertex * | insertVertex (int aIndex, const VECTOR2I &pt, Vertex *last) |
Create an entry in the vertices lookup and optionally inserts the newly created vertex into an existing linked list. | |
Private Attributes | |
int | m_limit |
BOX2I | m_bbox |
std::deque< Vertex > | m_vertices |
std::set< std::pair< int, int > > | m_hits |
Definition at line 114 of file drc_test_provider_connection_width.cpp.
|
inline |
Definition at line 117 of file drc_test_provider_connection_width.cpp.
|
inlineprivate |
Return the twice the signed area of the triangle formed by vertices p, q, and r.
Definition at line 558 of file drc_test_provider_connection_width.cpp.
References POLYGON_TEST::Vertex::x, and POLYGON_TEST::Vertex::y.
Referenced by locallyInside().
|
inlineprivate |
Take a SHAPE_LINE_CHAIN and links each point into a circular, doubly-linked list.
Definition at line 464 of file drc_test_provider_connection_width.cpp.
References SHAPE_LINE_CHAIN::CPoint(), insertVertex(), POLYGON_TEST::Vertex::next, SHAPE_LINE_CHAIN::PointCount(), POLYGON_TEST::Vertex::remove(), VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by FindPairs().
|
inline |
Definition at line 122 of file drc_test_provider_connection_width.cpp.
References SHAPE_LINE_CHAIN::BBox(), createList(), getKink(), POLYGON_TEST::Vertex::i, m_bbox, m_hits, m_vertices, POLYGON_TEST::Vertex::next, and POLYGON_TEST::Vertex::prev.
Definition at line 497 of file drc_test_provider_connection_width.cpp.
References std::abs(), POLYGON_TEST::Vertex::i, isSubstantial(), locallyInside(), m_limit, POLYGON_TEST::Vertex::next, POLYGON_TEST::Vertex::nextZ, POLYGON_TEST::Vertex::prev, POLYGON_TEST::Vertex::prevZ, SEG::Square(), VECTOR2< T >::SquaredEuclideanNorm(), POLYGON_TEST::Vertex::x, POLYGON_TEST::Vertex::y, POLYGON_TEST::Vertex::z, and zOrder().
Referenced by FindPairs().
Definition at line 326 of file drc_test_provider_connection_width.cpp.
References POLYGON_TEST::Vertex::next, POLYGON_TEST::Vertex::nextZ, POLYGON_TEST::Vertex::prev, POLYGON_TEST::Vertex::prevZ, same_point(), and POLYGON_TEST::Vertex::y.
Referenced by isSubstantial(), and locallyInside().
Definition at line 353 of file drc_test_provider_connection_width.cpp.
References POLYGON_TEST::Vertex::nextZ, POLYGON_TEST::Vertex::prev, POLYGON_TEST::Vertex::prevZ, same_point(), and POLYGON_TEST::Vertex::y.
Referenced by isSubstantial(), and locallyInside().
|
inline |
Definition at line 159 of file drc_test_provider_connection_width.cpp.
References m_hits.
|
inlineprivate |
Create an entry in the vertices lookup and optionally inserts the newly created vertex into an existing linked list.
Definition at line 590 of file drc_test_provider_connection_width.cpp.
References m_vertices, POLYGON_TEST::Vertex::next, POLYGON_TEST::Vertex::prev, VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by createList().
Checks to see if there is a "substantial" protrusion in each polygon produced by the cut from aA to aB.
Substantial in this case means that the polygon bulges out to a wider cross-section than the distance from aA to aB
aA | Starting point in the polygon |
aB | Ending point in the polygon |
Definition at line 389 of file drc_test_provider_connection_width.cpp.
References std::abs(), getNextOutlineVertex(), getPrevOutlineVertex(), m_limit, m_vertices, same_point(), POLYGON_TEST::Vertex::x, and POLYGON_TEST::Vertex::y.
Referenced by getKink().
Check whether the segment from vertex a -> vertex b is inside the polygon around the immediate area of vertex a.
We don't define the exact area over which the segment is inside but it is guaranteed to be inside the polygon immediately adjacent to vertex a.
Definition at line 573 of file drc_test_provider_connection_width.cpp.
References area(), getNextOutlineVertex(), and getPrevOutlineVertex().
Referenced by getKink().
|
inlineconstexprprivate |
Definition at line 321 of file drc_test_provider_connection_width.cpp.
References POLYGON_TEST::Vertex::x, and POLYGON_TEST::Vertex::y.
Referenced by getNextOutlineVertex(), getPrevOutlineVertex(), and isSubstantial().
|
inlineprivate |
Calculate the Morton code of the Vertex http://www.graphics.stanford.edu/~seander/bithacks.html#InterleaveBMN.
Definition at line 303 of file drc_test_provider_connection_width.cpp.
References BOX2< Vec >::GetHeight(), BOX2< Vec >::GetWidth(), BOX2< Vec >::GetX(), BOX2< Vec >::GetY(), and m_bbox.
Referenced by getKink(), and POLYGON_TEST::Vertex::updateOrder().
|
private |
Definition at line 613 of file drc_test_provider_connection_width.cpp.
Referenced by FindPairs(), and zOrder().
|
private |
Definition at line 615 of file drc_test_provider_connection_width.cpp.
Referenced by FindPairs(), and GetVertices().
|
private |
Definition at line 612 of file drc_test_provider_connection_width.cpp.
Referenced by getKink(), and isSubstantial().
|
private |
Definition at line 614 of file drc_test_provider_connection_width.cpp.
Referenced by FindPairs(), insertVertex(), and isSubstantial().