KiCad PCB EDA Suite
Loading...
Searching...
No Matches
TRIANGLE_LIST Class Reference

Container to manage a vector of triangles. More...

#include <layer_triangles.h>

Public Member Functions

 TRIANGLE_LIST (unsigned int aNrReservedTriangles, bool aReserveNormals)
 
void Reserve_More (unsigned int aNrReservedTriangles, bool aReserveNormals)
 Reserve more triangles.
 
void AddTriangle (const SFVEC3F &aV1, const SFVEC3F &aV2, const SFVEC3F &aV3)
 
void AddQuad (const SFVEC3F &aV1, const SFVEC3F &aV2, const SFVEC3F &aV3, const SFVEC3F &aV4)
 
void AddNormal (const SFVEC3F &aN1, const SFVEC3F &aN2, const SFVEC3F &aN3)
 
void AddNormal (const SFVEC3F &aN1, const SFVEC3F &aN2, const SFVEC3F &aN3, const SFVEC3F &aN4)
 
const float * GetVertexPointer () const
 Get the array of vertices.
 
const float * GetNormalsPointer () const
 Get the array of normals.
 
unsigned int GetVertexSize () const
 
unsigned int GetNormalsSize () const
 

Private Attributes

SFVEC3F_VECTOR m_vertexs
 vertex array
 
SFVEC3F_VECTOR m_normals
 normals array
 

Detailed Description

Container to manage a vector of triangles.

Definition at line 43 of file layer_triangles.h.

Constructor & Destructor Documentation

◆ TRIANGLE_LIST()

TRIANGLE_LIST::TRIANGLE_LIST ( unsigned int  aNrReservedTriangles,
bool  aReserveNormals 
)
Parameters
aNrReservedTrianglesis number of triangles expected to be used.
aReserveNormalsif you use normals, set it to bool to reserve space.

Definition at line 31 of file layer_triangles.cpp.

References m_normals, and m_vertexs.

Member Function Documentation

◆ AddNormal() [1/2]

void TRIANGLE_LIST::AddNormal ( const SFVEC3F aN1,
const SFVEC3F aN2,
const SFVEC3F aN3 
)

Definition at line 75 of file layer_triangles.cpp.

References m_normals.

Referenced by TRIANGLE_DISPLAY_LIST::AddToMiddleContourns().

◆ AddNormal() [2/2]

void TRIANGLE_LIST::AddNormal ( const SFVEC3F aN1,
const SFVEC3F aN2,
const SFVEC3F aN3,
const SFVEC3F aN4 
)

Definition at line 82 of file layer_triangles.cpp.

References m_normals.

◆ AddQuad()

void TRIANGLE_LIST::AddQuad ( const SFVEC3F aV1,
const SFVEC3F aV2,
const SFVEC3F aV3,
const SFVEC3F aV4 
)

◆ AddTriangle()

void TRIANGLE_LIST::AddTriangle ( const SFVEC3F aV1,
const SFVEC3F aV2,
const SFVEC3F aV3 
)

◆ GetNormalsPointer()

const float * TRIANGLE_LIST::GetNormalsPointer ( ) const
inline

Get the array of normals.

Returns
a pointer to start of array of normals.

Definition at line 79 of file layer_triangles.h.

References m_normals.

Referenced by OPENGL_RENDER_LIST::generate_middle_triangles().

◆ GetNormalsSize()

unsigned int TRIANGLE_LIST::GetNormalsSize ( ) const
inline

◆ GetVertexPointer()

const float * TRIANGLE_LIST::GetVertexPointer ( ) const
inline

Get the array of vertices.

Returns
a pointer to the start of array vertex.

Definition at line 72 of file layer_triangles.h.

References m_vertexs.

Referenced by OPENGL_RENDER_LIST::generate_middle_triangles(), OPENGL_RENDER_LIST::generate_top_or_bot_seg_ends(), and OPENGL_RENDER_LIST::generate_top_or_bot_triangles().

◆ GetVertexSize()

◆ Reserve_More()

void TRIANGLE_LIST::Reserve_More ( unsigned int  aNrReservedTriangles,
bool  aReserveNormals 
)

Reserve more triangles.

Definition at line 45 of file layer_triangles.cpp.

References m_normals, and m_vertexs.

Referenced by TRIANGLE_DISPLAY_LIST::AddToMiddleContourns().

Member Data Documentation

◆ m_normals

SFVEC3F_VECTOR TRIANGLE_LIST::m_normals
private

normals array

Definition at line 87 of file layer_triangles.h.

Referenced by AddNormal(), GetNormalsPointer(), GetNormalsSize(), Reserve_More(), and TRIANGLE_LIST().

◆ m_vertexs

SFVEC3F_VECTOR TRIANGLE_LIST::m_vertexs
private

vertex array

Definition at line 86 of file layer_triangles.h.

Referenced by AddQuad(), AddTriangle(), GetVertexPointer(), GetVertexSize(), Reserve_More(), and TRIANGLE_LIST().


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