Reordered some functions.
This commit is contained in:
parent
6d7246f907
commit
02b6421ab8
@ -93,8 +93,6 @@ namespace PolyVox
|
|||||||
/// Gets the dimensions of the region measured in cells
|
/// Gets the dimensions of the region measured in cells
|
||||||
Vector3DInt32 getDimensionsInCells(void) const;
|
Vector3DInt32 getDimensionsInCells(void) const;
|
||||||
|
|
||||||
bool isValid(void);
|
|
||||||
|
|
||||||
void setLowerX(int32_t iX);
|
void setLowerX(int32_t iX);
|
||||||
void setLowerY(int32_t iY);
|
void setLowerY(int32_t iY);
|
||||||
void setLowerZ(int32_t iZ);
|
void setLowerZ(int32_t iZ);
|
||||||
@ -107,28 +105,28 @@ namespace PolyVox
|
|||||||
|
|
||||||
bool containsPoint(const Vector3DFloat& pos, float boundary = 0.0f) const;
|
bool containsPoint(const Vector3DFloat& pos, float boundary = 0.0f) const;
|
||||||
bool containsPoint(const Vector3DInt32& pos, uint8_t boundary = 0) const;
|
bool containsPoint(const Vector3DInt32& pos, uint8_t boundary = 0) const;
|
||||||
//FIXME - Don't like these. Make containsPoint take flags indicating which axes to check?
|
|
||||||
bool containsPointInX(float pos, float boundary = 0.0f) const;
|
bool containsPointInX(float pos, float boundary = 0.0f) const;
|
||||||
bool containsPointInX(int32_t pos, uint8_t boundary = 0) const;
|
bool containsPointInX(int32_t pos, uint8_t boundary = 0) const;
|
||||||
bool containsPointInY(float pos, float boundary = 0.0f) const;
|
bool containsPointInY(float pos, float boundary = 0.0f) const;
|
||||||
bool containsPointInY(int32_t pos, uint8_t boundary = 0) const;
|
bool containsPointInY(int32_t pos, uint8_t boundary = 0) const;
|
||||||
bool containsPointInZ(float pos, float boundary = 0.0f) const;
|
bool containsPointInZ(float pos, float boundary = 0.0f) const;
|
||||||
bool containsPointInZ(int32_t pos, uint8_t boundary = 0) const;
|
bool containsPointInZ(int32_t pos, uint8_t boundary = 0) const;
|
||||||
|
|
||||||
void cropTo(const Region& other);
|
void cropTo(const Region& other);
|
||||||
|
|
||||||
void shift(const Vector3DInt32& amount);
|
|
||||||
void shiftLowerCorner(const Vector3DInt32& amount);
|
|
||||||
void shiftUpperCorner(const Vector3DInt32& amount);
|
|
||||||
|
|
||||||
void dilate(int32_t iAmount);
|
void dilate(int32_t iAmount);
|
||||||
void dilate(int32_t iAmountX, int32_t iAmountY, int32_t iAmountZ);
|
void dilate(int32_t iAmountX, int32_t iAmountY, int32_t iAmountZ);
|
||||||
void dilate(const Vector3DInt32& v3dAmount);
|
void dilate(const Vector3DInt32& v3dAmount);
|
||||||
|
|
||||||
|
|
||||||
void erode(int32_t iAmount);
|
void erode(int32_t iAmount);
|
||||||
void erode(int32_t iAmountX, int32_t iAmountY, int32_t iAmountZ);
|
void erode(int32_t iAmountX, int32_t iAmountY, int32_t iAmountZ);
|
||||||
void erode(const Vector3DInt32& v3dAmount);
|
void erode(const Vector3DInt32& v3dAmount);
|
||||||
|
|
||||||
|
bool isValid(void);
|
||||||
|
|
||||||
|
void shift(const Vector3DInt32& amount);
|
||||||
|
void shiftLowerCorner(const Vector3DInt32& amount);
|
||||||
|
void shiftUpperCorner(const Vector3DInt32& amount);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int32_t m_iLowerX;
|
int32_t m_iLowerX;
|
||||||
|
@ -172,11 +172,6 @@ namespace PolyVox
|
|||||||
return m_iUpperZ - m_iLowerZ;
|
return m_iUpperZ - m_iLowerZ;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Region::isValid(void)
|
|
||||||
{
|
|
||||||
return (m_iUpperX >= m_iLowerX) && (m_iUpperY >= m_iLowerY) && (m_iUpperZ >= m_iLowerZ);
|
|
||||||
}
|
|
||||||
|
|
||||||
void Region::setLowerX(int32_t iX)
|
void Region::setLowerX(int32_t iX)
|
||||||
{
|
{
|
||||||
m_iLowerX = iX;
|
m_iLowerX = iX;
|
||||||
@ -287,26 +282,6 @@ namespace PolyVox
|
|||||||
m_iUpperZ = ((std::min)(m_iUpperZ, other.m_iUpperZ));
|
m_iUpperZ = ((std::min)(m_iUpperZ, other.m_iUpperZ));
|
||||||
}
|
}
|
||||||
|
|
||||||
void Region::shift(const Vector3DInt32& amount)
|
|
||||||
{
|
|
||||||
shiftLowerCorner(amount);
|
|
||||||
shiftUpperCorner(amount);
|
|
||||||
}
|
|
||||||
|
|
||||||
void Region::shiftLowerCorner(const Vector3DInt32& amount)
|
|
||||||
{
|
|
||||||
m_iLowerX += amount.getX();
|
|
||||||
m_iLowerY += amount.getY();
|
|
||||||
m_iLowerZ += amount.getZ();
|
|
||||||
}
|
|
||||||
|
|
||||||
void Region::shiftUpperCorner(const Vector3DInt32& amount)
|
|
||||||
{
|
|
||||||
m_iUpperX += amount.getX();
|
|
||||||
m_iUpperY += amount.getY();
|
|
||||||
m_iUpperZ += amount.getZ();
|
|
||||||
}
|
|
||||||
|
|
||||||
void Region::dilate(int32_t iAmount)
|
void Region::dilate(int32_t iAmount)
|
||||||
{
|
{
|
||||||
m_iLowerX -= iAmount;
|
m_iLowerX -= iAmount;
|
||||||
@ -360,4 +335,29 @@ namespace PolyVox
|
|||||||
{
|
{
|
||||||
erode(v3dAmount.getX(), v3dAmount.getY(), v3dAmount.getZ());
|
erode(v3dAmount.getX(), v3dAmount.getY(), v3dAmount.getZ());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool Region::isValid(void)
|
||||||
|
{
|
||||||
|
return (m_iUpperX >= m_iLowerX) && (m_iUpperY >= m_iLowerY) && (m_iUpperZ >= m_iLowerZ);
|
||||||
|
}
|
||||||
|
|
||||||
|
void Region::shift(const Vector3DInt32& amount)
|
||||||
|
{
|
||||||
|
shiftLowerCorner(amount);
|
||||||
|
shiftUpperCorner(amount);
|
||||||
|
}
|
||||||
|
|
||||||
|
void Region::shiftLowerCorner(const Vector3DInt32& amount)
|
||||||
|
{
|
||||||
|
m_iLowerX += amount.getX();
|
||||||
|
m_iLowerY += amount.getY();
|
||||||
|
m_iLowerZ += amount.getZ();
|
||||||
|
}
|
||||||
|
|
||||||
|
void Region::shiftUpperCorner(const Vector3DInt32& amount)
|
||||||
|
{
|
||||||
|
m_iUpperX += amount.getX();
|
||||||
|
m_iUpperY += amount.getY();
|
||||||
|
m_iUpperZ += amount.getZ();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user