Added Import() to box and barycenter functors

to handle tree and objects with different ScalarType.
This commit is contained in:
Marco Di Benedetto 2005-09-28 21:23:03 +00:00
parent 21d8967063
commit bf84eeafe0
1 changed files with 7 additions and 2 deletions

View File

@ -25,6 +25,9 @@
History History
$Log: not supported by cvs2svn $ $Log: not supported by cvs2svn $
Revision 1.3 2005/09/28 20:10:41 m_di_benedetto
First Commit.
****************************************************************************/ ****************************************************************************/
@ -67,14 +70,16 @@ public:
class GetBoxFunctor { class GetBoxFunctor {
public: public:
void operator () (const ObjType & obj, Box3<ScalarType> & box) { void operator () (const ObjType & obj, Box3<ScalarType> & box) {
obj.GetBBox(box); Box3<typename ObjType::ScalarType> tb;
obj.GetBBox(tb);
box.Import(tb);
} }
}; };
class GetBarycenterFunctor { class GetBarycenterFunctor {
public: public:
void operator () (const ObjType & obj, CoordType & bar) { void operator () (const ObjType & obj, CoordType & bar) {
bar = obj.Barycenter(); bar.Import(obj.Barycenter());
} }
}; };