PolyVox
0.2.1
Open source voxel management library
|
Represents a part of a Volume. More...
#include <Region.h>
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 Vector3DInt32 & | getLowerCorner (void) const |
const Vector3DInt32 & | getUpperCorner (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 |
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.
PolyVox::Region::Region | ( | ) |
Definition at line 37 of file Region.cpp.
PolyVox::Region::Region | ( | const Vector3DInt32 & | v3dLowerCorner, |
const Vector3DInt32 & | v3dUpperCorner | ||
) |
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().
bool PolyVox::Region::containsPoint | ( | const Vector3DInt32 & | pos, |
uint8_t | boundary = 0 |
||
) | const |
Definition at line 165 of file Region.cpp.
Referenced by PolyVox::RawVolume< VoxelType >::Sampler::moveNegativeX(), and PolyVox::RawVolume< VoxelType >::Sampler::movePositiveX().
bool PolyVox::Region::containsPointInX | ( | int32_t | pos, |
uint8_t | boundary = 0 |
||
) | const |
bool PolyVox::Region::containsPointInY | ( | int32_t | pos, |
uint8_t | boundary = 0 |
||
) | const |
bool PolyVox::Region::containsPointInZ | ( | int32_t | pos, |
uint8_t | boundary = 0 |
||
) | const |
void PolyVox::Region::cropTo | ( | const Region & | other | ) |
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().
int32_t PolyVox::Region::getDepthInVoxels | ( | void | ) | const |
Gets the depth of the region measured in voxels.
Definition at line 105 of file Region.cpp.
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.
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().
int32_t PolyVox::Region::getHeightInVoxels | ( | void | ) | const |
Gets the height of the region measured in voxels.
Definition at line 100 of file Region.cpp.
const Vector3DInt32 & PolyVox::Region::getLowerCorner | ( | void | ) | const |
Definition at line 85 of file Region.cpp.
Referenced by PolyVox::calculateAmbientOcclusion(), PolyVox::LargeVolume< VoxelType >::flush(), and PolyVox::LargeVolume< VoxelType >::prefetch().
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().
int32_t PolyVox::Region::getWidthInVoxels | ( | void | ) | const |
Gets the width of the region measured in voxels.
Definition at line 95 of file Region.cpp.
bool PolyVox::Region::operator!= | ( | const Region & | rhs | ) | const |
Inequality Operator.
Checks whether two Regions are not equal.
rhs | The Region to compare to. |
Definition at line 80 of file Region.cpp.
bool PolyVox::Region::operator== | ( | const Region & | rhs | ) | const |
Equality Operator.
Checks whether two Regions are equal.
rhs | The Region to compare to. |
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 | ) |
Definition at line 140 of file Region.cpp.
Referenced by PolyVox::MarchingCubesSurfaceExtractor< VolumeType, Controller >::MarchingCubesSurfaceExtractor().
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.
|
static |
Definition at line 56 of file Region.h.
Referenced by PolyVox::LargeVolume< VoxelType >::LargeVolume().