diff --git a/src/meshTools/octree/pointIndexHit.H b/src/meshTools/octree/pointIndexHit.H index b43f12d551..4a468b60e1 100644 --- a/src/meshTools/octree/pointIndexHit.H +++ b/src/meshTools/octree/pointIndexHit.H @@ -45,7 +45,7 @@ typedef PointIndexHit pointIndexHit; //- Specify data associated with pointIndexHit type is contiguous template<> -inline bool contiguous() {return true;} +inline bool contiguous() {return contiguous();} } diff --git a/src/meshTools/octree/treeBoundBox.C b/src/meshTools/octree/treeBoundBox.C index 26530b5a3a..1c67e72a7e 100644 --- a/src/meshTools/octree/treeBoundBox.C +++ b/src/meshTools/octree/treeBoundBox.C @@ -679,7 +679,11 @@ Foam::label Foam::treeBoundBox::distanceCmp bool Foam::operator==(const treeBoundBox& a, const treeBoundBox& b) { - return (a.min() == b.min()) && (a.max() == b.max()); + return operator== + ( + static_cast(a), + static_cast(b) + ); } @@ -689,12 +693,17 @@ bool Foam::operator!=(const treeBoundBox& a, const treeBoundBox& b) } -// * * * * * * * * * * * * * * * IOstream Operator * * * * * * * * * * * * * // +// * * * * * * * * * * * * * * * Ostream Operator * * * * * * * * * * * * * // + +Foam::Ostream& Foam::operator<<(Ostream& os, const treeBoundBox& bb) +{ + return os << static_cast(bb); +} + Foam::Istream& Foam::operator>>(Istream& is, treeBoundBox& bb) { - is >> bb.min() >> bb.max(); - return is; + return is >> static_cast(bb); } diff --git a/src/meshTools/octree/treeBoundBox.H b/src/meshTools/octree/treeBoundBox.H index 1805d88b76..926b2f3336 100644 --- a/src/meshTools/octree/treeBoundBox.H +++ b/src/meshTools/octree/treeBoundBox.H @@ -322,13 +322,19 @@ public: friend bool operator==(const treeBoundBox&, const treeBoundBox&); friend bool operator!=(const treeBoundBox&, const treeBoundBox&); - // IOstream operator - friend Istream& operator>>(Istream&, treeBoundBox&); + friend Istream& operator>>(Istream& is, treeBoundBox&); + friend Ostream& operator<<(Ostream& os, const treeBoundBox&); + }; +//- Specify data associated with boundBox type is contiguous +template<> +inline bool contiguous() {return contiguous();} + + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // } // End namespace Foam