1 #ifndef MULTI_VOLUME_GRID_H 2 #define MULTI_VOLUME_GRID_H 4 #include <KrisLibrary/meshing/VolumeGrid.h> 5 #include <KrisLibrary/math/vector.h> 24 inline bool IsEmpty()
const {
return channels.empty() || channels[0].IsEmpty(); }
25 void AddChannel(
const std::string& name);
26 void SetChannelName(
int channel,
const std::string& name);
27 int GetChannel(
const std::string& name)
const;
29 void Resize(
int m,
int n,
int p);
30 void ResizeByResolution(
const Vector3& res);
37 inline void GetCell(
int i,
int j,
int k,
AABB3D& cell)
const {
return channels[0].GetCell(i,j,k,cell); }
38 inline void GetCellCenter(
int i,
int j,
int k,
Vector3& center)
const {
return channels[0].GetCellCenter(i,j,k,center); }
39 inline Vector3 GetCellSize()
const {
return channels[0].GetCellSize(); }
40 inline void GetIndex(
const Vector3& pt,
int& i,
int& j,
int& k)
const {
return channels[0].GetIndex(pt,i,j,k); }
41 inline void GetIndexAndParams(
const Vector3& pt,
IntTriple& index,
Vector3& params)
const {
return channels[0].GetIndexAndParams(pt,index,params); }
42 inline void GetIndexRange(
const AABB3D& range,
IntTriple& imin,
IntTriple& imax)
const {
return channels[0].GetIndexRange(range,imin,imax); }
43 inline void GetCell(
const IntTriple& index,
AABB3D& cell)
const { GetCell(index.a,index.b,index.c,cell); }
44 inline void GetCenter(
const IntTriple& index,
Vector3& center)
const { GetCellCenter(index.a,index.b,index.c,center); }
45 inline void GetIndex(
const Vector3& pt,
IntTriple& index)
const { GetIndex(pt,index.a,index.b,index.c); }
56 void TrilinearInterpolate(
const Vector3& pt,
Vector& values)
const;
62 std::vector<Meshing::VolumeGridTemplate<float> > channels;
63 std::vector<std::string> channelNames;
A lightweight integer 3-tuple class.
Definition: IntTriple.h:9
A 3D vector class.
Definition: math3d/primitives.h:136
A 3D axis-aligned bounding box.
Definition: AABB3D.h:13
Contains all the definitions in the Math3D package.
Definition: AnyGeometry.h:13
A 3D array over an axis-aligned 3D volume, containing one or more channels.
Definition: MultiVolumeGrid.h:20
A 3D array over an axis-aligned 3D volume, containing Real values.
Definition: AnyGeometry.h:11
Contains all definitions in the Geometry package.
Definition: AnyGeometry.cpp:26