|
GEL
2
GEL is a library for Geometry and Linear Algebra
|
Class template for a cell in a hierarchical grid. More...
#include <Cell.h>
Public Types | |
| typedef T | DataType |
Public Member Functions | |
| Cell (const T &val) | |
| void | coalesce (const T &val) |
| void | split () |
| Split cell - causes memory to be reserved for CELL_DIM^3 voxels. | |
| bool | is_coalesced () const |
| Check if the cell is coalesced. | |
| const T & | operator[] (const CGLA::Vec3i &p) const |
| void | store (const CGLA::Vec3i &p, const T &new_val) |
| const T * | get () const |
| T * | get () |
| void | untouch () |
| void | touch () |
| bool | is_touched () const |
Static Public Member Functions | |
| static int | get_dim () |
Protected Member Functions | |
| void | store_priv (const CGLA::Vec3i &p, const T &new_val) |
Class template for a cell in a hierarchical grid.
The template arguments are the type and the cell dimension. A Cell is much like an RGrid - except that a Cell may be coalesced into a single value and then split again when a new value is inserted. Also cells are constrained to be of size NxNxN where N=2^m for some m. This makes some things faster.
The reason for making CELL_DIM a template argument rather than a constructor argument is that we generally have many cells and do not wish that each cell contains its dimension.
| Geometry::Cell< T, CELL_DIM, ChildT >::Cell | ( | const T & | val | ) | [inline] |
Create empty grid cell. A Cell contains initially a single value. Reading (using operator[]) any voxel will yield this value.
| void Geometry::Cell< T, CELL_DIM, ChildT >::coalesce | ( | const T & | val | ) | [inline] |
Clear cell. Removes Cell contents replacing it with a single specified value.
| const T* Geometry::Cell< T, CELL_DIM, ChildT >::get | ( | ) | const [inline] |
Const get a pointer to the first element in the linear array representation of the grid.
| T* Geometry::Cell< T, CELL_DIM, ChildT >::get | ( | ) | [inline] |
Non-const get a pointer to the first element in the linear array representation of the grid.
| static int Geometry::Cell< T, CELL_DIM, ChildT >::get_dim | ( | ) | [inline, static] |
Get dimensions of Cell. Returns only one value since x, y, and z dimensions are the same.
| const T& Geometry::Cell< T, CELL_DIM, ChildT >::operator[] | ( | const CGLA::Vec3i & | p | ) | const [inline] |
Read access to voxel grid. This function is passed a Vec3i and returns the corresponding voxel. If the cell is coalesced, the single value stored is returned.
| void Geometry::Cell< T, CELL_DIM, ChildT >::store_priv | ( | const CGLA::Vec3i & | p, |
| const T & | new_val | ||
| ) | [inline, protected] |
1.7.5.1