Added new functions for findings the dimensions of regions. These replace the deprecated versions.

This commit is contained in:
unknown
2012-11-09 15:12:02 +01:00
parent 17054c6747
commit af0643ce80
2 changed files with 78 additions and 5 deletions

View File

@ -90,7 +90,47 @@ namespace PolyVox
const Vector3DInt32& Region::getUpperCorner(void) const
{
return m_v3dUpperCorner;
}
}
int32_t Region::getWidthInVoxels(void) const
{
return getWidthInCells() + 1;
}
int32_t Region::getHeightInVoxels(void) const
{
return getHeightInCells() + 1;
}
int32_t Region::getDepthInVoxels(void) const
{
return getDepthInCells() + 1;
}
Vector3DInt32 Region::getDimensionsInVoxels(void) const
{
return getDimensionsInCells() + Vector3DInt32(1, 1, 1);
}
int32_t Region::getWidthInCells(void) const
{
return m_v3dUpperCorner.getX() - m_v3dLowerCorner.getX();
}
int32_t Region::getHeightInCells(void) const
{
return m_v3dUpperCorner.getY() - m_v3dLowerCorner.getY();
}
Vector3DInt32 Region::getDimensionsInCells(void) const
{
return m_v3dUpperCorner - m_v3dLowerCorner;
}
int32_t Region::getDepthInCells(void) const
{
return m_v3dUpperCorner.getZ() - m_v3dLowerCorner.getZ();
}
void Region::setLowerCorner(const Vector3DInt32& v3dLowerCorner)
{
@ -168,7 +208,7 @@ namespace PolyVox
m_v3dUpperCorner.setZ((std::min)(m_v3dUpperCorner.getZ(), other.m_v3dUpperCorner.getZ()));
}
/// \deprecated Use getLowerCorner and getUpperCorner instead
/// \deprecated Use getDepthInVoxels() or getDepthInCells() instead
int32_t Region::depth(void) const
{
//This function is deprecated and wrong.
@ -176,7 +216,7 @@ namespace PolyVox
return m_v3dUpperCorner.getZ() - m_v3dLowerCorner.getZ();
}
/// \deprecated Use getLowerCorner and getUpperCorner instead
/// \deprecated Use getHeightInVoxels() or getHeightInCells() instead
int32_t Region::height(void) const
{
//This function is deprecated and wrong.
@ -200,7 +240,7 @@ namespace PolyVox
m_v3dUpperCorner += amount;
}
/// \deprecated Use getLowerCorner and getUpperCorner instead
/// \deprecated Use getDimensionsInVoxels() or getDimensionsInCells() instead
Vector3DInt32 Region::dimensions(void)
{
//This function is deprecated and wrong.
@ -208,7 +248,7 @@ namespace PolyVox
return m_v3dUpperCorner - m_v3dLowerCorner;
}
/// \deprecated Use getLowerCorner and getUpperCorner instead
/// \deprecated Use getWidthInVoxels() or getWidthInCells() instead
int32_t Region::width(void) const
{
//This function is deprecated and wrong.