KiCad PCB EDA Suite
|
Public Member Functions | |
Vertex (size_t aIndex, double aX, double aY, PolygonTriangulation *aParent) | |
Vertex & | operator= (const Vertex &)=delete |
Vertex & | operator= (Vertex &&)=delete |
bool | operator== (const Vertex &rhs) const |
bool | operator!= (const Vertex &rhs) const |
Vertex * | split (Vertex *b) |
Split the referenced polygon between the reference point and vertex b, assuming they are in the same polygon. More... | |
void | remove () |
Remove the node from the linked list and z-ordered linked list. More... | |
void | updateOrder () |
void | updateList () |
After inserting or changing nodes, this function should be called to remove duplicate vertices and ensure z-ordering is correct. More... | |
void | zSort () |
Sort all vertices in this vertex's list by their Morton code. More... | |
bool | inTriangle (const Vertex &a, const Vertex &b, const Vertex &c) |
Check to see if triangle surrounds our current vertex. More... | |
Public Attributes | |
const size_t | i |
const double | x |
const double | y |
PolygonTriangulation * | parent |
Vertex * | prev = nullptr |
Vertex * | next = nullptr |
int32_t | z = 0 |
Vertex * | prevZ = nullptr |
Vertex * | nextZ = nullptr |
Definition at line 89 of file polygon_triangulation.h.
|
inline |
Definition at line 91 of file polygon_triangulation.h.
|
inline |
Check to see if triangle surrounds our current vertex.
Definition at line 243 of file polygon_triangulation.h.
Referenced by PolygonTriangulation::isEar().
|
inline |
Definition at line 106 of file polygon_triangulation.h.
|
inline |
Definition at line 102 of file polygon_triangulation.h.
|
inline |
Remove the node from the linked list and z-ordered linked list.
Definition at line 146 of file polygon_triangulation.h.
References next, nextZ, prev, and prevZ.
Referenced by PolygonTriangulation::createList(), PolygonTriangulation::earcutList(), PolygonTriangulation::removeNullTriangles(), and updateList().
Split the referenced polygon between the reference point and vertex b, assuming they are in the same polygon.
Notes that while we create a new vertex pointer for the linked list, we maintain the same vertex index value from the original polygon. In this way, we have two polygons that both share the same vertices.
Definition at line 119 of file polygon_triangulation.h.
References i, PolygonTriangulation::m_vertices, next, parent, prev, x, and y.
Referenced by PolygonTriangulation::splitPolygon().
|
inline |
After inserting or changing nodes, this function should be called to remove duplicate vertices and ensure z-ordering is correct.
Remove duplicates
Definition at line 173 of file polygon_triangulation.h.
References next, prev, remove(), updateOrder(), and zSort().
Referenced by PolygonTriangulation::splitPolygon(), and PolygonTriangulation::TesselatePolygon().
|
inline |
Definition at line 163 of file polygon_triangulation.h.
References parent, x, y, z, and PolygonTriangulation::zOrder().
Referenced by updateList().
|
inline |
Sort all vertices in this vertex's list by their Morton code.
Definition at line 202 of file polygon_triangulation.h.
References next, nextZ, and prevZ.
Referenced by updateList().
const size_t PolygonTriangulation::Vertex::i |
Definition at line 250 of file polygon_triangulation.h.
Referenced by PolygonTriangulation::earcutList(), PolygonTriangulation::goodSplit(), PolygonTriangulation::intersectsPolygon(), split(), and PolygonTriangulation::splitPolygon().
Vertex* PolygonTriangulation::Vertex::next = nullptr |
Definition at line 257 of file polygon_triangulation.h.
Referenced by PolygonTriangulation::createList(), PolygonTriangulation::earcutList(), PolygonTriangulation::goodSplit(), PolygonTriangulation::insertVertex(), PolygonTriangulation::intersectsPolygon(), PolygonTriangulation::isEar(), PolygonTriangulation::locallyInside(), remove(), PolygonTriangulation::removeNullTriangles(), split(), PolygonTriangulation::splitPolygon(), PolygonTriangulation::TesselatePolygon(), updateList(), and zSort().
Vertex* PolygonTriangulation::Vertex::nextZ = nullptr |
Definition at line 264 of file polygon_triangulation.h.
Referenced by PolygonTriangulation::isEar(), remove(), and zSort().
PolygonTriangulation* PolygonTriangulation::Vertex::parent |
Definition at line 253 of file polygon_triangulation.h.
Referenced by split(), and updateOrder().
Vertex* PolygonTriangulation::Vertex::prev = nullptr |
Definition at line 256 of file polygon_triangulation.h.
Referenced by PolygonTriangulation::earcutList(), PolygonTriangulation::goodSplit(), PolygonTriangulation::insertVertex(), PolygonTriangulation::isEar(), PolygonTriangulation::locallyInside(), remove(), PolygonTriangulation::removeNullTriangles(), split(), PolygonTriangulation::splitPolygon(), PolygonTriangulation::TesselatePolygon(), and updateList().
Vertex* PolygonTriangulation::Vertex::prevZ = nullptr |
Definition at line 263 of file polygon_triangulation.h.
Referenced by PolygonTriangulation::isEar(), remove(), and zSort().
const double PolygonTriangulation::Vertex::x |
Definition at line 251 of file polygon_triangulation.h.
Referenced by PolygonTriangulation::area(), inTriangle(), PolygonTriangulation::isEar(), operator==(), split(), and updateOrder().
const double PolygonTriangulation::Vertex::y |
Definition at line 252 of file polygon_triangulation.h.
Referenced by PolygonTriangulation::area(), inTriangle(), PolygonTriangulation::isEar(), operator==(), split(), and updateOrder().
int32_t PolygonTriangulation::Vertex::z = 0 |
Definition at line 260 of file polygon_triangulation.h.
Referenced by PolygonTriangulation::isEar(), and updateOrder().