Classes | Public Member Functions

PolyVox::SimpleVolume< VoxelType > Class Template Reference

#include <SimpleVolume.h>

Inheritance diagram for PolyVox::SimpleVolume< VoxelType >:
Collaboration diagram for PolyVox::SimpleVolume< VoxelType >:

List of all members.

Classes

class  Block
class  Sampler

Public Member Functions

 SimpleVolume (const Region &regValid, uint16_t uBlockSideLength=32)
 Constructor for creating a fixed size volume.
 SimpleVolume (int32_t dont_use_this_constructor_1, int32_t dont_use_this_constructor_2, int32_t dont_use_this_constructor_3)
 Deprecated constructor - do not use.
 ~SimpleVolume ()
 Destructor.
VoxelType getBorderValue (void) const
 Gets the value used for voxels which are outside the volume.
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.
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.
void resize (const Region &regValidRegion, uint16_t uBlockSideLength)
 Deprecated - I don't think we should expose this function? Let us know if you disagree...

Detailed Description

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

Definition at line 44 of file SimpleVolume.h.


Constructor & Destructor Documentation

template<typename VoxelType >
PolyVox::SimpleVolume< VoxelType >::SimpleVolume ( const Region regValid,
uint16_t  uBlockSideLength = 32 
)

Constructor for creating a fixed size volume.

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

By default this constructor will not enable paging but you can override this if desired. If you do wish to enable paging then you are required to provide the call back function (see the other SimpleVolume constructor).

Parameters:
regValid Specifies the minimum and maximum valid voxel positions.
dataRequiredHandler The callback function which will be called when PolyVox tries to use data which is not currently in momory.
dataOverflowHandler The callback function which will be called when PolyVox has too much data and needs to remove some from memory.
bPagingEnabled Controls whether or not paging is enabled for this SimpleVolume.
uBlockSideLength The size of the blocks making up the volume. Small blocks will compress/decompress faster, but there will also be more of them meaning voxel access could be slower.

Definition at line 57 of file SimpleVolume.inl.

template<typename VoxelType >
PolyVox::SimpleVolume< VoxelType >::SimpleVolume ( int32_t  dont_use_this_constructor_1,
int32_t  dont_use_this_constructor_2,
int32_t  dont_use_this_constructor_3 
)

Deprecated constructor - do not use.

Deprecated - do not use this constructor.

Definition at line 31 of file SimpleVolume.inl.

template<typename VoxelType >
PolyVox::SimpleVolume< VoxelType >::~SimpleVolume (  ) 

Destructor.

Destroys the volume.

Definition at line 71 of file SimpleVolume.inl.


Member Function Documentation

template<typename VoxelType >
uint32_t PolyVox::SimpleVolume< VoxelType >::calculateSizeInBytes ( void   ) 

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

Note: This function needs reviewing for accuracy...

Reimplemented from PolyVox::BaseVolume< VoxelType >.

Definition at line 255 of file SimpleVolume.inl.

template<typename VoxelType >
VoxelType PolyVox::SimpleVolume< VoxelType >::getBorderValue ( void   )  const

Gets the value used for voxels which are outside the volume.

The border value is returned whenever an atempt is made to read a voxel which is outside the extents of the volume.

Returns:
The value used for voxels outside of the volume

Reimplemented from PolyVox::BaseVolume< VoxelType >.

Definition at line 83 of file SimpleVolume.inl.

Referenced by PolyVox::SimpleVolume< VoxelType >::getVoxelAt().

template<typename VoxelType >
VoxelType PolyVox::SimpleVolume< 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:
uXPos The x position of the voxel
uYPos The y position of the voxel
uZPos The z position of the voxel
Returns:
The voxel value

Reimplemented from PolyVox::BaseVolume< VoxelType >.

Definition at line 95 of file SimpleVolume.inl.

Referenced by PolyVox::SimpleVolume< VoxelType >::getVoxelAt().

Here is the call graph for this function:

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

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

Parameters:
v3dPos The 3D position of the voxel
Returns:
The voxel value

Reimplemented from PolyVox::BaseVolume< VoxelType >.

Definition at line 122 of file SimpleVolume.inl.

Here is the call graph for this function:

template<typename VoxelType >
void PolyVox::SimpleVolume< VoxelType >::resize ( const Region regValidRegion,
uint16_t  uBlockSideLength 
)

Deprecated - I don't think we should expose this function? Let us know if you disagree...

This function should probably be made internal...

Definition at line 181 of file SimpleVolume.inl.

Here is the call graph for this function:

template<typename VoxelType >
void PolyVox::SimpleVolume< VoxelType >::setBorderValue ( const VoxelType &  tBorder  ) 

Sets the value used for voxels which are outside the volume.

Parameters:
tBorder The value to use for voxels outside the volume.

Reimplemented from PolyVox::BaseVolume< VoxelType >.

Definition at line 131 of file SimpleVolume.inl.

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

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

Parameters:
v3dPos the 3D position of the voxel
tValue the value to which the voxel will be set
Returns:
whether the requested position is inside the volume

Reimplemented from PolyVox::BaseVolume< VoxelType >.

Definition at line 172 of file SimpleVolume.inl.

Here is the call graph for this function:

template<typename VoxelType >
bool PolyVox::SimpleVolume< 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:
uXPos the x position of the voxel
uYPos the y position of the voxel
uZPos the z position of the voxel
tValue the value to which the voxel will be set
Returns:
whether the requested position is inside the volume

Reimplemented from PolyVox::BaseVolume< VoxelType >.

Definition at line 146 of file SimpleVolume.inl.

Referenced by PolyVox::SimpleVolume< VoxelType >::setVoxelAt().

Here is the call graph for this function:


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