A lot of attempts in gcc compiling...
This commit is contained in:
parent
edc816917a
commit
1e7094c90d
|
@ -24,6 +24,9 @@
|
||||||
History
|
History
|
||||||
|
|
||||||
$Log: not supported by cvs2svn $
|
$Log: not supported by cvs2svn $
|
||||||
|
Revision 1.3 2005/09/16 10:03:46 m_di_benedetto
|
||||||
|
General interface redefinition, added special functors for faces.
|
||||||
|
|
||||||
Revision 1.2 2005/09/11 11:46:43 m_di_benedetto
|
Revision 1.2 2005/09/11 11:46:43 m_di_benedetto
|
||||||
First Commit
|
First Commit
|
||||||
|
|
||||||
|
@ -66,7 +69,7 @@ class AABBBinaryTreeUtils {
|
||||||
class P3Converter {
|
class P3Converter {
|
||||||
public:
|
public:
|
||||||
static Point3<T1> Convert(const Point3<T2> & p) {
|
static Point3<T1> Convert(const Point3<T2> & p) {
|
||||||
return (Point3<T1>(T1(p[0]), T1(p[1]), T1(p[2])));
|
return Point3<T1>( (T1)p[0], (T1)p[1], (T1)p[2] );
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -91,26 +94,23 @@ class AABBBinaryTreeUtils {
|
||||||
class EmptyClass {
|
class EmptyClass {
|
||||||
};
|
};
|
||||||
|
|
||||||
template <class T>
|
|
||||||
class ObjIteratorPtrFunct {
|
class ObjIteratorPtrFunct {
|
||||||
public:
|
public:
|
||||||
template <class T>
|
template <class T>
|
||||||
inline T * operator () (T & t) {
|
inline T * operator () (T & t) {
|
||||||
return (&t);
|
return (&t);
|
||||||
}
|
}
|
||||||
|
template <class T *>
|
||||||
|
inline T * operator () (T* & t) {
|
||||||
|
return (t);
|
||||||
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
template <class T>
|
static ObjIteratorPtrFunct IteratorPtrFunctor(void) {
|
||||||
class ObjIteratorPtrFunct<T *> {
|
ObjIteratorPtrFunct pp;
|
||||||
public:
|
return pp;
|
||||||
inline T * operator () (T * & t) {
|
|
||||||
return (t);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
static ObjIteratorPtrFunct<ObjType> IteratorPtrFunctor(void) {
|
|
||||||
return (ObjIteratorPtrFunct<ObjType>());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class OBJ>
|
template <class OBJ>
|
||||||
|
@ -124,21 +124,9 @@ class AABBBinaryTreeUtils {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
template <>
|
static ObjBoxFunct<ObjType> BoxFunctor(void) {
|
||||||
class ObjBoxFunct<Face> {
|
ObjBoxFunct<ObjType> tt;
|
||||||
public:
|
return tt;
|
||||||
template <class FACETYPE>
|
|
||||||
inline Box3<ScalarType> operator () (const FACETYPE & f) {
|
|
||||||
Box3<ScalarType> box;
|
|
||||||
box.Set(ConvertP3<ScalarType, FACETYPE::ScalarType>(f.P(0)));
|
|
||||||
box.Add(ConvertP3<ScalarType, FACETYPE::ScalarType>(f.P(1)));
|
|
||||||
box.Add(ConvertP3<ScalarType, FACETYPE::ScalarType>(f.P(2)));
|
|
||||||
return (box);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
static ObjBoxFunct<ObjType> BoxFunctor(void) {
|
|
||||||
return (ObjBoxFunct<ObjType>());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class FACETYPE>
|
template <class FACETYPE>
|
||||||
|
@ -156,7 +144,8 @@ class AABBBinaryTreeUtils {
|
||||||
|
|
||||||
template <class FACETYPE>
|
template <class FACETYPE>
|
||||||
static FaceBoxFunct<FACETYPE> FaceBoxFunctor(void) {
|
static FaceBoxFunct<FACETYPE> FaceBoxFunctor(void) {
|
||||||
return (FaceBoxFunct<FACETYPE>());
|
FaceBoxFunct<FACETYPE> tt;
|
||||||
|
return tt;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class OBJ>
|
template <class OBJ>
|
||||||
|
@ -170,18 +159,10 @@ class AABBBinaryTreeUtils {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
template <>
|
|
||||||
class ObjBarycenterFunct<Face> {
|
|
||||||
public:
|
|
||||||
template <class FACETYPE>
|
|
||||||
inline Point3<ScalarType> operator () (const Face & f) {
|
|
||||||
printf("FACE\n");
|
|
||||||
return (ConvertP3<ScalarType, Face::ScalarType>(f.Barycenter()));
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
static ObjBarycenterFunct<ObjType> BarycenterFunctor(void) {
|
static ObjBarycenterFunct<ObjType> BarycenterFunctor(void) {
|
||||||
return (ObjBarycenterFunct<ObjType>());
|
ObjBarycenterFunct<ObjType> tt;
|
||||||
|
return tt;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class FACETYPE>
|
template <class FACETYPE>
|
||||||
|
@ -195,7 +176,8 @@ class AABBBinaryTreeUtils {
|
||||||
|
|
||||||
template <class FACETYPE>
|
template <class FACETYPE>
|
||||||
static FaceBarycenterFunct<FACETYPE> FaceBarycenterFunctor(void) {
|
static FaceBarycenterFunct<FACETYPE> FaceBarycenterFunctor(void) {
|
||||||
return (FaceBarycenterFunct<FACETYPE>());
|
FaceBarycenterFunct<FACETYPE> tt;
|
||||||
|
return tt;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class OBJ>
|
template <class OBJ>
|
||||||
|
@ -210,23 +192,10 @@ class AABBBinaryTreeUtils {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
template <>
|
|
||||||
class ObjPointDistanceFunct<Face> {
|
|
||||||
public:
|
|
||||||
template <class FACETYPE>
|
|
||||||
inline bool operator () (const FACETYPE & f, const Point3<ScalarType> & p, ScalarType & minDist, Point3<ScalarType> & res) {
|
|
||||||
Point3<ScalarType> fp = ConvertP3<FACETYPE::ScalarType, ScalarType>(p);
|
|
||||||
FACETYPE::ScalarType md = FACETYPE::ScalarType(minDist);
|
|
||||||
Point3<ScalarType> fres;
|
|
||||||
const bool bret = face::PointDistance(f, p, md, fres);
|
|
||||||
minDist = ScalarType(md);
|
|
||||||
res = ConvertP3<ScalarType, FACETYPE::ScalarType>(fres);
|
|
||||||
return (bret);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
static ObjPointDistanceFunct<ObjType> PointDistanceFunctor(void) {
|
static ObjPointDistanceFunct<ObjType> PointDistanceFunctor(void) {
|
||||||
return (ObjPointDistanceFunct<ObjType>());
|
ObjPointDistanceFunct<ObjType> tt;
|
||||||
|
return tt;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class FACETYPE>
|
template <class FACETYPE>
|
||||||
|
@ -235,18 +204,19 @@ class AABBBinaryTreeUtils {
|
||||||
typedef FACETYPE FaceType;
|
typedef FACETYPE FaceType;
|
||||||
inline bool operator () (const FaceType & f, const Point3<ScalarType> & p, ScalarType & minDist, Point3<ScalarType> & res) {
|
inline bool operator () (const FaceType & f, const Point3<ScalarType> & p, ScalarType & minDist, Point3<ScalarType> & res) {
|
||||||
Point3<ScalarType> fp = ConvertP3<FaceType::ScalarType, ScalarType>(p);
|
Point3<ScalarType> fp = ConvertP3<FaceType::ScalarType, ScalarType>(p);
|
||||||
FaceType::ScalarType md = FaceType::ScalarType(minDist);
|
typename FaceType::ScalarType md = (typename FaceType::ScalarType)minDist;
|
||||||
Point3<ScalarType> fres;
|
Point3<ScalarType> fres;
|
||||||
const bool bret = face::PointDistance(f, p, md, fres);
|
const bool bret = face::PointDistance(f, p, md, fres);
|
||||||
minDist = ScalarType(md);
|
minDist = ScalarType(md);
|
||||||
res = ConvertP3<ScalarType, FaceType::ScalarType>(fres);
|
res = ConvertP3<ScalarType, typename FaceType::ScalarType>(fres);
|
||||||
return (bret);
|
return (bret);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
template <class FACETYPE>
|
template <class FACETYPE>
|
||||||
static FacePointDistanceFunct<FACETYPE> FacePointDistanceFunctor(void) {
|
static FacePointDistanceFunct<FACETYPE> FacePointDistanceFunctor(void) {
|
||||||
return (FacePointDistanceFunct<FACETYPE>());
|
FacePointDistanceFunct<FACETYPE> tt;
|
||||||
|
return tt;
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue