KiCad PCB EDA Suite
SHAPE_POLY_SET::TRIANGULATED_POLYGON Class Reference

#include <shape_poly_set.h>

Classes

struct  TRI
 

Public Member Functions

void Clear ()
 
void GetTriangle (int index, VECTOR2I &a, VECTOR2I &b, VECTOR2I &c) const
 
void AddTriangle (const TRI &aTri)
 
void AddTriangle (int a, int b, int c)
 
void AddVertex (const VECTOR2I &aP)
 
size_t GetTriangleCount () const
 
size_t GetVertexCount () const
 

Private Attributes

std::deque< TRIm_triangles
 
std::deque< VECTOR2Im_vertices
 

Detailed Description

Definition at line 71 of file shape_poly_set.h.

Member Function Documentation

◆ AddTriangle() [1/2]

void SHAPE_POLY_SET::TRIANGULATED_POLYGON::AddTriangle ( const TRI aTri)
inline

Definition at line 97 of file shape_poly_set.h.

98  {
99  m_triangles.push_back( aTri );
100  }

References m_triangles.

Referenced by PolygonTriangulation::earcutList().

◆ AddTriangle() [2/2]

void SHAPE_POLY_SET::TRIANGULATED_POLYGON::AddTriangle ( int  a,
int  b,
int  c 
)
inline

Definition at line 102 of file shape_poly_set.h.

103  {
104  m_triangles.emplace_back( a, b, c );
105  }

References m_triangles.

◆ AddVertex()

void SHAPE_POLY_SET::TRIANGULATED_POLYGON::AddVertex ( const VECTOR2I aP)
inline

Definition at line 107 of file shape_poly_set.h.

108  {
109  m_vertices.push_back( aP );
110  }

References m_vertices.

Referenced by PolygonTriangulation::insertVertex().

◆ Clear()

void SHAPE_POLY_SET::TRIANGULATED_POLYGON::Clear ( )
inline

Definition at line 83 of file shape_poly_set.h.

84  {
85  m_vertices.clear();
86  m_triangles.clear();
87  }

References m_triangles, and m_vertices.

Referenced by PolygonTriangulation::TesselatePolygon().

◆ GetTriangle()

void SHAPE_POLY_SET::TRIANGULATED_POLYGON::GetTriangle ( int  index,
VECTOR2I a,
VECTOR2I b,
VECTOR2I c 
) const
inline

Definition at line 89 of file shape_poly_set.h.

90  {
91  auto tri = m_triangles[ index ];
92  a = m_vertices[ tri.a ];
93  b = m_vertices[ tri.b ];
94  c = m_vertices[ tri.c ];
95  }

References m_triangles, and m_vertices.

◆ GetTriangleCount()

size_t SHAPE_POLY_SET::TRIANGULATED_POLYGON::GetTriangleCount ( ) const
inline

Definition at line 112 of file shape_poly_set.h.

113  {
114  return m_triangles.size();
115  }

References m_triangles.

◆ GetVertexCount()

size_t SHAPE_POLY_SET::TRIANGULATED_POLYGON::GetVertexCount ( ) const
inline

Definition at line 117 of file shape_poly_set.h.

118  {
119  return m_vertices.size();
120  }

References m_vertices.

Referenced by PolygonTriangulation::insertVertex().

Member Data Documentation

◆ m_triangles

std::deque<TRI> SHAPE_POLY_SET::TRIANGULATED_POLYGON::m_triangles
private

Definition at line 124 of file shape_poly_set.h.

Referenced by AddTriangle(), Clear(), GetTriangle(), and GetTriangleCount().

◆ m_vertices

std::deque<VECTOR2I> SHAPE_POLY_SET::TRIANGULATED_POLYGON::m_vertices
private

Definition at line 125 of file shape_poly_set.h.

Referenced by AddVertex(), Clear(), GetTriangle(), and GetVertexCount().


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