PolyVox  0.3.0-dev
Open source voxel management library
Classes | Public Member Functions | Protected Member Functions | List of all members
PolyVox::RawVolume< VoxelType > Class Template Reference

#include <RawVolume.h>

+ Inheritance diagram for PolyVox::RawVolume< VoxelType >:
+ Collaboration diagram for PolyVox::RawVolume< VoxelType >:

Classes

class  Sampler
 

Public Member Functions

 RawVolume (const Region &regValid)
 Constructor for creating a fixed size volume.
 
 ~RawVolume ()
 Destructor.
 
VoxelType getVoxel (int32_t uXPos, int32_t uYPos, int32_t uZPos) const
 Gets a voxel at the position given by x,y,z coordinates.
 
VoxelType getVoxel (const Vector3DInt32 &v3dPos) const
 Gets a voxel at the position given by a 3D vector.
 
VoxelType getVoxelAt (int32_t uXPos, int32_t uYPos, int32_t uZPos) const
 Gets a voxel at the position given by x,y,z coordinates.
 
VoxelType getVoxelAt (const Vector3DInt32 &v3dPos) const
 Gets a voxel at the position given by a 3D vector.
 
VoxelType getVoxelWithWrapping (int32_t uXPos, int32_t uYPos, int32_t uZPos, WrapMode eWrapMode=WrapModes::Border, VoxelType tBorder=VoxelType()) const
 Gets a voxel at the position given by x,y,z coordinates.
 
VoxelType getVoxelWithWrapping (const Vector3DInt32 &v3dPos, WrapMode eWrapMode=WrapModes::Border, VoxelType tBorder=VoxelType()) const
 Gets a voxel at the position given by a 3D vector.
 
bool setVoxelAt (int32_t uXPos, int32_t uYPos, int32_t uZPos, VoxelType tValue)
 Sets the voxel at the position given by x,y,z coordinates.
 
bool setVoxelAt (const Vector3DInt32 &v3dPos, VoxelType tValue)
 Sets the voxel at the position given by a 3D vector.
 
uint32_t calculateSizeInBytes (void)
 Calculates approximatly how many bytes of memory the volume is currently using.
 
- Public Member Functions inherited from PolyVox::BaseVolume< VoxelType >
VoxelType getBorderValue (void) const
 Gets the value used for voxels which are outside the volume.
 
const RegiongetEnclosingRegion (void) const
 Gets a Region representing the extents of the Volume.
 
int32_t getWidth (void) const
 Gets the width of the volume in voxels.
 
int32_t getHeight (void) const
 Gets the height of the volume in voxels.
 
int32_t getDepth (void) const
 Gets the depth of the volume in voxels.
 
int32_t getLongestSideLength (void) const
 Gets the length of the longest side in voxels.
 
int32_t getShortestSideLength (void) const
 Gets the length of the shortest side in voxels.
 
float getDiagonalLength (void) const
 Gets the length of the diagonal in voxels.
 
VoxelType getVoxel (int32_t uXPos, int32_t uYPos, int32_t uZPos) const
 Gets a voxel at the position given by x,y,z coordinates.
 
VoxelType getVoxel (const Vector3DInt32 &v3dPos) const
 Gets a voxel at the position given by a 3D vector.
 
VoxelType getVoxelAt (int32_t uXPos, int32_t uYPos, int32_t uZPos) const
 Gets a voxel at the position given by x,y,z coordinates.
 
VoxelType getVoxelAt (const Vector3DInt32 &v3dPos) const
 Gets a voxel at the position given by a 3D vector.
 
VoxelType getVoxelWithWrapping (int32_t uXPos, int32_t uYPos, int32_t uZPos, WrapMode eWrapMode=WrapModes::Border, VoxelType tBorder=VoxelType()) const
 Gets a voxel at the position given by x,y,z coordinates.
 
VoxelType getVoxelWithWrapping (const Vector3DInt32 &v3dPos, WrapMode eWrapMode=WrapModes::Border, VoxelType tBorder=VoxelType()) const
 Gets a voxel at the position given by a 3D vector.
 
void setBorderValue (const VoxelType &tBorder)
 Sets the value used for voxels which are outside the volume.
 
bool setVoxelAt (int32_t uXPos, int32_t uYPos, int32_t uZPos, VoxelType tValue)
 Sets the voxel at the position given by x,y,z coordinates.
 
bool setVoxelAt (const Vector3DInt32 &v3dPos, VoxelType tValue)
 Sets the voxel at the position given by a 3D vector.
 
uint32_t calculateSizeInBytes (void)
 Calculates approximatly how many bytes of memory the volume is currently using.
 

Protected Member Functions

 RawVolume (const RawVolume &rhs)
 Copy constructor.
 
RawVolumeoperator= (const RawVolume &rhs)
 Assignment operator.
 
- Protected Member Functions inherited from PolyVox::BaseVolume< VoxelType >
 BaseVolume (const Region &regValid)
 Constructor for creating a fixed size volume.
 
 BaseVolume (const BaseVolume &rhs)
 Copy constructor.
 
 ~BaseVolume ()
 Destructor.
 
BaseVolumeoperator= (const BaseVolume &rhs)
 Assignment operator.
 

Additional Inherited Members

- Public Types inherited from PolyVox::BaseVolume< VoxelType >
typedef VoxelType VoxelType
 
- Protected Attributes inherited from PolyVox::BaseVolume< VoxelType >
Region m_regValidRegion
 
int32_t m_uLongestSideLength
 
int32_t m_uShortestSideLength
 
float m_fDiagonalLength
 
VoxelType m_tBorderValue
 

Detailed Description

template<typename VoxelType>
class PolyVox::RawVolume< VoxelType >

Definition at line 40 of file RawVolume.h.

Constructor & Destructor Documentation

