61 VERTEX(
int aIndex,
double aX,
double aY,
VERTEX_SET* aParent,
void* aUserData =
nullptr ) :
75 return this->
x == rhs.
x && this->
y == rhs.
y;
152 std::deque<VERTEX*> queue;
154 queue.push_back(
this );
157 queue.push_back( p );
159 std::sort( queue.begin(), queue.end(), [](
const VERTEX* a,
const VERTEX* b )
173 VERTEX* prev_elem =
nullptr;
175 for(
VERTEX* elem : queue )
178 prev_elem->
nextZ = elem;
180 elem->
prevZ = prev_elem;
184 prev_elem->
nextZ =
nullptr;
193 return ( c.
x -
x ) * ( a.
y -
y ) - ( a.
x -
x ) * ( c.
y -
y ) >= 0
194 && ( a.
x -
x ) * ( b.
y -
y ) - ( b.
x -
x ) * ( a.
y -
y ) >= 0
195 && ( b.
x -
x ) * ( c.
y -
y ) - ( c.
x -
x ) * ( b.
y -
y ) >= 0;
211 }
while( p !=
this && p != aEnd );
214 a += ( p->
x +
x ) * (
y - p->
y );
232 bool isEar(
bool aMatchUserData =
false )
const;
335 uint32_t
zOrder(
const double aX,
const double aY )
const;
Represent a polyline containing arcs as well as line segments: A chain of connected line and/or arc s...
VECTOR2_TRAITS< int32_t >::extended_type extended_type
std::deque< VERTEX > m_vertices
bool middleInside(const VERTEX *a, const VERTEX *b) const
Check if the middle of the segment from a to b is inside the polygon.
VERTEX * createList(const SHAPE_LINE_CHAIN &points, VERTEX *aTail=nullptr, void *aUserData=nullptr)
Create a list of vertices from a line chain.
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 o...
VERTEX * getPrevOutlineVertex(const VERTEX *aPt) const
Get the previous vertex in the outline, avoiding steiner points and points that overlap with splits.
void SetBoundingBox(const BOX2I &aBBox)
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.
VERTEX * insertVertex(int aIndex, const VECTOR2I &pt, VERTEX *last, void *aUserData=nullptr)
Insert a vertex into the vertex set.
VERTEX_SET(int aSimplificationLevel)
VECTOR2I::extended_type m_simplificationLevel
VERTEX * getNextOutlineVertex(const VERTEX *aPt) const
Get the next vertex in the outline, avoiding steiner points and points that overlap with splits.
uint32_t zOrder(const double aX, const double aY) const
Note that while the inputs are doubles, these are scaled by the size of the bounding box to fit into ...
bool same_point(const VERTEX *aA, const VERTEX *aB) const
Check if two vertices are at the same point.
void zSort()
Sort all vertices in this vertex's list by their Morton code.
VERTEX * split(VERTEX *b)
Split the referenced polygon between the reference point and vertex b, assuming they are in the same ...
VERTEX & operator=(const VERTEX &)=delete
bool operator!=(const VERTEX &rhs) const
void updateList()
After inserting or changing nodes, this function should be called to remove duplicate vertices and en...
bool inTriangle(const VERTEX &a, const VERTEX &b, const VERTEX &c)
Check to see if triangle surrounds our current vertex.
bool operator==(const VERTEX &rhs) const
void * GetUserData() const
void remove()
Remove the node from the linked list and z-ordered linked list.
VERTEX(int aIndex, double aX, double aY, VERTEX_SET *aParent, void *aUserData=nullptr)
VERTEX & operator=(VERTEX &&)=delete
double area(const VERTEX *aEnd=nullptr) const
Returns the signed area of the polygon connected to the current vertex, optionally ending at a specif...
bool isEar(bool aMatchUserData=false) const
Check whether the given vertex is in the middle of an ear.