PolyVox
0.3.0-dev
Open source voxel management library
|
#include <BaseVolume.h>
Classes | |
class | Sampler |
Public Types | |
typedef _VoxelType | VoxelType |
Public Member Functions | |
VoxelType | getBorderValue (void) const |
Gets the value used for voxels which are outside the volume. | |
const Region & | getEnclosingRegion (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 | |
BaseVolume (const Region ®Valid) | |
Constructor for creating a fixed size volume. | |
BaseVolume (const BaseVolume &rhs) | |
Copy constructor. | |
~BaseVolume () | |
Destructor. | |
BaseVolume & | operator= (const BaseVolume &rhs) |
Assignment operator. | |
Protected Attributes | |
Region | m_regValidRegion |
int32_t | m_uLongestSideLength |
int32_t | m_uShortestSideLength |
float | m_fDiagonalLength |
VoxelType | m_tBorderValue |
Definition at line 51 of file BaseVolume.h.
typedef _VoxelType PolyVox::BaseVolume< _VoxelType >::VoxelType |
Definition at line 54 of file BaseVolume.h.
|
protected |
Constructor for creating a fixed size volume.
This is protected because you should never create a BaseVolume directly, you should instead use one of the derived classes.
Definition at line 32 of file BaseVolume.inl.
|
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.
Definition at line 46 of file BaseVolume.inl.
|
protected |
uint32_t PolyVox::BaseVolume< 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 267 of file BaseVolume.inl.
VoxelType PolyVox::BaseVolume< VoxelType >::getBorderValue | ( | void | ) | const |
Gets the value used for voxels which are outside the volume.
The border value is returned whenever an attempt is made to read a voxel which is outside the extents of the volume.
Definition at line 78 of file BaseVolume.inl.
int32_t PolyVox::BaseVolume< VoxelType >::getDepth | ( | void | ) | const |
Gets the depth of the volume in voxels.
Definition at line 117 of file BaseVolume.inl.
float PolyVox::BaseVolume< VoxelType >::getDiagonalLength | ( | void | ) | const |
Gets the length of the diagonal in voxels.
Definition at line 151 of file BaseVolume.inl.
const Region & PolyVox::BaseVolume< VoxelType >::getEnclosingRegion | ( | void | ) | const |
Gets a Region representing the extents of the Volume.
Definition at line 87 of file BaseVolume.inl.
Referenced by PolyVox::BaseVolume< _VoxelType >::Sampler< DerivedVolumeType >::moveNegativeX(), PolyVox::BaseVolume< _VoxelType >::Sampler< DerivedVolumeType >::moveNegativeY(), PolyVox::BaseVolume< _VoxelType >::Sampler< DerivedVolumeType >::moveNegativeZ(), PolyVox::BaseVolume< _VoxelType >::Sampler< DerivedVolumeType >::movePositiveX(), PolyVox::BaseVolume< _VoxelType >::Sampler< DerivedVolumeType >::movePositiveY(), and PolyVox::BaseVolume< _VoxelType >::Sampler< DerivedVolumeType >::movePositiveZ().
int32_t PolyVox::BaseVolume< VoxelType >::getHeight | ( | void | ) | const |
Gets the height of the volume in voxels.
Definition at line 107 of file BaseVolume.inl.
int32_t PolyVox::BaseVolume< VoxelType >::getLongestSideLength | ( | void | ) | const |
Gets the length of the longest side in voxels.
Definition at line 139 of file BaseVolume.inl.
int32_t PolyVox::BaseVolume< VoxelType >::getShortestSideLength | ( | void | ) | const |
Gets the length of the shortest side in voxels.
Definition at line 128 of file BaseVolume.inl.
VoxelType PolyVox::BaseVolume< VoxelType >::getVoxel | ( | int32_t | uXPos, |
int32_t | uYPos, | ||
int32_t | uZPos | ||
) | const |
Gets a voxel at the position given by x,y,z
coordinates.
uXPos | The x position of the voxel |
uYPos | The y position of the voxel |
uZPos | The z position of the voxel |
Definition at line 163 of file BaseVolume.inl.
VoxelType PolyVox::BaseVolume< VoxelType >::getVoxel | ( | const Vector3DInt32 & | v3dPos | ) | const |
Gets a voxel at the position given by a 3D vector.
v3dPos | The 3D position of the voxel |
Definition at line 174 of file BaseVolume.inl.
VoxelType PolyVox::BaseVolume< VoxelType >::getVoxelAt | ( | int32_t | uXPos, |
int32_t | uYPos, | ||
int32_t | uZPos | ||
) | const |
Gets a voxel at the position given by x,y,z
coordinates.
uXPos | The x position of the voxel |
uYPos | The y position of the voxel |
uZPos | The z position of the voxel |
Definition at line 187 of file BaseVolume.inl.
Referenced by PolyVox::BaseVolume< _VoxelType >::Sampler< DerivedVolumeType >::peekVoxel0px0py0pz(), PolyVox::BaseVolume< _VoxelType >::Sampler< DerivedVolumeType >::peekVoxel0px0py1nz(), PolyVox::BaseVolume< _VoxelType >::Sampler< DerivedVolumeType >::peekVoxel0px0py1pz(), PolyVox::BaseVolume< _VoxelType >::Sampler< DerivedVolumeType >::peekVoxel0px1ny0pz(), PolyVox::BaseVolume< _VoxelType >::Sampler< DerivedVolumeType >::peekVoxel0px1ny1nz(), PolyVox::BaseVolume< _VoxelType >::Sampler< DerivedVolumeType >::peekVoxel0px1ny1pz(), PolyVox::BaseVolume< _VoxelType >::Sampler< DerivedVolumeType >::peekVoxel0px1py0pz(), PolyVox::BaseVolume< _VoxelType >::Sampler< DerivedVolumeType >::peekVoxel0px1py1nz(), PolyVox::BaseVolume< _VoxelType >::Sampler< DerivedVolumeType >::peekVoxel0px1py1pz(), PolyVox::BaseVolume< _VoxelType >::Sampler< DerivedVolumeType >::peekVoxel1nx0py0pz(), PolyVox::BaseVolume< _VoxelType >::Sampler< DerivedVolumeType >::peekVoxel1nx0py1nz(), PolyVox::BaseVolume< _VoxelType >::Sampler< DerivedVolumeType >::peekVoxel1nx0py1pz(), PolyVox::BaseVolume< _VoxelType >::Sampler< DerivedVolumeType >::peekVoxel1nx1ny0pz(), PolyVox::BaseVolume< _VoxelType >::Sampler< DerivedVolumeType >::peekVoxel1nx1ny1nz(), PolyVox::BaseVolume< _VoxelType >::Sampler< DerivedVolumeType >::peekVoxel1nx1ny1pz(), PolyVox::BaseVolume< _VoxelType >::Sampler< DerivedVolumeType >::peekVoxel1nx1py0pz(), PolyVox::BaseVolume< _VoxelType >::Sampler< DerivedVolumeType >::peekVoxel1nx1py1nz(), PolyVox::BaseVolume< _VoxelType >::Sampler< DerivedVolumeType >::peekVoxel1nx1py1pz(), PolyVox::BaseVolume< _VoxelType >::Sampler< DerivedVolumeType >::peekVoxel1px0py0pz(), PolyVox::BaseVolume< _VoxelType >::Sampler< DerivedVolumeType >::peekVoxel1px0py1nz(), PolyVox::BaseVolume< _VoxelType >::Sampler< DerivedVolumeType >::peekVoxel1px0py1pz(), PolyVox::BaseVolume< _VoxelType >::Sampler< DerivedVolumeType >::peekVoxel1px1ny0pz(), PolyVox::BaseVolume< _VoxelType >::Sampler< DerivedVolumeType >::peekVoxel1px1ny1nz(), PolyVox::BaseVolume< _VoxelType >::Sampler< DerivedVolumeType >::peekVoxel1px1ny1pz(), PolyVox::BaseVolume< _VoxelType >::Sampler< DerivedVolumeType >::peekVoxel1px1py0pz(), PolyVox::BaseVolume< _VoxelType >::Sampler< DerivedVolumeType >::peekVoxel1px1py1nz(), and PolyVox::BaseVolume< _VoxelType >::Sampler< DerivedVolumeType >::peekVoxel1px1py1pz().
VoxelType PolyVox::BaseVolume< VoxelType >::getVoxelAt | ( | const Vector3DInt32 & | v3dPos | ) | const |
Gets a voxel at the position given by a 3D vector.
v3dPos | The 3D position of the voxel |
Definition at line 198 of file BaseVolume.inl.
VoxelType PolyVox::BaseVolume< 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.
uXPos | The x position of the voxel |
uYPos | The y position of the voxel |
uZPos | The z position of the voxel |
Definition at line 211 of file BaseVolume.inl.
VoxelType PolyVox::BaseVolume< VoxelType >::getVoxelWithWrapping | ( | const Vector3DInt32 & | v3dPos, |
WrapMode | eWrapMode = WrapModes::Border , |
||
VoxelType | tBorder = VoxelType() |
||
) | const |
Gets a voxel at the position given by a 3D vector.
v3dPos | The 3D position of the voxel |
Definition at line 222 of file BaseVolume.inl.
int32_t PolyVox::BaseVolume< VoxelType >::getWidth | ( | void | ) | const |
Gets the width of the volume in voxels.
Definition at line 97 of file BaseVolume.inl.
|
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.
Definition at line 67 of file BaseVolume.inl.
void PolyVox::BaseVolume< VoxelType >::setBorderValue | ( | const VoxelType & | tBorder | ) |
Sets the value used for voxels which are outside the volume.
tBorder | The value to use for voxels outside the volume. |
Definition at line 232 of file BaseVolume.inl.
bool PolyVox::BaseVolume< 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.
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 |
Definition at line 245 of file BaseVolume.inl.
Referenced by PolyVox::BaseVolume< _VoxelType >::Sampler< DerivedVolumeType >::setVoxel().
bool PolyVox::BaseVolume< VoxelType >::setVoxelAt | ( | const Vector3DInt32 & | v3dPos, |
VoxelType | tValue | ||
) |
Sets the voxel at the position given by a 3D vector.
v3dPos | the 3D position of the voxel |
tValue | the value to which the voxel will be set |
Definition at line 257 of file BaseVolume.inl.
|
protected |
Definition at line 192 of file BaseVolume.h.
|
protected |
Definition at line 187 of file BaseVolume.h.
|
protected |
Definition at line 195 of file BaseVolume.h.
|
protected |
Definition at line 190 of file BaseVolume.h.
|
protected |
Definition at line 191 of file BaseVolume.h.