KrisLibrary  1.0.0
Public Types | Public Member Functions | Public Attributes | List of all members
Meshing::VolumeGridTemplate< T > Class Template Reference

A 3D array over an axis-aligned 3D volume, containing Real values. More...

#include <VolumeGrid.h>

Public Types

typedef VolumeGridTemplate< T > MyT
 
typedef VolumeGridIterator< T > iterator
 

Public Member Functions

bool IsEmpty () const
 
void Resize (int m, int n, int p)
 
void ResizeByResolution (const Vector3 &res)
 
template<class T2 >
void MakeSimilar (const VolumeGridTemplate< T2 > &grid)
 
template<class T2 >
bool IsSimilar (const VolumeGridTemplate< T2 > &grid) const
 
void GetCell (int i, int j, int k, AABB3D &cell) const
 
void GetCellCenter (int i, int j, int k, Vector3 &center) const
 
Vector3 GetCellSize () const
 
void GetIndex (const Vector3 &pt, int &i, int &j, int &k) const
 Note: does not clamp to valid cells.
 
void GetIndexAndParams (const Vector3 &pt, IntTriple &index, Vector3 &params) const
 Note: does not clamp to valid cells.
 
void GetIndexRange (const AABB3D &range, IntTriple &imin, IntTriple &imax) const
 Note: does not clamp to valid cells.
 
bool GetIndexChecked (const Vector3 &pt, int &i, int &j, int &k) const
 Note: checks whether cell is valid, returns false if cell invalid.
 
bool GetIndexAndParamsChecked (const Vector3 &pt, IntTriple &index, Vector3 &params) const
 Note: checks whether cell is valid, returns false if cell invalid.
 
bool GetIndexRangeClamped (const AABB3D &range, IntTriple &imin, IntTriple &imax) const
 Note: clamps to valid cells, returns false if no cells overlapped.
 
void GetCell (const IntTriple &index, AABB3D &cell) const
 
void GetCenter (const IntTriple &index, Vector3 &center) const
 
void GetIndex (const Vector3 &pt, IntTriple &index) const
 
void SetValue (int i, int j, int k, const T &v)
 
void SetValue (const Vector3 &pt, const T &v)
 
GetValue (int i, int j, int k) const
 
GetValue (const Vector3 &pt) const
 
TrilinearInterpolate (const Vector3 &pt) const
 Computes the trilinear interpolation of the field at pt, assuming values are sampled exactly at cell centers.
 
MinimumFreeInterpolate (const Vector3 &pt) const
 Used only for fast marching method, really.
 
Average (const AABB3D &range) const
 Average value of the range. Each cell's value is weighted by the volume overlap with range.
 
void ResampleTrilinear (const MyT &grid)
 Resamples the given volume grid onto the current grid, taking trilinear interpolation at cell centers.
 
void ResampleAverage (const MyT &grid)
 Resamples the given volume grid onto the current grid, taking averages over grid cells.
 
void Gradient_ForwardDifference (const IntTriple &index, Vector3 &grad) const
 Returns the gradient estimated using forward differencing.
 
void Gradient_CenteredDifference (const IntTriple &index, Vector3 &grad) const
 Returns the gradient estimated using centered differencing.
 
void Gradient (const Vector3 &pt, Vector3 &grad) const
 
void Add (const MyT &grid)
 
void Subtract (const MyT &grid)
 
void Multiply (const MyT &grid)
 
void Max (const MyT &grid)
 
void Min (const MyT &grid)
 
void Add (T val)
 
void Multiply (T val)
 
void Max (T val)
 
void Min (T val)
 
iterator getIterator () const
 

Public Attributes

Array3D< T > value
 
AABB3D bb
 

Detailed Description

template<class T>
class Meshing::VolumeGridTemplate< T >

A 3D array over an axis-aligned 3D volume, containing Real values.

GetIndex returns the cell containing a 3D point. GetIndexAndParams returns the cell containing a 3D point, and its coordinates within that cell.

Cells can be quickly iterated over using the iterator class.

Values are interpreted so they are defined over an entire cell, not the vertices.

Most methods just clamp their arguments to the domain rather than doing bounds checks.

Member Function Documentation

template<class T >
void Meshing::VolumeGridTemplate< T >::Gradient ( const Vector3 pt,
Vector3 grad 
) const

Returns the trilinear interpolated gradient. If any element of pt is on a cell boundary the gradient estimated using centered differencing

Referenced by Geometry::Distance().


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