contiguous data

This commit is contained in:
mattijs
2008-09-15 12:20:31 +01:00
parent 20d213e89d
commit 13e9ce0e95
3 changed files with 22 additions and 7 deletions

View File

@ -45,7 +45,7 @@ typedef PointIndexHit<point> pointIndexHit;
//- Specify data associated with pointIndexHit type is contiguous
template<>
inline bool contiguous<pointIndexHit>() {return true;}
inline bool contiguous<pointIndexHit>() {return contiguous<point>();}
}

View File

@ -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<const boundBox&>(a),
static_cast<const boundBox&>(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<const boundBox&>(bb);
}
Foam::Istream& Foam::operator>>(Istream& is, treeBoundBox& bb)
{
is >> bb.min() >> bb.max();
return is;
return is >> static_cast<boundBox&>(bb);
}

View File

@ -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<treeBoundBox>() {return contiguous<boundBox>();}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam