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 62 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 88 of file shape_poly_set.h.

89  {
90  m_triangles.push_back( aTri );
91  }

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 93 of file shape_poly_set.h.

94  {
95  m_triangles.emplace_back( a, b, c );
96  }

References m_triangles.

◆ AddVertex()

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

Definition at line 98 of file shape_poly_set.h.

99  {
100  m_vertices.push_back( aP );
101  }

References m_vertices.

Referenced by PolygonTriangulation::insertVertex().

◆ Clear()

void SHAPE_POLY_SET::TRIANGULATED_POLYGON::Clear ( )
inline

Definition at line 74 of file shape_poly_set.h.

75  {
76  m_vertices.clear();
77  m_triangles.clear();
78  }

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 80 of file shape_poly_set.h.

81  {
82  auto tri = m_triangles[ index ];
83  a = m_vertices[ tri.a ];
84  b = m_vertices[ tri.b ];
85  c = m_vertices[ tri.c ];
86  }

References m_triangles, and m_vertices.

◆ GetTriangleCount()

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

Definition at line 103 of file shape_poly_set.h.

104  {
105  return m_triangles.size();
106  }

References m_triangles.

◆ GetVertexCount()

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

Definition at line 108 of file shape_poly_set.h.

109  {
110  return m_vertices.size();
111  }

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 115 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 116 of file shape_poly_set.h.

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


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