VoxelFarm::VoxelData< xDim, yDim, zDim, IdxType > Class Template Reference

Classes

struct  Index
 

Public Types

enum  { cSize = xDim * yDim * zDim }
 
enum  { cAxes = 3 }
 
enum  { cDimX = xDim }
 
enum  { cDimY = yDim }
 
enum  { cDimZ = zDim }
 
enum  { cSerialSize = cSize*(sizeof(VoxelType) + sizeof(MaterialId) + cAxes + cAxes) }
 

Public Member Functions

void setVoxel (const Index &index, const Voxel &voxel)
 
void getVoxel (const Index &index, Voxel &voxel) const
 
void setType (const Index &index, VoxelType type)
 
void addType (const Index &index, VoxelType type)
 
void removeType (const Index &index, VoxelType type)
 
VoxelType getType (const Index &index) const
 
bool hasType (const Index &index, VoxelType type) const
 
void setMaterial (const Index &index, MaterialId material)
 Sets the material of the voxel. More...
 
void setVector (const Index &index, double dx, double dy, double dz)
 Sets the internal point in the voxel using doubles. More...
 
void setVector (const Index &index, unsigned char dx, unsigned char dy, unsigned char dz)
 Sets the internal point in the voxel using unsigned chars. More...
 
void setRotation (const Index &index, double dx, double dy, double dz)
 Sets the rotation of the voxel using doubles. More...
 
void setRotation (const Index &index, unsigned char dx, unsigned char dy, unsigned char dz)
 Sets the rotation of the voxel using unsigned chars. More...
 
MaterialId getMaterial (const Index &index) const
 Gets the value of a voxel material. More...
 
void getVector (const Index &index, double &dx, double &dy, double &dz) const
 Gets the interior point of the voxel as doubles. More...
 
void getVector (const Index &index, float &dx, float &dy, float &dz) const
 Gets the interior point of the voxel as floats. More...
 
void getVector (const Index &index, unsigned char &dx, unsigned char &dy, unsigned char &dz) const
 Gets the interior point of the voxel as unsigned chars. More...
 
void getRotation (const Index &index, double &dx, double &dy, double &dz) const
 Gets the rotation of the voxel as doubles. More...
 
void getRotation (const Index &index, float &dx, float &dy, float &dz) const
 Gets the rotation of the voxel as floats. More...
 
void getRotation (const Index &index, unsigned char &dx, unsigned char &dy, unsigned char &dz) const
 Gets the rotation of the voxel as unsigned chars. More...
 
void clear ()
 Initializes the blocks.
 
void copy (const VoxelData< xDim, yDim, zDim, IdxType > &source)
 
VoxelType * getTypes ()
 Raw data interfaces.
 
MaterialId * getMaterials ()
 
const MaterialId * getMaterials () const
 
unsigned char * getVectors ()
 
const unsigned char * getVectors () const
 
unsigned char * getRotations ()
 
const unsigned char * getRotations () const
 
void serialize (unsigned char *buffer) const
 
void unserialize (unsigned char *buffer)
 

Static Public Member Functions

static int getMaterialsSize ()
 
static int getVectorsSize ()
 
static int getRotationsSize ()
 

Detailed Description

template<int xDim, int yDim, int zDim, typename IdxType>
class VoxelFarm::VoxelData< xDim, yDim, zDim, IdxType >

Definition at line 76 of file VoxelLayer.h.

Member Function Documentation

template<int xDim, int yDim, int zDim, typename IdxType >
MaterialId VoxelFarm::VoxelData< xDim, yDim, zDim, IdxType >::getMaterial ( const Index index) const

Gets the value of a voxel material.

Parameters
indexIndex to the block info

Definition at line 391 of file VoxelLayer.h.

template<int xDim, int yDim, int zDim, typename IdxType >
void VoxelFarm::VoxelData< xDim, yDim, zDim, IdxType >::getRotation ( const Index index,
double &  dx,
double &  dy,
double &  dz 
) const

Gets the rotation of the voxel as doubles.

Parameters
indexIndex to the block info
dxWill contain X coordinates of the voxel rotation when the call returns
dyWill contain Y coordinates of the voxel rotation when the call returns
dzWill contain Z coordinates of the voxel rotation when the call returns

Definition at line 421 of file VoxelLayer.h.

template<int xDim, int yDim, int zDim, typename IdxType >
void VoxelFarm::VoxelData< xDim, yDim, zDim, IdxType >::getRotation ( const Index index,
float &  dx,
float &  dy,
float &  dz 
) const

Gets the rotation of the voxel as floats.

Parameters
indexIndex to the block info
dxWill contain X coordinates of the voxel rotation when the call returns
dyWill contain Y coordinates of the voxel rotation when the call returns
dzWill contain Z coordinates of the voxel rotation when the call returns

Definition at line 429 of file VoxelLayer.h.

template<int xDim, int yDim, int zDim, typename IdxType >
void VoxelFarm::VoxelData< xDim, yDim, zDim, IdxType >::getRotation ( const Index index,
unsigned char &  dx,
unsigned char &  dy,
unsigned char &  dz 
) const

