KiCad PCB EDA Suite
Loading...
Searching...
No Matches
VERTEX_CONNECTOR Class Reference
Inheritance diagram for VERTEX_CONNECTOR:
VERTEX_SET

Public Member Functions

 VERTEX_CONNECTOR (const BOX2I &aBBox, const SHAPE_POLY_SET &aPolys, int aDist)
 
VERTEXgetPoint (VERTEX *aPt) const
 
void FindResults ()
 
std::set< RESULTSGetResults () const
 

Protected Member Functions

void SetBoundingBox (const BOX2I &aBBox)
 
VERTEXinsertVertex (int aIndex, const VECTOR2I &pt, VERTEX *last, void *aUserData=nullptr)
 Insert a vertex into the vertex set.
 
VERTEXcreateList (const SHAPE_LINE_CHAIN &points, VERTEX *aTail=nullptr, void *aUserData=nullptr)
 Create a list of vertices from a line chain.
 
VERTEXgetNextOutlineVertex (const VERTEX *aPt) const
 Get the next vertex in the outline, avoiding steiner points and points that overlap with splits.
 
VERTEXgetPrevOutlineVertex (const VERTEX *aPt) const
 Get the previous vertex in the outline, avoiding steiner points and points that overlap with splits.
 
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 of vertex a.
 
bool middleInside (const VERTEX *a, const VERTEX *b) const
 Check if the middle of the segment from a to b is inside the polygon.
 
bool same_point (const VERTEX *aA, const VERTEX *aB) const
 Check if two vertices are at the same point.
 
int32_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 a 32-bit Morton code.
 
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.
 

Protected Attributes

BOX2I m_bbox
 
std::deque< VERTEXm_vertices
 
VECTOR2I::extended_type m_simplificationLevel
 

Private Attributes

std::set< RESULTSm_results
 
int m_dist
 

Detailed Description

Definition at line 81 of file zone_filler.cpp.

Constructor & Destructor Documentation

◆ VERTEX_CONNECTOR()

VERTEX_CONNECTOR::VERTEX_CONNECTOR ( const BOX2I aBBox,
const SHAPE_POLY_SET aPolys,
int  aDist 
)
inline

Member Function Documentation

◆ area()

double VERTEX_SET::area ( const VERTEX p,
const VERTEX q,
const VERTEX r 
) const
protectedinherited

Return the twice the signed area of the triangle formed by vertices p, q, and r.

Returns
the area of the triangle defined by the three vertices

Definition at line 83 of file vertex_set.cpp.

References VERTEX::x, and VERTEX::y.

Referenced by POLYGON_TRIANGULATION::earcutList(), POLYGON_TRIANGULATION::goodSplit(), POLYGON_TRIANGULATION::intersects(), VERTEX::isEar(), VERTEX_SET::locallyInside(), POLYGON_TRIANGULATION::removeNullTriangles(), and POLYGON_TRIANGULATION::splitPolygon().

◆ createList()

VERTEX * VERTEX_SET::createList ( const SHAPE_LINE_CHAIN points,
VERTEX aTail = nullptr,
void *  aUserData = nullptr 
)
inherited

Create a list of vertices from a line chain.

Take a SHAPE_LINE_CHAIN and links each point into a circular, doubly-linked list.

Parameters
pointsthe line chain to create the list from
aTailthe optional vertex to which to append the list
aUserDatauser data to associate with the vertices
Returns
the first vertex in the list

Definition at line 9 of file vertex_set.cpp.

References SHAPE_LINE_CHAIN::CPoint(), VERTEX_SET::insertVertex(), VERTEX_SET::m_simplificationLevel, VERTEX::next, SHAPE_LINE_CHAIN::PointCount(), VERTEX::remove(), VECTOR2< T >::SquaredEuclideanNorm(), VECTOR2< T >::x, and VECTOR2< T >::y.

Referenced by POLYGON_TEST::FindPairs(), POLYGON_TRIANGULATION::TesselatePolygon(), and VERTEX_CONNECTOR().

◆ FindResults()

void VERTEX_CONNECTOR::FindResults ( )
inline

◆ getNextOutlineVertex()

VERTEX * VERTEX_SET::getNextOutlineVertex ( const VERTEX aPt) const
protectedinherited

Get the next vertex in the outline, avoiding steiner points and points that overlap with splits.

Parameters
aPtthe current vertex
Returns
the next vertex in the outline

Definition at line 94 of file vertex_set.cpp.

References VERTEX::next, VERTEX::nextZ, VERTEX::prev, VERTEX::prevZ, VERTEX_SET::same_point(), and VERTEX::y.

Referenced by POLYGON_TEST::isSubstantial(), and VERTEX_SET::locallyInside().

◆ getPoint()

VERTEX * VERTEX_CONNECTOR::getPoint ( VERTEX aPt) const
inline

◆ getPrevOutlineVertex()

VERTEX * VERTEX_SET::getPrevOutlineVertex ( const VERTEX aPt) const
protectedinherited

Get the previous vertex in the outline, avoiding steiner points and points that overlap with splits.

Parameters
aPtthe current vertex
Returns
the previous vertex in the outline

