Cogs.Core
Public Types | Public Member Functions | Private Attributes | List of all members
Cogs::Geometry::AdjacencyList_T< IndexType, maxSize > Struct Template Reference

Utility class for storing the face indexes a vertex belongs to. More...

#include <NormalGenerator.h>

Public Types

typedef std::vector< IndexType > IndexVector
 

Public Member Functions

 AdjacencyList_T ()=default
 Constructs a new list. Initial index count is 0.
 
void push_back (IndexType index)
 Adds a new index value to the back of the index vector.
 
const IndexType & operator[] (size_t i) const
 Gets the index at the given location.
 
size_t size () const
 Gets the size of the index array. Does not correspond to the size of allocated memory.
 

Private Attributes

IndexType data [maxSize]
 
int8_t currentSize = 0
 

Detailed Description

template<class IndexType, int maxSize>
struct Cogs::Geometry::AdjacencyList_T< IndexType, maxSize >

Utility class for storing the face indexes a vertex belongs to.

Template parameters are provided to control the maximum number of faces sharing a vertex. This static sized buffer gives a nice speedup over using a dynamic buffer, and might be switched with dynamic overflow mechanics at a later time if needed.

Definition at line 17 of file NormalGenerator.h.

Member Typedef Documentation

◆ IndexVector

template<class IndexType , int maxSize>
typedef std::vector<IndexType> Cogs::Geometry::AdjacencyList_T< IndexType, maxSize >::IndexVector

Definition at line 19 of file NormalGenerator.h.

Constructor & Destructor Documentation

◆ ~AdjacencyList_T()

template<class IndexType , int maxSize>
Cogs::Geometry::AdjacencyList_T< IndexType, maxSize >::~AdjacencyList_T ( )
inline

Definition at line 24 of file NormalGenerator.h.

Member Function Documentation

◆ operator[]()

template<class IndexType , int maxSize>
const IndexType & Cogs::Geometry::AdjacencyList_T< IndexType, maxSize >::operator[] ( size_t  i) const
inline

Gets the index at the given location.

Definition at line 58 of file NormalGenerator.h.

References Cogs::Geometry::AdjacencyList_T< IndexType, maxSize >::size().

◆ push_back()

template<class IndexType , int maxSize>
void Cogs::Geometry::AdjacencyList_T< IndexType, maxSize >::push_back ( IndexType  index)
inline

Adds a new index value to the back of the index vector.

Definition at line 33 of file NormalGenerator.h.

◆ size()

template<class IndexType , int maxSize>
size_t Cogs::Geometry::AdjacencyList_T< IndexType, maxSize >::size ( ) const
inline

Gets the size of the index array. Does not correspond to the size of allocated memory.

Definition at line 72 of file NormalGenerator.h.

Referenced by Cogs::Geometry::AdjacencyList_T< IndexType, maxSize >::operator[]().

Member Data Documentation

◆ currentSize

template<class IndexType , int maxSize>
int8_t Cogs::Geometry::AdjacencyList_T< IndexType, maxSize >::currentSize = 0
private

Definition at line 85 of file NormalGenerator.h.

◆ data

template<class IndexType , int maxSize>
IndexType Cogs::Geometry::AdjacencyList_T< IndexType, maxSize >::data[maxSize]
private

Definition at line 83 of file NormalGenerator.h.


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