Added classes GetBox3Functor and GetBarycenter3Functor.
This commit is contained in:
parent
5b15048c38
commit
62893095e0
22
wrap/utils.h
22
wrap/utils.h
|
@ -25,6 +25,9 @@
|
||||||
History
|
History
|
||||||
|
|
||||||
$Log: not supported by cvs2svn $
|
$Log: not supported by cvs2svn $
|
||||||
|
Revision 1.1 2005/09/28 20:01:35 m_di_benedetto
|
||||||
|
First Commit.
|
||||||
|
|
||||||
|
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
|
@ -34,6 +37,7 @@ $Log: not supported by cvs2svn $
|
||||||
// vcg headers
|
// vcg headers
|
||||||
#include <vcg/math/base.h>
|
#include <vcg/math/base.h>
|
||||||
#include <vcg/space/point3.h>
|
#include <vcg/space/point3.h>
|
||||||
|
#include <vcg/space/box3.h>
|
||||||
|
|
||||||
namespace vcg {
|
namespace vcg {
|
||||||
|
|
||||||
|
@ -57,6 +61,24 @@ public:
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class GetBox3Functor {
|
||||||
|
public:
|
||||||
|
template <class OBJTYPE, class SCALARTYPE>
|
||||||
|
void operator () (const OBJTYPE & obj, Box3<SCALARTYPE> & box) {
|
||||||
|
Box3<typename OBJTYPE::ScalarType> tb;
|
||||||
|
obj.GetBBox(tb);
|
||||||
|
box.Import(tb);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
class GetBarycenter3Functor {
|
||||||
|
public:
|
||||||
|
template <class OBJTYPE, class SCALARTYPE>
|
||||||
|
void operator () (const OBJTYPE & obj, Point3<SCALARTYPE> & bar) {
|
||||||
|
bar.Import(obj.Barycenter());
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
template <class SCALARTYPE>
|
template <class SCALARTYPE>
|
||||||
inline Point3<SCALARTYPE> Abs(const Point3<SCALARTYPE> & p) {
|
inline Point3<SCALARTYPE> Abs(const Point3<SCALARTYPE> & p) {
|
||||||
return (Point3<SCALARTYPE>(math::Abs(p[0]), math::Abs(p[1]), math::Abs(p[2])));
|
return (Point3<SCALARTYPE>(math::Abs(p[0]), math::Abs(p[1]), math::Abs(p[2])));
|
||||||
|
|
Loading…
Reference in New Issue