NDEVR
API Documentation
GridMesh< t_dims >

Stores a uniform grid of data in N dimensions into a Geometry object. More...

Inheritance diagram for GridMesh< t_dims >:
[legend]
Collaboration diagram for GridMesh< t_dims >:
[legend]

Public Member Functions

 GridMesh ()
 Default constructor.
 GridMesh (const Geometry &model)
 Constructs a GridMesh wrapping the given Geometry object.
Geometry geometry () const
 Returns the underlying Geometry object.
const Vector< t_dims, uint04 > & getIndexSize () const
 Returns the size of the grid in each dimension.
template<class t_type>
t_type getVertexProperty (uint04 property_index, Vector< t_dims, uint04 > index) const
 Retrieves a custom vertex property by column index at the given N-dimensional grid index.
template<class t_type>
t_type interpolateVertex (VertexProperty property, const Vector< t_dims, fltp08 > &index, InterpolationValues interpolation=InterpolationValues::e_linear) const
 Interpolates a vertex property value at a fractional N-dimensional grid coordinate.
bool isValid () const
 Checks whether this GridMesh has a valid underlying Geometry.
void setupVertexTable (Vector< t_dims, uint04 > index_size, Geometry::VertexMode position, Geometry::VertexMode normal=Geometry::VertexMode::e_no_vertex, Geometry::VertexMode color=Geometry::VertexMode::e_no_vertex, Geometry::VertexMode texture=Geometry::VertexMode::e_no_vertex, Geometry::VertexMode tangent=Geometry::VertexMode::e_no_vertex, Geometry::VertexMode bitangent=Geometry::VertexMode::e_no_vertex, Geometry::VertexMode bones=Geometry::VertexMode::e_no_vertex)
 Initializes the vertex table for the grid with the specified dimensions and vertex modes.
template<class t_type>
void setVertex (VertexProperty property, Vector< t_dims, uint04 > index, const t_type &vector)
 Sets a vertex property value at the given N-dimensional grid index.
template<class t_type>
void setVertexProperty (uint04 property_index, Vector< t_dims, uint04 > index, const t_type &value)
 Sets a custom vertex property by column index at the given N-dimensional grid index.
template<class t_type>
t_type vertex (VertexProperty property, Vector< t_dims, uint04 > index) const
 Retrieves a vertex property value at the given N-dimensional grid index.
Public Member Functions inherited from GridIndexing< t_dims >
Vector< t_dims, uint04convertFromIndex (const uint04 &location) const
 Converts a flat 1D index back into an N-dimensional grid coordinate.
uint04 convertToIndex (const Vector< t_dims, uint04 > &location) const
 Converts an N-dimensional grid coordinate into a flat 1D index using row-major ordering.
void setSize (Vector< t_dims, uint04 > index_size)
 Sets the size of the grid in each dimension.

Protected Attributes

Geometry m_geo
 The underlying Geometry object that stores the grid vertex data.
Protected Attributes inherited from GridIndexing< t_dims >
Vector< t_dims, uint04m_size
 The number of elements along each dimension of the grid.

Additional Inherited Members

Static Public Member Functions inherited from GridIndexing< t_dims >
static constexpr uint01 getNumberOfCorners ()
 Returns the number of corners for a grid cell of the given dimensionality.

Detailed Description

template<uint01 t_dims>
class GridMesh< t_dims >

Stores a uniform grid of data in N dimensions into a Geometry object.


Definition at line 123 of file GriddedMesh.h.

Constructor & Destructor Documentation

◆ GridMesh() [1/2]

template<uint01 t_dims>
GridMesh< t_dims >::GridMesh ( )
inline

Default constructor.


Creates an uninitialized GridMesh.

Definition at line 129 of file GriddedMesh.h.

◆ GridMesh() [2/2]

template<uint01 t_dims>
GridMesh< t_dims >::GridMesh ( const Geometry & model)
inlineexplicit

Constructs a GridMesh wrapping the given Geometry object.


Parameters
[in]modelThe Geometry object to use as the underlying storage for grid data.

Definition at line 136 of file GriddedMesh.h.

References m_geo.

Member Function Documentation

◆ geometry()

template<uint01 t_dims>
Geometry GridMesh< t_dims >::geometry ( ) const
inline

Returns the underlying Geometry object.


Returns
A copy of the Geometry object that stores the grid data.

Definition at line 351 of file GriddedMesh.h.

References m_geo.

◆ getIndexSize()

template<uint01 t_dims>
const Vector< t_dims, uint04 > & GridMesh< t_dims >::getIndexSize ( ) const
inline

Returns the size of the grid in each dimension.


Returns
A const reference to the N-dimensional size vector.

Definition at line 195 of file GriddedMesh.h.

References GridIndexing< t_dims >::m_size.

Referenced by interpolateVertex().

◆ getVertexProperty()

