GEL  2
GEL is a library for Geometry and Linear Algebra
Public Types | Public Member Functions
Geometry::RGrid< T > Class Template Reference

Regular voxel grid. More...

#include <RGrid.h>

Inherits Geometry::AncestorGrid< T, RGrid< T > >.

List of all members.

Public Types

typedef T DataType

Public Member Functions

 RGrid (CGLA::Vec3i _dims, const T &val=T())
 RGrid ()
void store (const CGLA::Vec3i &p, const T &t)
T & operator[] (const CGLA::Vec3i &p)
const T & operator[] (const CGLA::Vec3i &p) const
 Read only access to voxel grid through const operator[].
const T * get () const
 Const function to get a pointer to the first voxel in grid.
T * get ()
 Non-const function to get a pointer to the first voxel in grid.
int get_x_dim () const
 Get x dimensions of grid.
int get_xy_dim () const
 Get x size times y size of grid.
int get_size () const
 Get length of linear array actually containing voxels.
void clear ()

Detailed Description

template<class T>
class Geometry::RGrid< T >

Regular voxel grid.

This class template can be instantiated and used directly. This is just a regular voxel grid stored as a linear array with functions to access its contents.


Constructor & Destructor Documentation

template<class T>
Geometry::RGrid< T >::RGrid ( CGLA::Vec3i  _dims,
const T &  val = T() 
) [inline]

Construct a regular voxel grid. This function is passed a Vec3i _dims and an optional initialization value, val. It creates a grid of specified dimensions, and initializes the value of all voxels to val.

template<class T>
Geometry::RGrid< T >::RGrid ( ) [inline]

Construct a grid of dimensions 0,0,0


Member Function Documentation

template<class T>
T& Geometry::RGrid< T >::operator[] ( const CGLA::Vec3i p) [inline]

Read/write access to voxel grid. This is a non-const overloaded operator[]. In a regular grid, we have reserved room for all voxels in advance. Hence, it is possible to create a non-const operator[]. See AncestorGrid::operator[].

template<class T>
void Geometry::RGrid< T >::store ( const CGLA::Vec3i p,
const T &  t 
) [inline]

Store a voxel in a regular grid.

Reimplemented from Geometry::AncestorGrid< T, RGrid< T > >.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations