Brought across Region operator<< from Cubiquity branch.
This commit is contained in:
parent
5664e2f681
commit
288b448b9f
@ -202,6 +202,10 @@ namespace PolyVox
|
|||||||
int32_t m_iUpperZ;
|
int32_t m_iUpperZ;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Non-member overloaded operators.
|
||||||
|
/// Stream insertion operator.
|
||||||
|
std::ostream& operator<<(std::ostream& os, const Region& region);
|
||||||
|
|
||||||
// Functions to be inlined to to be in the header rather than the .cpp.
|
// Functions to be inlined to to be in the header rather than the .cpp.
|
||||||
// 'inline' keyword is used for the definition rather than the declaration.
|
// 'inline' keyword is used for the definition rather than the declaration.
|
||||||
// See also http://www.parashift.com/c++-faq-lite/inline-functions.html
|
// See also http://www.parashift.com/c++-faq-lite/inline-functions.html
|
||||||
|
@ -487,4 +487,17 @@ namespace PolyVox
|
|||||||
{
|
{
|
||||||
shrink(v3dAmount.getX(), v3dAmount.getY(), v3dAmount.getZ());
|
shrink(v3dAmount.getX(), v3dAmount.getY(), v3dAmount.getZ());
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
/**
|
||||||
|
* Enables the Region to be used intuitively with output streams such as cout.
|
||||||
|
* \param os The output stream to write to.
|
||||||
|
* \param region The Region to write to the stream.
|
||||||
|
* \return A reference to the output stream to allow chaining.
|
||||||
|
*/
|
||||||
|
std::ostream& operator<<(std::ostream& os, const Region& region)
|
||||||
|
{
|
||||||
|
os << "(" << region.getLowerX() << "," << region.getLowerY() << "," << region.getLowerZ() <<
|
||||||
|
") to (" << region.getUpperX() << "," << region.getUpperY() << "," << region.getUpperZ() << ")";
|
||||||
|
return os;
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user