KiCad PCB EDA Suite
|
Public Member Functions | |
VERTEX (size_t aIndex, double aX, double aY, POLYGON_TRIANGULATION *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. | |
void | remove () |
Remove the node from the linked list and z-ordered linked list. | |
void | updateOrder () |
void | updateList () |
After inserting or changing nodes, this function should be called to remove duplicate vertices and ensure z-ordering is correct. | |
void | zSort () |
Sort all vertices in this vertex's list by their Morton code. | |
bool | inTriangle (const VERTEX &a, const VERTEX &b, const VERTEX &c) |
Check to see if triangle surrounds our current vertex. | |
double | area (const VERTEX *aEnd=nullptr) const |
Returns the signed area of the polygon connected to the current vertex, optionally ending at a specified vertex. | |
Public Attributes | |
const size_t | i |
double | x |
double | y |
POLYGON_TRIANGULATION * | parent |
VERTEX * | prev = nullptr |
VERTEX * | next = nullptr |
int32_t | z = 0 |
VERTEX * | prevZ = nullptr |
VERTEX * | nextZ = nullptr |
Definition at line 117 of file polygon_triangulation.h.
|
inline |
Definition at line 119 of file polygon_triangulation.h.
|
inline |
Returns the signed area of the polygon connected to the current vertex, optionally ending at a specified vertex.
Definition at line 282 of file polygon_triangulation.h.
Referenced by POLYGON_TRIANGULATION::earcutList(), POLYGON_TRIANGULATION::goodSplit(), and POLYGON_TRIANGULATION::TesselatePolygon().
|
inline |
Check to see if triangle surrounds our current vertex.
Definition at line 271 of file polygon_triangulation.h.
Referenced by POLYGON_TRIANGULATION::isEar().
|
inline |
Definition at line 134 of file polygon_triangulation.h.
|
inline |
Definition at line 130 of file polygon_triangulation.h.
|
inline |
Remove the node from the linked list and z-ordered linked list.
Definition at line 174 of file polygon_triangulation.h.
References next, nextZ, prev, and prevZ.
Referenced by POLYGON_TRIANGULATION::createList(), POLYGON_TRIANGULATION::earcutList(), POLYGON_TRIANGULATION::removeNullTriangles(), POLYGON_TRIANGULATION::simplifyList(), 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 147 of file polygon_triangulation.h.
References i, POLYGON_TRIANGULATION::m_vertices, next, parent, prev, x, and y.
Referenced by POLYGON_TRIANGULATION::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 201 of file polygon_triangulation.h.
References next, prev, remove(), updateOrder(), and zSort().
Referenced by POLYGON_TRIANGULATION::splitPolygon(), POLYGON_TRIANGULATION::subdividePolygon(), and POLYGON_TRIANGULATION::TesselatePolygon().
|
inline |
Definition at line 191 of file polygon_triangulation.h.
References parent, x, y, z, and POLYGON_TRIANGULATION::zOrder().
Referenced by updateList().
|
inline |
Sort all vertices in this vertex's list by their Morton code.
Definition at line 230 of file polygon_triangulation.h.
References next, nextZ, and prevZ.
Referenced by updateList().
const size_t POLYGON_TRIANGULATION::VERTEX::i |
Definition at line 299 of file polygon_triangulation.h.
Referenced by POLYGON_TRIANGULATION::earcutList(), POLYGON_TRIANGULATION::goodSplit(), POLYGON_TRIANGULATION::intersectsPolygon(), split(), and POLYGON_TRIANGULATION::splitPolygon().
VERTEX* POLYGON_TRIANGULATION::VERTEX::next = nullptr |
Definition at line 306 of file polygon_triangulation.h.
Referenced by area(), POLYGON_TRIANGULATION::createList(), POLYGON_TRIANGULATION::earcutList(), POLYGON_TRIANGULATION::goodSplit(), POLYGON_TRIANGULATION::insertVertex(), POLYGON_TRIANGULATION::isEar(), POLYGON_TRIANGULATION::isTooSmall(), POLYGON_TRIANGULATION::locallyInside(), POLYGON_TRIANGULATION::logVertices(), POLYGON_TRIANGULATION::middleInside(), remove(), POLYGON_TRIANGULATION::removeNullTriangles(), POLYGON_TRIANGULATION::simplifyList(), split(), POLYGON_TRIANGULATION::splitPolygon(), POLYGON_TRIANGULATION::subdividePolygon(), POLYGON_TRIANGULATION::TesselatePolygon(), updateList(), and zSort().
VERTEX* POLYGON_TRIANGULATION::VERTEX::nextZ = nullptr |
Definition at line 313 of file polygon_triangulation.h.
Referenced by POLYGON_TRIANGULATION::goodSplit(), POLYGON_TRIANGULATION::isEar(), remove(), POLYGON_TRIANGULATION::splitPolygon(), and zSort().
POLYGON_TRIANGULATION* POLYGON_TRIANGULATION::VERTEX::parent |
Definition at line 302 of file polygon_triangulation.h.
Referenced by split(), and updateOrder().
VERTEX* POLYGON_TRIANGULATION::VERTEX::prev = nullptr |
Definition at line 305 of file polygon_triangulation.h.
Referenced by POLYGON_TRIANGULATION::earcutList(), POLYGON_TRIANGULATION::goodSplit(), POLYGON_TRIANGULATION::insertVertex(), POLYGON_TRIANGULATION::isEar(), POLYGON_TRIANGULATION::isTooSmall(), POLYGON_TRIANGULATION::locallyInside(), remove(), POLYGON_TRIANGULATION::removeNullTriangles(), POLYGON_TRIANGULATION::simplifyList(), split(), POLYGON_TRIANGULATION::splitPolygon(), POLYGON_TRIANGULATION::TesselatePolygon(), and updateList().
VERTEX* POLYGON_TRIANGULATION::VERTEX::prevZ = nullptr |
Definition at line 312 of file polygon_triangulation.h.
Referenced by POLYGON_TRIANGULATION::goodSplit(), POLYGON_TRIANGULATION::isEar(), remove(), POLYGON_TRIANGULATION::splitPolygon(), and zSort().
double POLYGON_TRIANGULATION::VERTEX::x |
Definition at line 300 of file polygon_triangulation.h.
Referenced by area(), POLYGON_TRIANGULATION::area(), inTriangle(), POLYGON_TRIANGULATION::isEar(), POLYGON_TRIANGULATION::isTooSmall(), POLYGON_TRIANGULATION::logVertices(), POLYGON_TRIANGULATION::middleInside(), operator==(), POLYGON_TRIANGULATION::overlapping(), POLYGON_TRIANGULATION::removeNullTriangles(), POLYGON_TRIANGULATION::simplifyList(), split(), POLYGON_TRIANGULATION::subdividePolygon(), and updateOrder().
double POLYGON_TRIANGULATION::VERTEX::y |
Definition at line 301 of file polygon_triangulation.h.
Referenced by area(), POLYGON_TRIANGULATION::area(), inTriangle(), POLYGON_TRIANGULATION::isEar(), POLYGON_TRIANGULATION::isTooSmall(), POLYGON_TRIANGULATION::logVertices(), POLYGON_TRIANGULATION::middleInside(), operator==(), POLYGON_TRIANGULATION::overlapping(), POLYGON_TRIANGULATION::removeNullTriangles(), POLYGON_TRIANGULATION::simplifyList(), split(), POLYGON_TRIANGULATION::subdividePolygon(), and updateOrder().
int32_t POLYGON_TRIANGULATION::VERTEX::z = 0 |
Definition at line 309 of file polygon_triangulation.h.
Referenced by POLYGON_TRIANGULATION::isEar(), and updateOrder().