Renamed x(), y(), and z() to getX(), getY(), and getZ()

This commit is contained in:
David Williams
2008-05-26 19:49:21 +00:00
parent 2745d52dc5
commit d0ffdee870
9 changed files with 92 additions and 92 deletions

View File

@ -160,11 +160,11 @@ namespace PolyVox
template <typename VoxelType>
VoxelType BlockVolume<VoxelType>::getVoxelAt(const Vector3DUint16& v3dPos) const
{
assert(v3dPos.x() < m_uSideLength);
assert(v3dPos.y() < m_uSideLength);
assert(v3dPos.z() < m_uSideLength);
assert(v3dPos.getX() < m_uSideLength);
assert(v3dPos.getY() < m_uSideLength);
assert(v3dPos.getZ() < m_uSideLength);
return getVoxelAt(v3dPos.x(), v3dPos.y(), v3dPos.z());
return getVoxelAt(v3dPos.getX(), v3dPos.getY(), v3dPos.getZ());
}
#pragma endregion
@ -172,23 +172,23 @@ namespace PolyVox
template <typename VoxelType>
bool BlockVolume<VoxelType>::containsPoint(const Vector3DFloat& pos, float boundary) const
{
return (pos.x() <= m_uSideLength - 1 - boundary)
&& (pos.y() <= m_uSideLength - 1 - boundary)
&& (pos.z() <= m_uSideLength - 1 - boundary)
&& (pos.x() >= boundary)
&& (pos.y() >= boundary)
&& (pos.z() >= boundary);
return (pos.getX() <= m_uSideLength - 1 - boundary)
&& (pos.getY() <= m_uSideLength - 1 - boundary)
&& (pos.getZ() <= m_uSideLength - 1 - boundary)
&& (pos.getX() >= boundary)
&& (pos.getY() >= boundary)
&& (pos.getZ() >= boundary);
}
template <typename VoxelType>
bool BlockVolume<VoxelType>::containsPoint(const Vector3DInt32& pos, boost::uint16_t boundary) const
{
return (pos.x() <= m_uSideLength - 1 - boundary)
&& (pos.y() <= m_uSideLength - 1 - boundary)
&& (pos.z() <= m_uSideLength - 1 - boundary)
&& (pos.x() >= boundary)
&& (pos.y() >= boundary)
&& (pos.z() >= boundary);
return (pos.getX() <= m_uSideLength - 1 - boundary)
&& (pos.getY() <= m_uSideLength - 1 - boundary)
&& (pos.getZ() <= m_uSideLength - 1 - boundary)
&& (pos.getX() >= boundary)
&& (pos.getY() >= boundary)
&& (pos.getZ() >= boundary);
}
template <typename VoxelType>

View File

@ -62,20 +62,20 @@ namespace PolyVox
Vector<Size,Type>& operator*=(const Type& rhs) throw();
///Division and Assignment Operator.
Vector<Size,Type>& operator/=(const Type& rhs) throw();
///Element Access
Type operator()(boost::uint32_t index) const throw();
///Element Access
Type getElement(boost::uint32_t index) const throw();
///Get the x component of the vector.
Type x(void) const throw();
Type getX(void) const throw();
///Get the y component of the vector.
Type y(void) const throw();
Type getY(void) const throw();
///Get the z component of the vector.
Type z(void) const throw();
Type getZ(void) const throw();
///Get the w component of the vector.
Type w(void) const throw();
Type getW(void) const throw();
///Element Access
void set(boost::uint32_t index, Type tValue) throw();
void setElement(boost::uint32_t index, Type tValue) throw();
///Set the x component of the vector.
void setX(Type tX) throw();
///Set the y component of the vector.

View File