Definition at line 121 of file vertex_set.cpp.

References VERTEX::nextZ, VERTEX::prev, VERTEX::prevZ, VERTEX_SET::same_point(), and VERTEX::y.

Referenced by POLYGON_TEST::isSubstantial(), and VERTEX_SET::locallyInside().

◆ GetResults()

std::set< RESULTS > VERTEX_CONNECTOR::GetResults ( ) const
inline

Definition at line 183 of file zone_filler.cpp.

References m_results.

Referenced by ZONE_FILLER::connect_nearby_polys().

◆ insertVertex()

VERTEX * VERTEX_SET::insertVertex ( int  aIndex,
const VECTOR2I pt,
VERTEX last,
void *  aUserData = nullptr 
)
inherited

Insert a vertex into the vertex set.

Create an entry in the vertices lookup and optionally inserts the newly created vertex into an existing linked list.

Parameters
aIndexthe index of the vertex
ptthe point to insert
lastthe last vertex in the list
aUserDatauser data to associate with the vertex
Returns
the newly inserted vertex
a pointer to the newly created vertex.

Definition at line 187 of file vertex_set.cpp.

References VERTEX_SET::m_vertices, VERTEX::next, VERTEX::prev, VECTOR2< T >::x, and VECTOR2< T >::y.

Referenced by VERTEX_SET::createList(), POLYGON_TRIANGULATION::insertTriVertex(), and VERTEX::split().

◆ locallyInside()

bool VERTEX_SET::locallyInside ( const VERTEX a,
const VERTEX b 
) const
protectedinherited

Check whether the segment from vertex a -> vertex b is inside the polygon around the immediate area of vertex a.

We don't define the exact area over which the segment is inside but it is guaranteed to be inside the polygon immediately adjacent to vertex a.

Returns
true if the segment from a->b is inside a's polygon next to vertex a.

Definition at line 150 of file vertex_set.cpp.

References VERTEX_SET::area(), VERTEX_SET::getNextOutlineVertex(), and VERTEX_SET::getPrevOutlineVertex().

Referenced by POLYGON_TRIANGULATION::earcutList(), POLYGON_TEST::getKink(), and POLYGON_TRIANGULATION::goodSplit().

◆ middleInside()

bool VERTEX_SET::middleInside ( const VERTEX a,
const VERTEX b 
) const
protectedinherited

Check if the middle of the segment from a to b is inside the polygon.

Parameters
athe first vertex
bthe second vertex
Returns
true if the point is in the middle of the triangle

Definition at line 162 of file vertex_set.cpp.

References VERTEX::next, VERTEX::x, and VERTEX::y.

Referenced by POLYGON_TRIANGULATION::goodSplit().

◆ same_point()

bool VERTEX_SET::same_point ( const VERTEX aA,
const VERTEX aB 
) const
protectedinherited

Check if two vertices are at the same point.

Parameters
aAthe first vertex
aBthe second vertex
Returns
true if the vertices are at the same point

Definition at line 89 of file vertex_set.cpp.

References VERTEX::x, and VERTEX::y.

Referenced by VERTEX_SET::getNextOutlineVertex(), VERTEX_SET::getPrevOutlineVertex(), and POLYGON_TEST::isSubstantial().

◆ SetBoundingBox()

void VERTEX_SET::SetBoundingBox ( const BOX2I aBBox)
inherited

Definition at line 3 of file vertex_set.cpp.

References VERTEX_SET::m_bbox.

Referenced by VERTEX_CONNECTOR().

◆ zOrder()

int32_t VERTEX_SET::zOrder ( const double  aX,
const double  aY 
) const
protectedinherited

Note that while the inputs are doubles, these are scaled by the size of the bounding box to fit into a 32-bit Morton code.

Calculate the Morton code of the VERTEX http://www.graphics.stanford.edu/~seander/bithacks.html#InterleaveBMN.

Returns
the Morton code for the point (aX, aY)

Definition at line 61 of file vertex_set.cpp.

References BOX2< Vec >::GetHeight(), BOX2< Vec >::GetWidth(), BOX2< Vec >::GetX(), BOX2< Vec >::GetY(), and VERTEX_SET::m_bbox.

Referenced by POLYGON_TEST::getKink(), getPoint(), VERTEX::isEar(), and VERTEX::updateOrder().

Member Data Documentation

◆ m_bbox

BOX2I VERTEX_SET::m_bbox
protectedinherited

◆ m_dist

int VERTEX_CONNECTOR::m_dist
private

Definition at line 190 of file zone_filler.cpp.

Referenced by getPoint(), and VERTEX_CONNECTOR().

◆ m_results

std::set<RESULTS> VERTEX_CONNECTOR::m_results
private

Definition at line 189 of file zone_filler.cpp.

Referenced by FindResults(), and GetResults().

◆ m_simplificationLevel

VECTOR2I::extended_type VERTEX_SET::m_simplificationLevel
protectedinherited

Definition at line 340 of file vertex_set.h.

Referenced by VERTEX_SET::createList(), and VERTEX_SET::VERTEX_SET().

◆ m_vertices


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