Radium Engine  1.5.20
Loading...
Searching...
No Matches
Ra::Core::VectorArray< V > Class Template Reference

This class implements ContainerIntrospectionInterface for AlignedStdVector. More...

#include <Core/Containers/VectorArray.hpp>

+ Inheritance diagram for Ra::Core::VectorArray< V >:
+ Collaboration diagram for Ra::Core::VectorArray< V >:

Public Types

using component_type = typename TypeHelper::component_type
 
using Matrix = Eigen::Matrix<component_type, TypeHelper::NumberOfComponents, Eigen::Dynamic>
 
using MatrixMap = Eigen::Map<Matrix>
 
using ConstMatrixMap = Eigen::Map<const Matrix>
 

Public Member Functions

Container Introsection implementation
size_t getSize () const override
 
size_t getNumberOfComponents () const override
 
size_t getBufferSize () const override
 
int getStride () const override
 
const void * dataPtr () const override
 
Eigen::Map getter

Map data to an Eigen::Matrix, only defined when NumberOfComponents > 0 (e.g. for arithmetic types and fixed size eigen vectors).

template<int N = NumberOfComponents>
std::enable_if_t<(N > 0), MatrixMap > getMap ()
 
template<int N = NumberOfComponents>
std::enable_if_t<(N > 0), ConstMatrixMap > getMap () const
 
- Public Member Functions inherited from std::vector< T >
push_back (T... args)
 
crbegin (T... args)
 
erase (T... args)
 
data (T... args)
 
insert (T... args)
 
pop_back (T... args)
 
shrink_to_fit (T... args)
 
back (T... args)
 
end (T... args)
 
resize (T... args)
 
emplace_back (T... args)
 
size (T... args)
 
cbegin (T... args)
 
front (T... args)
 
~vector (T... args)
 
rbegin (T... args)
 
crend (T... args)
 
assign (T... args)
 
operator= (T... args)
 
vector (T... args)
 
reserve (T... args)
 
capacity (T... args)
 
empty (T... args)
 
cend (T... args)
 
swap (T... args)
 
max_size (T... args)
 
rend (T... args)
 
get_allocator (T... args)
 
clear (T... args)
 
at (T... args)
 
emplace (T... args)
 
operator[] (T... args)
 
begin (T... args)
 
- Public Member Functions inherited from Ra::Core::Utils::ContainerIntrospectionInterface
virtual ~ContainerIntrospectionInterface ()
 only needed for correct abstract dtor call.
 

Static Public Attributes

static constexpr int NumberOfComponents = TypeHelper::NumberOfComponents
 

Additional Inherited Members

- Public Attributes inherited from std::vector< T >
elements
 STL member.
 

Detailed Description

template<typename V>
class Ra::Core::VectorArray< V >

This class implements ContainerIntrospectionInterface for AlignedStdVector.

It provides Eigen::Map functionality if the underlying component allows it (i.e. fixed size).

Definition at line 34 of file VectorArray.hpp.

Member Typedef Documentation

◆ component_type

template<typename V >
using Ra::Core::VectorArray< V >::component_type = typename TypeHelper::component_type

component_type is different from value_type defined in Base class, e.g. for VectorArray<Vector3> value_type is Vector3 while component_type is Scalar. but for VectorArray<Scalar> value_type = component_type = Scalar.

Definition at line 46 of file VectorArray.hpp.

◆ ConstMatrixMap

template<typename V >
using Ra::Core::VectorArray< V >::ConstMatrixMap = Eigen::Map<const Matrix>

Definition at line 49 of file VectorArray.hpp.

◆ Matrix

template<typename V >
using Ra::Core::VectorArray< V >::Matrix = Eigen::Matrix<component_type, TypeHelper::NumberOfComponents, Eigen::Dynamic>

Definition at line 47 of file VectorArray.hpp.

◆ MatrixMap

template<typename V >
using Ra::Core::VectorArray< V >::MatrixMap = Eigen::Map<Matrix>

Definition at line 48 of file VectorArray.hpp.

Member Function Documentation

◆ dataPtr()

template<typename V >
const void * Ra::Core::VectorArray< V >::dataPtr ( ) const
inlineoverridevirtual
Returns
a const pointer to the raw data

Implements Ra::Core::Utils::ContainerIntrospectionInterface.

Definition at line 60 of file VectorArray.hpp.

+ Here is the call graph for this function:

◆ getBufferSize()

template<typename V >
size_t Ra::Core::VectorArray< V >::getBufferSize ( ) const
inlineoverridevirtual
Returns
the size in byte of container

Implements Ra::Core::Utils::ContainerIntrospectionInterface.

Definition at line 58 of file VectorArray.hpp.

+ Here is the call graph for this function:

◆ getMap() [1/2]

template<typename V >
template<int N = NumberOfComponents>
std::enable_if_t<(N > 0), MatrixMap > Ra::Core::VectorArray< V >::getMap ( )
inline

Returns the array as an Eigen Matrix Map.

Definition at line 70 of file VectorArray.hpp.

+ Here is the call graph for this function:

◆ getMap() [2/2]

template<typename V >
template<int N = NumberOfComponents>
std::enable_if_t<(N > 0), ConstMatrixMap > Ra::Core::VectorArray< V >::getMap ( ) const
inline

Returns the array as an Eigen Matrix Map (const version).

Definition at line 79 of file VectorArray.hpp.

+ Here is the call graph for this function:

◆ getNumberOfComponents()

template<typename V >
size_t Ra::Core::VectorArray< V >::getNumberOfComponents ( ) const
inlineoverridevirtual

Return the number of components of one element (i.e. for glVertexAttribPointer size argument )

See also
https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glVertexAttribPointer.xhtml
Returns
the number of components of one element (i.e. faces, vector)

Implements Ra::Core::Utils::ContainerIntrospectionInterface.

Definition at line 57 of file VectorArray.hpp.

+ Here is the call graph for this function:

◆ getSize()

template<typename V >
size_t Ra::Core::VectorArray< V >::getSize ( ) const
inlineoverridevirtual
Returns
the number of element (i.e. faces, vector) contained in the array.

Implements Ra::Core::Utils::ContainerIntrospectionInterface.

Definition at line 56 of file VectorArray.hpp.

+ Here is the call graph for this function:

◆ getStride()

template<typename V >
int Ra::Core::VectorArray< V >::getStride ( ) const
inlineoverridevirtual
Returns
the stride, in bytes, from one attribute address to the next one.
Warning
it's meaningful only if the attrib do not contain heap allocated data. Such attrib could not be easily sent to the GPU, and getStride is meaningless.

Implements Ra::Core::Utils::ContainerIntrospectionInterface.

Definition at line 59 of file VectorArray.hpp.

Member Data Documentation

◆ NumberOfComponents

template<typename V >
int Ra::Core::VectorArray< V >::NumberOfComponents = TypeHelper::NumberOfComponents
staticconstexpr

Definition at line 40 of file VectorArray.hpp.


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