template<uint01 t_dims>
template<class t_type>
t_type GridMesh< t_dims >::getVertexProperty ( uint04 property_index,
Vector< t_dims, uint04 > index ) const
inline

Retrieves a custom vertex property by column index at the given N-dimensional grid index.


[NOTE: This function appears to be missing a return statement – it calls m_geo.get() but does not return the result.]

Parameters
[in]property_indexThe column index of the custom property to retrieve.
[in]indexThe N-dimensional grid coordinate of the vertex.
Returns
The property value at the specified grid location.

Definition at line 246 of file GriddedMesh.h.

References GridIndexing< t_dims >::convertToIndex(), and m_geo.

◆ interpolateVertex()

template<uint01 t_dims>
template<class t_type>
t_type GridMesh< t_dims >::interpolateVertex ( VertexProperty property,
const Vector< t_dims, fltp08 > & index,
InterpolationValues interpolation = InterpolationValues::e_linear ) const
inline

Interpolates a vertex property value at a fractional N-dimensional grid coordinate.


Supports nearest-neighbor and linear (bilinear/trilinear) interpolation. Bicubic interpolation is partially implemented but currently returns Invalid.

Parameters
[in]propertyThe vertex property to interpolate.
[in]indexThe fractional N-dimensional grid coordinate at which to interpolate.
[in]interpolationThe interpolation method to use. Defaults to e_linear.
Returns
The interpolated property value, or Constant<t_type>::Invalid if out of bounds or if all corner values are invalid.

Definition at line 263 of file GriddedMesh.h.

References abs(), difference(), getIndexSize(), IsInvalid(), and vertex().

◆ isValid()

template<uint01 t_dims>
bool GridMesh< t_dims >::isValid ( ) const
inline

Checks whether this GridMesh has a valid underlying Geometry.


Returns
True if the underlying Geometry is valid, false otherwise.

Definition at line 144 of file GriddedMesh.h.

References m_geo.

◆ setupVertexTable()

Initializes the vertex table for the grid with the specified dimensions and vertex modes.


Allocates vertices for all grid cells, sets initial positions to grid coordinates, and marks all vertices as hidden and filtered by default.

Parameters
[in]index_sizeThe number of elements along each grid dimension.
[in]positionThe vertex mode for position data.
[in]normalThe vertex mode for normal data. Defaults to e_no_vertex.
[in]colorThe vertex mode for color data. Defaults to e_no_vertex.
[in]textureThe vertex mode for texture coordinate data. Defaults to e_no_vertex.
[in]tangentThe vertex mode for tangent data. Defaults to e_no_vertex.
[in]bitangentThe vertex mode for bitangent data. Defaults to e_no_vertex.
[in]bonesThe vertex mode for bone/skeletal data. Defaults to e_no_vertex.

Definition at line 163 of file GriddedMesh.h.

References cast(), GridIndexing< t_dims >::convertFromIndex(), e_is_filtered, e_is_hidden, Geometry::e_no_vertex, e_points, m_geo, Position, Vector< t_dims, t_type >::product(), VertexLookup::setFlag(), GridIndexing< t_dims >::setSize(), and VertexLookup::setVertex().

◆ setVertex()

template<uint01 t_dims>
template<class t_type>
void GridMesh< t_dims >::setVertex ( VertexProperty property,
Vector< t_dims, uint04 > index,
const t_type & vector )
inline

Sets a vertex property value at the given N-dimensional grid index.


Parameters
[in]propertyThe vertex property to set (e.g., Position, Normal, Color).
[in]indexThe N-dimensional grid coordinate of the vertex.
[in]vectorThe value to assign to the vertex property.

Definition at line 207 of file GriddedMesh.h.

References GridIndexing< t_dims >::convertToIndex(), and m_geo.

◆ setVertexProperty()

template<uint01 t_dims>
template<class t_type>
void GridMesh< t_dims >::setVertexProperty ( uint04 property_index,
Vector< t_dims, uint04 > index,
const t_type & value )
inline

Sets a custom vertex property by column index at the given N-dimensional grid index.


Parameters
[in]property_indexThe column index of the custom property to set.
[in]indexThe N-dimensional grid coordinate of the vertex.
[in]valueThe value to assign to the property.

Definition at line 231 of file GriddedMesh.h.

References GridIndexing< t_dims >::convertToIndex(), and m_geo.

◆ vertex()

template<uint01 t_dims>
template<class t_type>
t_type GridMesh< t_dims >::vertex ( VertexProperty property,
Vector< t_dims, uint04 > index ) const
inline

Retrieves a vertex property value at the given N-dimensional grid index.


Parameters
[in]propertyThe vertex property to retrieve.
[in]indexThe N-dimensional grid coordinate of the vertex.
Returns
The vertex property value at the specified grid location.

Definition at line 219 of file GriddedMesh.h.

References GridIndexing< t_dims >::convertToIndex(), and m_geo.

Referenced by interpolateVertex().


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