KiCad PCB EDA Suite
Loading...
Searching...
No Matches
PolygonTriangulation::Vertex Struct Reference

Public Member Functions

 Vertex (size_t aIndex, double aX, double aY, PolygonTriangulation *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. 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
 
PolygonTriangulationparent
 
Vertexprev = nullptr
 
Vertexnext = nullptr
 
int32_t z = 0
 
VertexprevZ = nullptr
 
VertexnextZ = nullptr
 

Detailed Description

Definition at line 89 of file polygon_triangulation.h.

Constructor & Destructor Documentation

◆ Vertex()

PolygonTriangulation::Vertex::Vertex ( size_t  aIndex,
double  aX,
double  aY,
PolygonTriangulation aParent 
)
inline

Definition at line 91 of file polygon_triangulation.h.

Member Function Documentation

◆ inTriangle()

bool PolygonTriangulation::Vertex::inTriangle ( const Vertex a,
const Vertex b,
const Vertex c 
)
inline

Check to see if triangle surrounds our current vertex.

Definition at line 243 of file polygon_triangulation.h.

References x, and y.

Referenced by PolygonTriangulation::isEar().

◆ operator!=()

bool PolygonTriangulation::Vertex::operator!= ( const Vertex rhs) const
inline

Definition at line 106 of file polygon_triangulation.h.

◆ operator=() [1/2]

Vertex & PolygonTriangulation::Vertex::operator= ( const Vertex )
delete

◆ operator=() [2/2]

Vertex & PolygonTriangulation::Vertex::operator= ( Vertex &&  )
delete

◆ operator==()

bool PolygonTriangulation::Vertex::operator== ( const Vertex rhs) const
inline

Definition at line 102 of file polygon_triangulation.h.

References x, and y.

◆ remove()

void PolygonTriangulation::Vertex::remove ( )
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()

Vertex * PolygonTriangulation::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 119 of file polygon_triangulation.h.

References i, PolygonTriangulation::m_vertices, next, parent, prev, x, and y.

Referenced by PolygonTriangulation::splitPolygon().

◆ updateList()

void PolygonTriangulation::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 173 of file polygon_triangulation.h.

References next, prev, remove(), updateOrder(), and zSort().

Referenced by PolygonTriangulation::splitPolygon(), and PolygonTriangulation::TesselatePolygon().

◆ updateOrder()

void PolygonTriangulation::Vertex::updateOrder ( )
inline

Definition at line 163 of file polygon_triangulation.h.

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

Referenced by updateList().

◆ zSort()

void PolygonTriangulation::Vertex::zSort ( )
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().

Member Data Documentation

◆ i

◆ next

◆ nextZ

Vertex* PolygonTriangulation::Vertex::nextZ = nullptr

Definition at line 264 of file polygon_triangulation.h.

Referenced by PolygonTriangulation::isEar(), remove(), and zSort().

◆ parent

PolygonTriangulation* PolygonTriangulation::Vertex::parent

Definition at line 253 of file polygon_triangulation.h.

Referenced by split(), and updateOrder().

◆ prev

◆ prevZ

Vertex* PolygonTriangulation::Vertex::prevZ = nullptr

Definition at line 263 of file polygon_triangulation.h.

Referenced by PolygonTriangulation::isEar(), remove(), and zSort().

◆ x

const double PolygonTriangulation::Vertex::x

◆ y

const double PolygonTriangulation::Vertex::y

◆ z

int32_t PolygonTriangulation::Vertex::z = 0

Definition at line 260 of file polygon_triangulation.h.

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


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