template<typename VoxelType >
RawVolume< VoxelType >::RawVolume ( const Region regValid)

Constructor for creating a fixed size volume.

This constructor creates a volume with a fixed size which is specified as a parameter.

Parameters
regValidSpecifies the minimum and maximum valid voxel positions.

Definition at line 31 of file RawVolume.inl.

+ Here is the call graph for this function:

template<typename VoxelType >
RawVolume< VoxelType >::~RawVolume ( )

Destructor.

Destroys the volume.

Definition at line 57 of file RawVolume.inl.

template<typename VoxelType >
RawVolume< VoxelType >::RawVolume ( const RawVolume< VoxelType > &  rhs)
protected

Copy constructor.

This function should never be called.

Copying volumes by value would be expensive, and we want to prevent users from doing it by accident (such as when passing them as paramenters to functions). That said, there are times when you really do want to make a copy of a volume and in this case you should look at the Volumeresampler.

See Also
VolumeResampler

Definition at line 48 of file RawVolume.inl.

Member Function Documentation

template<typename VoxelType >
uint32_t RawVolume< VoxelType >::calculateSizeInBytes ( void  )

Calculates approximatly how many bytes of memory the volume is currently using.

Note: This function needs reviewing for accuracy...

Definition at line 275 of file RawVolume.inl.

template<typename VoxelType >
VoxelType RawVolume< VoxelType >::getVoxel ( int32_t  uXPos,
int32_t  uYPos,
int32_t  uZPos 
) const

Gets a voxel at the position given by x,y,z coordinates.

Parameters
uXPosThe x position of the voxel
uYPosThe y position of the voxel
uZPosThe z position of the voxel
Returns
The voxel value

Definition at line 83 of file RawVolume.inl.

template<typename VoxelType >
VoxelType RawVolume< VoxelType >::getVoxel ( const Vector3DInt32 v3dPos) const

Gets a voxel at the position given by a 3D vector.

Parameters
v3dPosThe 3D position of the voxel
Returns
The voxel value

Definition at line 105 of file RawVolume.inl.

+ Here is the call graph for this function:

template<typename VoxelType >
VoxelType RawVolume< VoxelType >::getVoxelAt ( int32_t  uXPos,
int32_t  uYPos,
int32_t  uZPos 
) const

Gets a voxel at the position given by x,y,z coordinates.

Parameters
uXPosThe x position of the voxel
uYPosThe y position of the voxel
uZPosThe z position of the voxel
Returns
The voxel value

Definition at line 117 of file RawVolume.inl.

Referenced by PolyVox::LowPassFilter< SrcVolumeType, DstVolumeType, AccumulationType >::executeSAT(), and PolyVox::RawVolume< VoxelType >::Sampler::getVoxel().

+ Here is the call graph for this function:

template<typename VoxelType >
VoxelType RawVolume< VoxelType >::getVoxelAt ( const Vector3DInt32 v3dPos) const

Gets a voxel at the position given by a 3D vector.

Parameters
v3dPosThe 3D position of the voxel
Returns
The voxel value

Definition at line 144 of file RawVolume.inl.

+ Here is the call graph for this function:

template<typename VoxelType >
VoxelType RawVolume< VoxelType >::getVoxelWithWrapping ( int32_t  uXPos,
int32_t  uYPos,
int32_t  uZPos,
WrapMode  eWrapMode = WrapModes::Border,
VoxelType  tBorder = VoxelType() 
) const

Gets a voxel at the position given by x,y,z coordinates.

Parameters
uXPosThe x position of the voxel
uYPosThe y position of the voxel
uZPosThe z position of the voxel
Returns
The voxel value

Definition at line 156 of file RawVolume.inl.

template<typename VoxelType >
VoxelType RawVolume< VoxelType >::getVoxelWithWrapping ( const Vector3DInt32 v3dPos,
WrapMode  eWrapMode = WrapModes::Border,
VoxelType  tBorder = VoxelType() 
) const

Gets a voxel at the position given by a 3D vector.

Parameters
v3dPosThe 3D position of the voxel
Returns
The voxel value

Definition at line 200 of file RawVolume.inl.

+ Here is the call graph for this function:

template<typename VoxelType >
RawVolume< VoxelType > & RawVolume< VoxelType >::operator= ( const RawVolume< VoxelType > &  rhs)
protected

Assignment operator.

This function should never be called.

Copying volumes by value would be expensive, and we want to prevent users from doing it by accident (such as when passing them as paramenters to functions). That said, there are times when you really do want to make a copy of a volume and in this case you should look at the Volumeresampler.

See Also
VolumeResampler

Definition at line 71 of file RawVolume.inl.

template<typename VoxelType >
bool RawVolume< VoxelType >::setVoxelAt ( int32_t  uXPos,
int32_t  uYPos,
int32_t  uZPos,
VoxelType  tValue 
)

Sets the voxel at the position given by x,y,z coordinates.

Parameters
uXPosthe x position of the voxel
uYPosthe y position of the voxel
uZPosthe z position of the voxel
tValuethe value to which the voxel will be set
Returns
whether the requested position is inside the volume

Definition at line 213 of file RawVolume.inl.

Referenced by PolyVox::LowPassFilter< SrcVolumeType, DstVolumeType, AccumulationType >::executeSAT().

+ Here is the call graph for this function:

template<typename VoxelType >
bool RawVolume< VoxelType >::setVoxelAt ( const Vector3DInt32 v3dPos,
VoxelType  tValue 
)

Sets the voxel at the position given by a 3D vector.

Parameters
v3dPosthe 3D position of the voxel
tValuethe value to which the voxel will be set
Returns
whether the requested position is inside the volume

Definition at line 244 of file RawVolume.inl.

+ Here is the call graph for this function:


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