PolyVox  0.2.1
Open source voxel management library
Public Member Functions | Static Public Attributes
PolyVox::Region Class Reference

Represents a part of a Volume. More...

#include <Region.h>

+ Collaboration diagram for PolyVox::Region:

List of all members.

Public Member Functions

 Region ()
 Region (const Vector3DInt32 &v3dLowerCorner, const Vector3DInt32 &v3dUpperCorner)
 Region (int32_t iLowerX, int32_t iLowerY, int32_t iLowerZ, int32_t iUpperX, int32_t iUpperY, int32_t iUpperZ)
bool operator== (const Region &rhs) const
 Equality Operator.
bool operator!= (const Region &rhs) const
 Inequality Operator.
const Vector3DInt32getLowerCorner (void) const
const Vector3DInt32getUpperCorner (void) const
int32_t getWidthInVoxels (void) const
 Gets the width of the region measured in voxels.
int32_t getHeightInVoxels (void) const
 Gets the height of the region measured in voxels.
int32_t getDepthInVoxels (void) const
 Gets the depth of the region measured in voxels.
Vector3DInt32 getDimensionsInVoxels (void) const
 Gets the dimensions of the region measured in voxels.
int32_t getWidthInCells (void) const
 Gets the width of the region measured in cells.
int32_t getHeightInCells (void) const
 Gets the height of the region measured in cells.
int32_t getDepthInCells (void) const
 Gets the depth of the region measured in cells.
Vector3DInt32 getDimensionsInCells (void) const
 Gets the dimensions of the region measured in cells.
void setLowerCorner (const Vector3DInt32 &v3dLowerCorner)
void setUpperCorner (const Vector3DInt32 &v3dUpperCorner)
bool containsPoint (const Vector3DFloat &pos, float boundary=0.0f) const
bool containsPoint (const Vector3DInt32 &pos, uint8_t boundary=0) const
bool containsPointInX (float pos, float boundary=0.0f) const
bool containsPointInX (int32_t pos, uint8_t boundary=0) const
bool containsPointInY (float pos, float boundary=0.0f) const
bool containsPointInY (int32_t pos, uint8_t boundary=0) const
bool containsPointInZ (float pos, float boundary=0.0f) const
bool containsPointInZ (int32_t pos, uint8_t boundary=0) const
void cropTo (const Region &other)
 __attribute__ ((deprecated)) int32_t depth(void) const
 Deprecated and misleading.
 __attribute__ ((deprecated)) int32_t height(void) const
 Deprecated and misleading.
void shift (const Vector3DInt32 &amount)
void shiftLowerCorner (const Vector3DInt32 &amount)
void shiftUpperCorner (const Vector3DInt32 &amount)
 __attribute__ ((deprecated)) Vector3DInt32 dimensions(void)
 Deprecated and misleading.
 __attribute__ ((deprecated)) int32_t width(void) const
 Deprecated and misleading.

Static Public Attributes

static const Region MaxRegion

Detailed Description

Represents a part of a Volume.

Many operations in PolyVox are constrained to only part of a volume. For example, when running the surface extractors it is unlikely that you will want to run it on the whole volume at once, as this will give a very large mesh which may be too much to render. Instead you will probably want to run a surface extractor a number of times on different parts of the volume, there by giving a number of meshes which can be culled and rendered seperately.

The Region class is used to define these parts (regions) of the volume. Essentially it consists of an upper and lower bound which specify the range of voxels positions considered to be part of the region. Note that these bounds are inclusive. The class also provides functions for modifying the regions in a variety of ways.

The dimensions of a region can be measured either in voxels or in cells. See the manual for more information about these definitions.

Definition at line 51 of file Region.h.


Constructor & Destructor Documentation

PolyVox::Region::Region ( )

Definition at line 37 of file Region.cpp.

PolyVox::Region::Region ( const Vector3DInt32 v3dLowerCorner,
const Vector3DInt32 v3dUpperCorner 
)

Definition at line 43 of file Region.cpp.

+ Here is the call graph for this function:

PolyVox::Region::Region ( int32_t  iLowerX,
int32_t  iLowerY,
int32_t  iLowerZ,
int32_t  iUpperX,
int32_t  iUpperY,
int32_t  iUpperZ 
)

Definition at line 53 of file Region.cpp.

+ Here is the call graph for this function:


Member Function Documentation

PolyVox::Region::__attribute__ ( (deprecated)  ) const

Deprecated and misleading.

PolyVox::Region::__attribute__ ( (deprecated)  ) const

Deprecated and misleading.

PolyVox::Region::__attribute__ ( (deprecated)  )

Deprecated and misleading.

PolyVox::Region::__attribute__ ( (deprecated)  ) const

Deprecated and misleading.

bool PolyVox::Region::containsPoint ( const Vector3DFloat pos,
float  boundary = 0.0f 
) const

Definition at line 145 of file Region.cpp.

Referenced by PolyVox::ConstVolumeProxy< VoxelType >::getVoxelAt(), and PolyVox::ConstVolumeProxy< VoxelType >::setVoxelAt().

