SourceForge.net Logo

camvox::VoxCoord Class Reference

#include <VoxCoord.h>

List of all members.


Detailed Description

VoxCoord is an object that describes the position in oct-tree voxel space.

The root voxel that encapsulated the full voxel space, has coord (0, 0, 0, depth=0). The coord describes the near/left/bottom corner. The far/right/top corner has coord (0x8000, 0x8000, 0x8000, depth=0). There are no voxels outside of these bounds, because it leads to an integer overflow when calculating the outer bound.

There are 8 voxels inside the root voxel, they have the following coords:

This can continue until depth = 30, i.e. the 31th level. At his level each voxel has only the size of 1.


Public Member Functions

 VoxCoord (void)
 Construct a new coord identifying the root voxel in the oct-tree.
 VoxCoord (const VoxCoord &a)
 Copy constructor.
VoxCoordoperator= (const VoxCoord &a)
 Copy operator.
VoxCoord nextNeighbour (int x, int y, int z) const
 Get the coord of a neighbour voxel at the same oct-tree depth.
VoxCoord childCoord (int child_index) const
 Get the coord of a child voxel at the next depth of the oct-tree.
IntervalVector boundingBox (double scale) const
 Get the axis aligned bounding box describing this voxel in cartesion coords.
double size (double scale) const
 The size of this voxel.

Public Attributes

uint32_t v [3]
 3D coordinate of the left,near,bottom corner of a voxel box.
int depth
 Depth within the oct-tree.

Constructor & Destructor Documentation

camvox::VoxCoord::VoxCoord ( void   )  [inline]

Construct a new coord identifying the root voxel in the oct-tree.

camvox::VoxCoord::VoxCoord ( const VoxCoord a  )  [inline]

Copy constructor.


Member Function Documentation

VoxCoord& camvox::VoxCoord::operator= ( const VoxCoord a  )  [inline]

Copy operator.

VoxCoord camvox::VoxCoord::nextNeighbour ( int  x,
int  y,
int  z 
) const [inline]

Get the coord of a neighbour voxel at the same oct-tree depth.

To get the other corner of this voxel, one would specify (1, 1, 1) on this method.

Parameters:
x number of voxels away on the x-axis.
y number of voxels away on the y-axis.
z number of voxels away on the z-axis.
Returns:
The new voxel coord pointing to a neighbour voxel.

VoxCoord camvox::VoxCoord::childCoord ( int  child_index  )  const [inline]

Get the coord of a child voxel at the next depth of the oct-tree.

Parameters:
child_index An index pointing to one of the eight childs of an oct-tree node.
Returns:
The new voxel coord pointing to a child voxel.

IntervalVector camvox::VoxCoord::boundingBox ( double  scale  )  const [inline]

Get the axis aligned bounding box describing this voxel in cartesion coords.

Parameters:
scale The size of the smalles voxel.
Returns:
An IntervalVector describing the axis aligned bounding box.

double camvox::VoxCoord::size ( double  scale  )  const [inline]

The size of this voxel.

Returns:
the size of this voxel in the scale of the oct tree.


Member Data Documentation

uint32_t camvox::VoxCoord::v[3]

3D coordinate of the left,near,bottom corner of a voxel box.

Depth within the oct-tree.


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