@ -34,7 +34,7 @@ namespace PolyVox
The elements of the Vector are accessed via the overloaded () operator which takes
an index indicating the element to fetch. They are set using the set() function which
takes an index indicating the element to set and a new value for that element. For
convienience, the functions x(), setX(), y(), setY(), z(), setZ, w() and setW()
convienience, the functions getX(), setX(), getY(), setY(), getZ(), setZ, w() and setW()
do the same thing for the first 4 elements of the Vector.
A variety of overloaded operators are also provided for comparison and arithmetic
@ -125,7 +125,7 @@ namespace PolyVox
{
for(boost::uint32_t ct = 0; ct < Size; ++ct)
{
m_tElements[ct] = static_cast<CastType>(vector(ct));
m_tElements[ct] = static_cast<CastType>(vector.getElement(ct));
}
}
@ -268,7 +268,7 @@ namespace PolyVox
os << "(";
for(boost::uint32_t ct = 0; ct < Size; ++ct)
{
os << vector(ct);
os << vector.getElement(ct);
if(ct < (Size-1))
{
os << ",";
@ -276,7 +276,9 @@ namespace PolyVox
}
os << ")";
return os;
}
}
//----------------------------------- Getters ----------------------------------
/**
Returns the element at the given position.
@ -284,18 +286,16 @@ namespace PolyVox
\return The element.
*/
template <boost::uint32_t Size, typename Type>
inline Type Vector<Size, Type>::operator()(boost::uint32_t index) const throw()
inline Type Vector<Size, Type>::getElement(boost::uint32_t index) const throw()
{
return m_tElements[index];
}
//----------------------------------- Getters ----------------------------------
}
/**
\return A const reference to the X component of a 1, 2, 3, or 4 dimensional Vector.
*/
template <boost::uint32_t Size, typename Type>
inline Type Vector<Size, Type>::x(void) const throw()
inline Type Vector<Size, Type>::getX(void) const throw()
{
return m_tElements[0];
}
@ -304,7 +304,7 @@ namespace PolyVox
\return A const reference to the Y component of a 2, 3, or 4 dimensional Vector.
*/
template <boost::uint32_t Size, typename Type>
inline Type Vector<Size, Type>::y(void) const throw()
inline Type Vector<Size, Type>::getY(void) const throw()
{
return m_tElements[1];
}
@ -313,7 +313,7 @@ namespace PolyVox
\return A const reference to the Z component of a 3 or 4 dimensional Vector.
*/
template <boost::uint32_t Size, typename Type>
inline Type Vector<Size, Type>::z(void) const throw()
inline Type Vector<Size, Type>::getZ(void) const throw()
{
return m_tElements[2];
}
@ -322,7 +322,7 @@ namespace PolyVox
\return A const reference to the W component of a 4 dimensional Vector.
*/
template <boost::uint32_t Size, typename Type>
inline Type Vector<Size, Type>::w(void) const throw()
inline Type Vector<Size, Type>::getW(void) const throw()
{
return m_tElements[3];
}
@ -334,7 +334,7 @@ namespace PolyVox
\param tValue The new value for the element.
*/
template <boost::uint32_t Size, typename Type>
inline void Vector<Size, Type>::set(boost::uint32_t index, Type tValue) throw()
inline void Vector<Size, Type>::setElement(boost::uint32_t index, Type tValue) throw()
{
m_tElements[index] = tValue;
}
@ -432,9 +432,9 @@ namespace PolyVox
template <boost::uint32_t Size, typename Type>
inline Vector<Size, Type> Vector<Size, Type>::cross(const Vector<Size, Type>& vector) const throw()
{
Type i = vector.z() * this->y() - vector.y() * this->z();
Type j = vector.x() * this->z() - vector.z() * this->x();
Type k = vector.y() * this->x() - vector.x() * this->y();
Type i = vector.getZ() * this->getY() - vector.getY() * this->getZ();
Type j = vector.getX() * this->getZ() - vector.getZ() * this->getX();
Type k = vector.getY() * this->getX() - vector.getX() * this->getY();
return Vector<Size, Type>(i,j,k);
}

View File

@ -192,7 +192,7 @@ namespace PolyVox
template <typename VoxelType>
void VolumeIterator<VoxelType>::setValidRegion(const Region& region)
{
setValidRegion(region.getLowerCorner().x(),region.getLowerCorner().y(),region.getLowerCorner().z(),region.getUpperCorner().x(),region.getUpperCorner().y(),region.getUpperCorner().z());
setValidRegion(region.getLowerCorner().getX(),region.getLowerCorner().getY(),region.getLowerCorner().getZ(),region.getUpperCorner().getX(),region.getUpperCorner().getY(),region.getUpperCorner().getZ());
}
template <typename VoxelType>