+ Here is the call graph for this function:

bool PolyVox::Region::containsPoint ( const Vector3DInt32 pos,
uint8_t  boundary = 0 
) const

Definition at line 155 of file Region.cpp.

+ Here is the call graph for this function:

bool PolyVox::Region::containsPointInX ( float  pos,
float  boundary = 0.0f 
) const

Definition at line 165 of file Region.cpp.

Referenced by PolyVox::RawVolume< VoxelType >::Sampler::moveNegativeX(), and PolyVox::RawVolume< VoxelType >::Sampler::movePositiveX().

+ Here is the call graph for this function:

bool PolyVox::Region::containsPointInX ( int32_t  pos,
uint8_t  boundary = 0 
) const

Definition at line 171 of file Region.cpp.

+ Here is the call graph for this function:

bool PolyVox::Region::containsPointInY ( float  pos,
float  boundary = 0.0f 
) const

Definition at line 177 of file Region.cpp.

+ Here is the call graph for this function:

bool PolyVox::Region::containsPointInY ( int32_t  pos,
uint8_t  boundary = 0 
) const

Definition at line 183 of file Region.cpp.

+ Here is the call graph for this function:

bool PolyVox::Region::containsPointInZ ( float  pos,
float  boundary = 0.0f 
) const

Definition at line 189 of file Region.cpp.

+ Here is the call graph for this function:

bool PolyVox::Region::containsPointInZ ( int32_t  pos,
uint8_t  boundary = 0 
) const

Definition at line 195 of file Region.cpp.

+ Here is the call graph for this function:

void PolyVox::Region::cropTo ( const Region other)

Definition at line 201 of file Region.cpp.

+ Here is the call graph for this function:

int32_t PolyVox::Region::getDepthInCells ( void  ) const

Gets the depth of the region measured in cells.

Definition at line 130 of file Region.cpp.

Referenced by getDepthInVoxels().

+ Here is the call graph for this function:

int32_t PolyVox::Region::getDepthInVoxels ( void  ) const

Gets the depth of the region measured in voxels.

Definition at line 105 of file Region.cpp.

+ Here is the call graph for this function:

Vector3DInt32 PolyVox::Region::getDimensionsInCells ( void  ) const

Gets the dimensions of the region measured in cells.

Definition at line 125 of file Region.cpp.

Referenced by getDimensionsInVoxels().

Vector3DInt32 PolyVox::Region::getDimensionsInVoxels ( void  ) const

Gets the dimensions of the region measured in voxels.

Definition at line 110 of file Region.cpp.

+ Here is the call graph for this function:

int32_t PolyVox::Region::getHeightInCells ( void  ) const

Gets the height of the region measured in cells.

Definition at line 120 of file Region.cpp.

Referenced by getHeightInVoxels().

+ Here is the call graph for this function:

int32_t PolyVox::Region::getHeightInVoxels ( void  ) const

Gets the height of the region measured in voxels.

Definition at line 100 of file Region.cpp.

+ Here is the call graph for this function:

const Vector3DInt32 & PolyVox::Region::getLowerCorner ( void  ) const
const Vector3DInt32 & PolyVox::Region::getUpperCorner ( void  ) const
int32_t PolyVox::Region::getWidthInCells ( void  ) const

Gets the width of the region measured in cells.

Definition at line 115 of file Region.cpp.

Referenced by getWidthInVoxels().

+ Here is the call graph for this function:

int32_t PolyVox::Region::getWidthInVoxels ( void  ) const

Gets the width of the region measured in voxels.

Definition at line 95 of file Region.cpp.

+ Here is the call graph for this function:

bool PolyVox::Region::operator!= ( const Region rhs) const

Inequality Operator.

Checks whether two Regions are not equal.

Parameters:
rhsThe Region to compare to.
Returns:
true if the Regions do not match.
See also:
operator==

Definition at line 80 of file Region.cpp.

bool PolyVox::Region::operator== ( const Region rhs) const

Equality Operator.

Checks whether two Regions are equal.

Parameters:
rhsThe Region to compare to.
Returns:
true if the Regions match.
See also:
operator!=

Definition at line 69 of file Region.cpp.

void PolyVox::Region::setLowerCorner ( const Vector3DInt32 v3dLowerCorner)

Definition at line 135 of file Region.cpp.

void PolyVox::Region::setUpperCorner ( const Vector3DInt32 v3dUpperCorner)
void PolyVox::Region::shift ( const Vector3DInt32 amount)

Definition at line 227 of file Region.cpp.

void PolyVox::Region::shiftLowerCorner ( const Vector3DInt32 amount)

Definition at line 233 of file Region.cpp.

void PolyVox::Region::shiftUpperCorner ( const Vector3DInt32 amount)

Definition at line 238 of file Region.cpp.


Member Data Documentation

const Region PolyVox::Region::MaxRegion
static

Definition at line 56 of file Region.h.

Referenced by PolyVox::LargeVolume< VoxelType >::LargeVolume().


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