KiCad PCB EDA Suite
Loading...
Searching...
No Matches
SHAPE_POLY_SET::TRIANGULATED_POLYGON Class Reference

#include <shape_poly_set.h>

Classes

struct  TRI
 

Public Member Functions

 TRIANGULATED_POLYGON (int aSourceOutline)
 
 TRIANGULATED_POLYGON (const TRIANGULATED_POLYGON &aOther)
 
 ~TRIANGULATED_POLYGON ()
 
void Clear ()
 
void GetTriangle (int index, VECTOR2I &a, VECTOR2I &b, VECTOR2I &c) const
 
void Refine ()
 Refine this triangulation in place with boundary-preserving Lawson edge flips, minimizing the number of sliver triangles and, on ties, maximizing the minimum angle.
 
TRIANGULATED_POLYGONoperator= (const TRIANGULATED_POLYGON &aOther)
 
TRIANGULATED_POLYGONoperator= (TRIANGULATED_POLYGON &&aOther) noexcept
 
void AddTriangle (int a, int b, int c)
 
void AddVertex (const VECTOR2I &aP)
 
size_t GetTriangleCount () const
 
int GetSourceOutlineIndex () const
 
void SetSourceOutlineIndex (int aIndex)
 
const std::deque< TRI > & Triangles () const
 
void SetTriangles (const std::deque< TRI > &aTriangles)
 
const std::deque< VECTOR2I > & Vertices () const
 
void SetVertices (const std::deque< VECTOR2I > &aVertices)
 
size_t GetVertexCount () const
 
void Move (const VECTOR2I &aVec)
 

Private Attributes

int m_sourceOutline
 
std::deque< TRIm_triangles
 
std::deque< VECTOR2Im_vertices
 

Detailed Description

Definition at line 75 of file shape_poly_set.h.

Constructor & Destructor Documentation

◆ TRIANGULATED_POLYGON() [1/2]

SHAPE_POLY_SET::TRIANGULATED_POLYGON::TRIANGULATED_POLYGON ( int aSourceOutline)

◆ TRIANGULATED_POLYGON() [2/2]

SHAPE_POLY_SET::TRIANGULATED_POLYGON::TRIANGULATED_POLYGON ( const TRIANGULATED_POLYGON & aOther)

Definition at line 3576 of file shape_poly_set.cpp.

References m_sourceOutline, m_triangles, m_vertices, and TRIANGULATED_POLYGON().

◆ ~TRIANGULATED_POLYGON()

SHAPE_POLY_SET::TRIANGULATED_POLYGON::~TRIANGULATED_POLYGON ( )

Definition at line 3790 of file shape_poly_set.cpp.

Member Function Documentation

◆ AddTriangle()

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

Definition at line 3570 of file shape_poly_set.cpp.

References m_triangles.

◆ AddVertex()

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

Definition at line 188 of file shape_poly_set.h.

References m_vertices.

◆ Clear()

void SHAPE_POLY_SET::TRIANGULATED_POLYGON::Clear ( )
inline

Definition at line 147 of file shape_poly_set.h.

References m_triangles, and m_vertices.

◆ GetSourceOutlineIndex()

int SHAPE_POLY_SET::TRIANGULATED_POLYGON::GetSourceOutlineIndex ( ) const
inline

Definition at line 195 of file shape_poly_set.h.

References m_sourceOutline.

◆ GetTriangle()

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

◆ GetTriangleCount()

◆ GetVertexCount()

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

Definition at line 216 of file shape_poly_set.h.

References m_vertices.

Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), and BOOST_AUTO_TEST_CASE().

◆ Move()

void SHAPE_POLY_SET::TRIANGULATED_POLYGON::Move ( const VECTOR2I & aVec)
inline

Definition at line 221 of file shape_poly_set.h.

References m_vertices.

◆ operator=() [1/2]

SHAPE_POLY_SET::TRIANGULATED_POLYGON & SHAPE_POLY_SET::TRIANGULATED_POLYGON::operator= ( const TRIANGULATED_POLYGON & aOther)

Definition at line 3587 of file shape_poly_set.cpp.

References m_sourceOutline, m_triangles, m_vertices, and TRIANGULATED_POLYGON().

◆ operator=() [2/2]

TRIANGULATED_POLYGON & SHAPE_POLY_SET::TRIANGULATED_POLYGON::operator= ( TRIANGULATED_POLYGON && aOther)
inlinenoexcept

Definition at line 171 of file shape_poly_set.h.

References m_sourceOutline, m_triangles, m_vertices, and TRIANGULATED_POLYGON().

◆ Refine()

void SHAPE_POLY_SET::TRIANGULATED_POLYGON::Refine ( )

Refine this triangulation in place with boundary-preserving Lawson edge flips, minimizing the number of sliver triangles and, on ties, maximizing the minimum angle.

Adds and removes no vertices or triangles.

Definition at line 3600 of file shape_poly_set.cpp.

References KIGEOM::InCircleDelaunayLegal(), KIGEOM::IsSliverTriangle(), m_triangles, m_vertices, and KIGEOM::OrientationSign().

◆ SetSourceOutlineIndex()

void SHAPE_POLY_SET::TRIANGULATED_POLYGON::SetSourceOutlineIndex ( int aIndex)
inline

Definition at line 196 of file shape_poly_set.h.

References m_sourceOutline.

◆ SetTriangles()

void SHAPE_POLY_SET::TRIANGULATED_POLYGON::SetTriangles ( const std::deque< TRI > & aTriangles)
inline

Definition at line 199 of file shape_poly_set.h.

References m_triangles.

Referenced by BOOST_AUTO_TEST_CASE().

◆ SetVertices()

void SHAPE_POLY_SET::TRIANGULATED_POLYGON::SetVertices ( const std::deque< VECTOR2I > & aVertices)
inline

Definition at line 211 of file shape_poly_set.h.

References m_vertices.

◆ Triangles()

const std::deque< TRI > & SHAPE_POLY_SET::TRIANGULATED_POLYGON::Triangles ( ) const
inline

◆ Vertices()

const std::deque< VECTOR2I > & SHAPE_POLY_SET::TRIANGULATED_POLYGON::Vertices ( ) const
inline

Definition at line 210 of file shape_poly_set.h.

References m_vertices.

Referenced by POLYGON_TRIANGULATION::TesselatePolygon().

Member Data Documentation

◆ m_sourceOutline

int SHAPE_POLY_SET::TRIANGULATED_POLYGON::m_sourceOutline
private

◆ m_triangles

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

◆ m_vertices

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

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