KiCad PCB EDA Suite
Loading...
Searching...
No Matches
POLYGON_TRIANGULATION::VERTEX Struct Reference

Public Member Functions

 VERTEX (size_t aIndex, double aX, double aY, POLYGON_TRIANGULATION *aParent)
 
VERTEXoperator= (const VERTEX &)=delete
 
VERTEXoperator= (VERTEX &&)=delete
 
bool operator== (const VERTEX &rhs) const
 
bool operator!= (const VERTEX &rhs) const
 
VERTEXsplit (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_TRIANGULATIONparent
 
VERTEXprev = nullptr
 
VERTEXnext = nullptr
 
int32_t z = 0
 
VERTEXprevZ = nullptr
 
VERTEXnextZ = nullptr
 

Detailed Description

Definition at line 117 of file polygon_triangulation.h.

Constructor & Destructor Documentation

◆ VERTEX()

POLYGON_TRIANGULATION::VERTEX::VERTEX ( size_t  aIndex,
double  aX,
double  aY,
POLYGON_TRIANGULATION aParent 
)
inline

Definition at line 119 of file polygon_triangulation.h.

Member Function Documentation

◆ area()

double POLYGON_TRIANGULATION::VERTEX::area ( const VERTEX aEnd = nullptr) const
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.

References next, x, and y.

Referenced by POLYGON_TRIANGULATION::earcutList(), POLYGON_TRIANGULATION::goodSplit(), and POLYGON_TRIANGULATION::TesselatePolygon().

◆ inTriangle()

bool POLYGON_TRIANGULATION::VERTEX::inTriangle ( const VERTEX a,
const VERTEX b,
const VERTEX c 
)
inline

Check to see if triangle surrounds our current vertex.

Definition at line 271 of file polygon_triangulation.h.

References x, and y.

Referenced by POLYGON_TRIANGULATION::isEar().

◆ operator!=()

bool POLYGON_TRIANGULATION::VERTEX::operator!= ( const VERTEX rhs) const
inline

Definition at line 134 of file polygon_triangulation.h.

◆ operator=() [1/2]

VERTEX & POLYGON_TRIANGULATION::VERTEX::operator= ( const VERTEX )
delete

◆ operator=() [2/2]

VERTEX & POLYGON_TRIANGULATION::VERTEX::operator= ( VERTEX &&  )
delete

◆ operator==()

bool POLYGON_TRIANGULATION::VERTEX::operator== ( const VERTEX rhs) const
inline

Definition at line 130 of file polygon_triangulation.h.

References x, and y.

◆ remove()

void POLYGON_TRIANGULATION::VERTEX::remove ( )
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()

VERTEX * POLYGON_TRIANGULATION::VERTEX::split ( VERTEX b)
inline

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.

Returns
the newly created vertex in the polygon that does not include the reference vertex.

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().

◆ updateList()

void POLYGON_TRIANGULATION::VERTEX::updateList ( )
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().

◆ updateOrder()

void POLYGON_TRIANGULATION::VERTEX::updateOrder ( )
inline

Definition at line 191 of file polygon_triangulation.h.

References parent, x, y, z, and POLYGON_TRIANGULATION::zOrder().

Referenced by updateList().

◆ zSort()

void POLYGON_TRIANGULATION::VERTEX::zSort ( )
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().

Member Data Documentation

◆ i

◆ next

◆ nextZ

VERTEX* POLYGON_TRIANGULATION::VERTEX::nextZ = nullptr

◆ parent

POLYGON_TRIANGULATION* POLYGON_TRIANGULATION::VERTEX::parent

Definition at line 302 of file polygon_triangulation.h.

Referenced by split(), and updateOrder().

◆ prev

◆ prevZ

VERTEX* POLYGON_TRIANGULATION::VERTEX::prevZ = nullptr

◆ x

◆ y

◆ z

int32_t POLYGON_TRIANGULATION::VERTEX::z = 0

Definition at line 309 of file polygon_triangulation.h.

Referenced by POLYGON_TRIANGULATION::isEar(), and updateOrder().


The documentation for this struct was generated from the following file: