Radium Engine  1.5.20
Loading...
Searching...
No Matches
Ra::Core::Tex< T, N > Class Template Reference

#include <Core/Containers/Tex.hpp>

+ Inheritance diagram for Ra::Core::Tex< T, N >:
+ Collaboration diagram for Ra::Core::Tex< T, N >:

Public Types

using IdxVector = typename Grid<T, N>::IdxVector
 
using Vector = Eigen::Matrix<Scalar, N, 1>
 
using AabbND = Eigen::AlignedBox<Scalar, N>
 
- Public Types inherited from Ra::Core::Grid< T, N >
using IdxVector
 Dimension of our grid.
 
using OffsetVector
 A vector of the size of the grid along each dimension.
 

Public Member Functions

 Tex (const IdxVector &resolution, const Vector &start, const Vector &end)
 Construct a Tex with the given resolution in the box given by two points.
 
 Tex (const IdxVector &resolution, const AabbND &aabb)
 Construct a Tex with the give resulution in the given AABB.
 
 Tex (const Tex &other)=default
 Copy constructor and assignment operator perform a deep copy.
 
Texoperator= (const Tex &other)=default
 
const AabbND & getAabb () const
 
fetch (const Vector &v) const
 Tri-linear interpolation of the grid values at position v.
 
- Public Member Functions inherited from Ra::Core::Grid< T, N >
 Grid (const IdxVector &size=IdxVector::Zero(), const T &val=T())
 Construct a grid of a given size and fill it with the given value.
 
 Grid (const IdxVector &size, const T *values)
 Construct a grid of a given size with values in ()-major format.
 
 Grid (const Grid< T, D > &other)=default
 Copy constructor and assignment operator.
 
Gridoperator= (const Grid< T, D > &other)=default
 
uint size () const
 Returns the number of elements stored.
 
const IdxVectorsizeVector () const
 Returns the size vector (a D-dimensional vector with the size along each dimension).
 
bool empty () const
 Returns true if the grid is empty (i.e. if size() ==0).
 
void clear ()
 Erases all data and makes the grid empty.
 
const T & at (const IdxVector &idx) const
 Access an element with a D-dimensional index.
 
T & at (const IdxVector &idx)
 
const T & at (uint idx) const
 Access an element with a linear index.
 
T & at (uint idx)
 
const T & at (const Iterator &it) const
 Access an element with an iterator.
 
T & at (const Iterator &it)
 
const T * data () const
 Read only access to the underlying data.
 
T * data ()
 Read-write access to the underlying data.
 
Iterator begin ()
 Get an iterator on this grid at the first element.
 
Iterator begin () const
 
Iterator end ()
 Get an iterator on this grid past the last element.
 
Iterator end () const
 

Additional Inherited Members

- Static Public Attributes inherited from Ra::Core::Grid< T, N >
static const uint Dimension
 
- Protected Attributes inherited from Ra::Core::Grid< T, N >
IdxVector m_size
 Indicate the extends of the grid along each dimension.
 
std::vector< T > m_data
 Storage for the grid data.
 

Detailed Description

template<typename T, uint N>
class Ra::Core::Tex< T, N >

This class stores a discretized N-D function defined inside a N-D bounding box. It evaluates the function at a given point in space wrt the stored values N-linear interpolation.

Definition at line 16 of file Tex.hpp.

Member Typedef Documentation

◆ AabbND

template<typename T , uint N>
using Ra::Core::Tex< T, N >::AabbND = Eigen::AlignedBox<Scalar, N>

Definition at line 22 of file Tex.hpp.

◆ IdxVector

template<typename T , uint N>
using Ra::Core::Tex< T, N >::IdxVector = typename Grid<T, N>::IdxVector

Definition at line 20 of file Tex.hpp.

◆ Vector

template<typename T , uint N>
using Ra::Core::Tex< T, N >::Vector = Eigen::Matrix<Scalar, N, 1>

Definition at line 21 of file Tex.hpp.

Constructor & Destructor Documentation

◆ Tex() [1/2]

template<typename T , uint N>
Ra::Core::Tex< T, N >::Tex ( const IdxVector & resolution,
const Vector & start,
const Vector & end )

Construct a Tex with the given resolution in the box given by two points.

Definition at line 135 of file Tex.hpp.

◆ Tex() [2/2]

template<typename T , uint N>
Ra::Core::Tex< T, N >::Tex ( const IdxVector & resolution,
const AabbND & aabb )

Construct a Tex with the give resulution in the given AABB.

Definition at line 142 of file Tex.hpp.

Member Function Documentation

◆ fetch()

template<typename T , uint N>
T Ra::Core::Tex< T, N >::fetch ( const Vector & v) const
inline

Tri-linear interpolation of the grid values at position v.

Definition at line 154 of file Tex.hpp.

+ Here is the call graph for this function:

◆ getAabb()

template<typename T , uint N>
const Tex< T, N >::AabbND & Ra::Core::Tex< T, N >::getAabb ( ) const
inline

Definition at line 149 of file Tex.hpp.


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