Gets the rotation of the voxel as unsigned chars.

Parameters
indexIndex to the block info
dxWill contain X coordinates of the inner-voxel point, relative to the origin of the voxel, when the call returns
dyWill contain Y coordinates of the inner-voxel point, relative to the origin of the voxel, when the call returns
dzWill contain Z coordinates of the inner-voxel point, relative to the origin of the voxel, when the call returns

Definition at line 437 of file VoxelLayer.h.

template<int xDim, int yDim, int zDim, typename IdxType >
void VoxelFarm::VoxelData< xDim, yDim, zDim, IdxType >::getVector ( const Index index,
double &  dx,
double &  dy,
double &  dz 
) const

Gets the interior point of the voxel as doubles.

Parameters
indexIndex to the block info
dxWill contain X coordinates of the inner-voxel point, relative to the origin of the voxel, when the call returns
dyWill contain Y coordinates of the inner-voxel point, relative to the origin of the voxel, when the call returns
dzWill contain Z coordinates of the inner-voxel point, relative to the origin of the voxel, when the call returns

Definition at line 397 of file VoxelLayer.h.

template<int xDim, int yDim, int zDim, typename IdxType >
void VoxelFarm::VoxelData< xDim, yDim, zDim, IdxType >::getVector ( const Index index,
float &  dx,
float &  dy,
float &  dz 
) const

Gets the interior point of the voxel as floats.

Parameters
indexIndex to the block info
dxWill contain X coordinates of the inner-voxel point, relative to the origin of the voxel, when the call returns
dyWill contain Y coordinates of the inner-voxel point, relative to the origin of the voxel, when the call returns
dzWill contain Z coordinates of the inner-voxel point, relative to the origin of the voxel, when the call returns

Definition at line 405 of file VoxelLayer.h.

template<int xDim, int yDim, int zDim, typename IdxType >
void VoxelFarm::VoxelData< xDim, yDim, zDim, IdxType >::getVector ( const Index index,
unsigned char &  dx,
unsigned char &  dy,
unsigned char &  dz 
) const

Gets the interior point of the voxel as unsigned chars.

Parameters
indexIndex to the block info
dxWill contain X coordinates of the inner-voxel point, relative to the origin of the voxel, when the call returns
dyWill contain Y coordinates of the inner-voxel point, relative to the origin of the voxel, when the call returns
dzWill contain Z coordinates of the inner-voxel point, relative to the origin of the voxel, when the call returns

Definition at line 413 of file VoxelLayer.h.

template<int xDim, int yDim, int zDim, typename IdxType >
void VoxelFarm::VoxelData< xDim, yDim, zDim, IdxType >::setMaterial ( const Index index,
MaterialId  material 
)

Sets the material of the voxel.

Parameters
indexIndex to the point info
materialID for material being set.

Definition at line 338 of file VoxelLayer.h.

template<int xDim, int yDim, int zDim, typename IdxType >
void VoxelFarm::VoxelData< xDim, yDim, zDim, IdxType >::setRotation ( const Index index,
double  dx,
double  dy,
double  dz 
)

Sets the rotation of the voxel using doubles.

Parameters
indexIndex to the point info
dxX coordinates of the voxel rotation
dyY coordinates of the voxel rotation
dzZ coordinates of the voxel rotation

Definition at line 372 of file VoxelLayer.h.

template<int xDim, int yDim, int zDim, typename IdxType >
void VoxelFarm::VoxelData< xDim, yDim, zDim, IdxType >::setRotation ( const Index index,
unsigned char  dx,
unsigned char  dy,
unsigned char  dz 
)

Sets the rotation of the voxel using unsigned chars.

Parameters
indexIndex to the point info
dxX coordinates of the voxel rotation
dyY coordinates of the voxel rotation
dzZ coordinates of the voxel rotation

Definition at line 382 of file VoxelLayer.h.

template<int xDim, int yDim, int zDim, typename IdxType >
void VoxelFarm::VoxelData< xDim, yDim, zDim, IdxType >::setVector ( const Index index,
double  dx,
double  dy,
double  dz 
)

Sets the internal point in the voxel using doubles.

Parameters
indexIndex to the point info
dxX coordinates of the inner-voxel point, relative to the origin of the voxel
dyY coordinates of the inner-voxel point, relative to the origin of the voxel
dzZ coordinates of the inner-voxel point, relative to the origin of the voxel

Definition at line 351 of file VoxelLayer.h.

template<int xDim, int yDim, int zDim, typename IdxType >
void VoxelFarm::VoxelData< xDim, yDim, zDim, IdxType >::setVector ( const Index index,
unsigned char  dx,
unsigned char  dy,
unsigned char  dz 
)

Sets the internal point in the voxel using unsigned chars.

Parameters
indexIndex to the point info
dxX coordinates of the inner-voxel point, relative to the origin of the voxel
dyY coordinates of the inner-voxel point, relative to the origin of the voxel
dzZ coordinates of the inner-voxel point, relative to the origin of the voxel

Definition at line 362 of file VoxelLayer.h.


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