Removed unused typenames (with latest generation of compilers it become a warning as unused variables)
This commit is contained in:
parent
5e40d7a734
commit
874346d211
|
@ -1693,7 +1693,6 @@ public:
|
||||||
typedef vcg::SpatialHashTable<VertexType, ScalarType> SampleSHT;
|
typedef vcg::SpatialHashTable<VertexType, ScalarType> SampleSHT;
|
||||||
SampleSHT sht;
|
SampleSHT sht;
|
||||||
tri::VertTmark<MeshType> markerFunctor;
|
tri::VertTmark<MeshType> markerFunctor;
|
||||||
typedef vcg::vertex::PointDistanceFunctor<ScalarType> VDistFunct;
|
|
||||||
std::vector<VertexType*> closests;
|
std::vector<VertexType*> closests;
|
||||||
int mergedCnt=0;
|
int mergedCnt=0;
|
||||||
sht.Set(m.vert.begin(), m.vert.end());
|
sht.Set(m.vert.begin(), m.vert.end());
|
||||||
|
@ -1810,63 +1809,63 @@ public:
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Select the folded faces using an angle threshold on the face normal.
|
Select the folded faces using an angle threshold on the face normal.
|
||||||
The face is selected if the dot product between the face normal and the normal of the plane fitted
|
The face is selected if the dot product between the face normal and the normal of the plane fitted
|
||||||
using the vertices of the one ring faces is below the cosThreshold.
|
using the vertices of the one ring faces is below the cosThreshold.
|
||||||
The cosThreshold requires a negative cosine value (a positive value is clamp to zero).
|
The cosThreshold requires a negative cosine value (a positive value is clamp to zero).
|
||||||
*/
|
*/
|
||||||
static void SelectFoldedFaceFromOneRingFaces(MeshType &m, ScalarType cosThreshold)
|
static void SelectFoldedFaceFromOneRingFaces(MeshType &m, ScalarType cosThreshold)
|
||||||
{
|
{
|
||||||
tri::RequireVFAdjacency(m);
|
tri::RequireVFAdjacency(m);
|
||||||
tri::RequirePerFaceNormal(m);
|
tri::RequirePerFaceNormal(m);
|
||||||
tri::RequirePerVertexNormal(m);
|
tri::RequirePerVertexNormal(m);
|
||||||
vcg::tri::UpdateSelection<MeshType>::FaceClear(m);
|
vcg::tri::UpdateSelection<MeshType>::FaceClear(m);
|
||||||
vcg::tri::UpdateNormal<MeshType>::PerFaceNormalized(m);
|
vcg::tri::UpdateNormal<MeshType>::PerFaceNormalized(m);
|
||||||
vcg::tri::UpdateNormal<MeshType>::PerVertexNormalized(m);
|
vcg::tri::UpdateNormal<MeshType>::PerVertexNormalized(m);
|
||||||
vcg::tri::UpdateTopology<MeshType>::VertexFace(m);
|
vcg::tri::UpdateTopology<MeshType>::VertexFace(m);
|
||||||
if (cosThreshold > 0)
|
if (cosThreshold > 0)
|
||||||
cosThreshold = 0;
|
cosThreshold = 0;
|
||||||
|
|
||||||
#pragma omp parallel for schedule(dynamic, 10)
|
#pragma omp parallel for schedule(dynamic, 10)
|
||||||
for (int i = 0; i < m.face.size(); i++)
|
for (int i = 0; i < m.face.size(); i++)
|
||||||
{
|
{
|
||||||
std::vector<typename MeshType::VertexPointer> nearVertex;
|
std::vector<typename MeshType::VertexPointer> nearVertex;
|
||||||
std::vector<typename MeshType::CoordType> point;
|
std::vector<typename MeshType::CoordType> point;
|
||||||
typename MeshType::FacePointer f = &m.face[i];
|
typename MeshType::FacePointer f = &m.face[i];
|
||||||
for (int j = 0; j < 3; j++)
|
for (int j = 0; j < 3; j++)
|
||||||
{
|
{
|
||||||
std::vector<typename MeshType::VertexPointer> temp;
|
std::vector<typename MeshType::VertexPointer> temp;
|
||||||
vcg::face::VVStarVF<typename MeshType::FaceType>(f->V(j), temp);
|
vcg::face::VVStarVF<typename MeshType::FaceType>(f->V(j), temp);
|
||||||
typename std::vector<typename MeshType::VertexPointer>::iterator iter = temp.begin();
|
typename std::vector<typename MeshType::VertexPointer>::iterator iter = temp.begin();
|
||||||
for (; iter != temp.end(); iter++)
|
for (; iter != temp.end(); iter++)
|
||||||
{
|
{
|
||||||
if ((*iter) != f->V1(j) && (*iter) != f->V2(j))
|
if ((*iter) != f->V1(j) && (*iter) != f->V2(j))
|
||||||
{
|
{
|
||||||
nearVertex.push_back((*iter));
|
nearVertex.push_back((*iter));
|
||||||
point.push_back((*iter)->P());
|
point.push_back((*iter)->P());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
nearVertex.push_back(f->V(j));
|
nearVertex.push_back(f->V(j));
|
||||||
point.push_back(f->P(j));
|
point.push_back(f->P(j));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (point.size() > 3)
|
if (point.size() > 3)
|
||||||
{
|
{
|
||||||
vcg::Plane3<typename MeshType::ScalarType> plane;
|
vcg::Plane3<typename MeshType::ScalarType> plane;
|
||||||
vcg::FitPlaneToPointSet(point, plane);
|
vcg::FitPlaneToPointSet(point, plane);
|
||||||
float avgDot = 0;
|
float avgDot = 0;
|
||||||
for (int j = 0; j < nearVertex.size(); j++)
|
for (int j = 0; j < nearVertex.size(); j++)
|
||||||
avgDot += plane.Direction().dot(nearVertex[j]->N());
|
avgDot += plane.Direction().dot(nearVertex[j]->N());
|
||||||
avgDot /= nearVertex.size();
|
avgDot /= nearVertex.size();
|
||||||
typename MeshType::VertexType::NormalType normal;
|
typename MeshType::VertexType::NormalType normal;
|
||||||
if (avgDot < 0)
|
if (avgDot < 0)
|
||||||
normal = -plane.Direction();
|
normal = -plane.Direction();
|
||||||
else
|
else
|
||||||
normal = plane.Direction();
|
normal = plane.Direction();
|
||||||
if (normal.dot(f->N()) < cosThreshold)
|
if (normal.dot(f->N()) < cosThreshold)
|
||||||
f->SetS();
|
f->SetS();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}; // end class
|
}; // end class
|
||||||
|
|
|
@ -100,7 +100,6 @@ namespace vcg {
|
||||||
typename GRID::CoordType & _ip)
|
typename GRID::CoordType & _ip)
|
||||||
{
|
{
|
||||||
typedef typename GRID::ScalarType ScalarType;
|
typedef typename GRID::ScalarType ScalarType;
|
||||||
typedef Point3<ScalarType> Point3x;
|
|
||||||
|
|
||||||
typedef FaceTmark<MESH> MarkerFace;
|
typedef FaceTmark<MESH> MarkerFace;
|
||||||
MarkerFace mf(&mesh);
|
MarkerFace mf(&mesh);
|
||||||
|
@ -123,39 +122,38 @@ namespace vcg {
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class MESH, class GRID>
|
template <class MESH, class GRID>
|
||||||
typename MESH::FaceType * GetClosestFaceBase( MESH & mesh,GRID & gr,const typename GRID::CoordType & _p,
|
typename MESH::FaceType * GetClosestFaceBase( MESH & mesh,GRID & gr,const typename GRID::CoordType & _p,
|
||||||
const typename GRID::ScalarType _maxDist,typename GRID::ScalarType & _minDist,
|
const typename GRID::ScalarType _maxDist,typename GRID::ScalarType & _minDist,
|
||||||
typename GRID::CoordType &_closestPt)
|
typename GRID::CoordType &_closestPt)
|
||||||
{
|
{
|
||||||
typedef typename GRID::ScalarType ScalarType;
|
typedef typename GRID::ScalarType ScalarType;
|
||||||
typedef Point3<ScalarType> Point3x;
|
typedef FaceTmark<MESH> MarkerFace;
|
||||||
typedef FaceTmark<MESH> MarkerFace;
|
MarkerFace mf;
|
||||||
MarkerFace mf;
|
mf.SetMesh(&mesh);
|
||||||
mf.SetMesh(&mesh);
|
vcg::face::PointDistanceBaseFunctor<ScalarType> PDistFunct;
|
||||||
vcg::face::PointDistanceBaseFunctor<ScalarType> PDistFunct;
|
_minDist=_maxDist;
|
||||||
_minDist=_maxDist;
|
return (gr.GetClosest(PDistFunct,mf,_p,_maxDist,_minDist,_closestPt));
|
||||||
return (gr.GetClosest(PDistFunct,mf,_p,_maxDist,_minDist,_closestPt));
|
}
|
||||||
}
|
|
||||||
|
|
||||||
template <class MESH, class GRID>
|
template <class MESH, class GRID>
|
||||||
typename MESH::FaceType * GetClosestFaceBase( MESH & mesh,GRID & gr,const typename GRID::CoordType & _p,
|
typename MESH::FaceType * GetClosestFaceBase( MESH & mesh,GRID & gr,const typename GRID::CoordType & _p,
|
||||||
const typename GRID::ScalarType _maxDist,typename GRID::ScalarType & _minDist,
|
const typename GRID::ScalarType _maxDist,typename GRID::ScalarType & _minDist,
|
||||||
typename GRID::CoordType &_closestPt, typename GRID::CoordType & _normf,
|
typename GRID::CoordType &_closestPt, typename GRID::CoordType & _normf,
|
||||||
typename GRID::CoordType & _ip)
|
typename GRID::CoordType & _ip)
|
||||||
{
|
{
|
||||||
typedef typename GRID::ScalarType ScalarType;
|
typedef typename GRID::ScalarType ScalarType;
|
||||||
typename MESH::FaceType * f = GetClosestFaceBase(mesh, gr, _p, _maxDist, _minDist, _closestPt);
|
typename MESH::FaceType * f = GetClosestFaceBase(mesh, gr, _p, _maxDist, _minDist, _closestPt);
|
||||||
if(_maxDist> ScalarType(fabs(_minDist)))
|
if(_maxDist> ScalarType(fabs(_minDist)))
|
||||||
{
|
{
|
||||||
// normal computed with trilinear interpolation
|
// normal computed with trilinear interpolation
|
||||||
InterpolationParameters<typename MESH::FaceType,typename MESH::ScalarType>(*f,f->N(),_closestPt, _ip);
|
InterpolationParameters<typename MESH::FaceType,typename MESH::ScalarType>(*f,f->N(),_closestPt, _ip);
|
||||||
_normf = (f->V(0)->cN())*_ip[0]+
|
_normf = (f->V(0)->cN())*_ip[0]+
|
||||||
(f->V(1)->cN())*_ip[1]+
|
(f->V(1)->cN())*_ip[1]+
|
||||||
(f->V(2)->cN())*_ip[2];
|
(f->V(2)->cN())*_ip[2];
|
||||||
}
|
}
|
||||||
return f;
|
return f;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class MESH, class GRID>
|
template <class MESH, class GRID>
|
||||||
typename MESH::FaceType * GetClosestFaceEP( MESH & mesh,GRID & gr,const typename GRID::CoordType & _p,
|
typename MESH::FaceType * GetClosestFaceEP( MESH & mesh,GRID & gr,const typename GRID::CoordType & _p,
|
||||||
|
@ -163,7 +161,6 @@ namespace vcg {
|
||||||
typename GRID::CoordType &_closestPt)
|
typename GRID::CoordType &_closestPt)
|
||||||
{
|
{
|
||||||
typedef typename GRID::ScalarType ScalarType;
|
typedef typename GRID::ScalarType ScalarType;
|
||||||
typedef Point3<ScalarType> Point3x;
|
|
||||||
typedef FaceTmark<MESH> MarkerFace;
|
typedef FaceTmark<MESH> MarkerFace;
|
||||||
MarkerFace mf;
|
MarkerFace mf;
|
||||||
mf.SetMesh(&mesh);
|
mf.SetMesh(&mesh);
|
||||||
|
@ -177,7 +174,6 @@ namespace vcg {
|
||||||
const typename GRID::ScalarType & _maxDist,typename GRID::ScalarType & _minDist,
|
const typename GRID::ScalarType & _maxDist,typename GRID::ScalarType & _minDist,
|
||||||
typename GRID::CoordType &_closestPt)
|
typename GRID::CoordType &_closestPt)
|
||||||
{
|
{
|
||||||
typedef typename GRID::ScalarType ScalarType;
|
|
||||||
typedef FaceTmark<MESH> MarkerFace;
|
typedef FaceTmark<MESH> MarkerFace;
|
||||||
MarkerFace mf;
|
MarkerFace mf;
|
||||||
mf.SetMesh(&mesh);
|
mf.SetMesh(&mesh);
|
||||||
|
@ -341,8 +337,6 @@ namespace vcg {
|
||||||
typename GRID::ObjPtr DoRay(MESH & mesh,GRID & gr, const Ray3<typename GRID::ScalarType> & _ray,
|
typename GRID::ObjPtr DoRay(MESH & mesh,GRID & gr, const Ray3<typename GRID::ScalarType> & _ray,
|
||||||
const typename GRID::ScalarType & _maxDist, typename GRID::ScalarType & _t)
|
const typename GRID::ScalarType & _maxDist, typename GRID::ScalarType & _t)
|
||||||
{
|
{
|
||||||
typedef typename MESH::FaceType FaceType;
|
|
||||||
typedef typename MESH::ScalarType ScalarType;
|
|
||||||
typedef FaceTmark<MESH> MarkerFace;
|
typedef FaceTmark<MESH> MarkerFace;
|
||||||
MarkerFace mf;
|
MarkerFace mf;
|
||||||
mf.SetMesh(&mesh);
|
mf.SetMesh(&mesh);
|
||||||
|
@ -501,7 +495,6 @@ namespace vcg {
|
||||||
typename GRID::CoordType &_closestPt)
|
typename GRID::CoordType &_closestPt)
|
||||||
{
|
{
|
||||||
typedef typename GRID::ScalarType ScalarType;
|
typedef typename GRID::ScalarType ScalarType;
|
||||||
typedef Point3<ScalarType> Point3x;
|
|
||||||
typedef FaceTmark<MESH> MarkerFace;
|
typedef FaceTmark<MESH> MarkerFace;
|
||||||
MarkerFace mf;
|
MarkerFace mf;
|
||||||
mf.SetMesh(&mesh);
|
mf.SetMesh(&mesh);
|
||||||
|
|
|
@ -50,7 +50,6 @@ namespace tri {
|
||||||
template <class TetraMeshType>
|
template <class TetraMeshType>
|
||||||
void Tetrahedron(TetraMeshType &in)
|
void Tetrahedron(TetraMeshType &in)
|
||||||
{
|
{
|
||||||
typedef TetraMeshType MeshType;
|
|
||||||
typedef typename TetraMeshType::CoordType CoordType;
|
typedef typename TetraMeshType::CoordType CoordType;
|
||||||
typedef typename TetraMeshType::VertexPointer VertexPointer;
|
typedef typename TetraMeshType::VertexPointer VertexPointer;
|
||||||
typedef typename TetraMeshType::VertexIterator VertexIterator;
|
typedef typename TetraMeshType::VertexIterator VertexIterator;
|
||||||
|
@ -278,7 +277,6 @@ void Icosahedron(IcoMeshType &in)
|
||||||
template <class MeshType>
|
template <class MeshType>
|
||||||
void Hexahedron(MeshType &in)
|
void Hexahedron(MeshType &in)
|
||||||
{
|
{
|
||||||
typedef typename MeshType::ScalarType ScalarType;
|
|
||||||
typedef typename MeshType::CoordType CoordType;
|
typedef typename MeshType::CoordType CoordType;
|
||||||
typedef typename MeshType::VertexPointer VertexPointer;
|
typedef typename MeshType::VertexPointer VertexPointer;
|
||||||
typedef typename MeshType::VertexIterator VertexIterator;
|
typedef typename MeshType::VertexIterator VertexIterator;
|
||||||
|
@ -327,7 +325,6 @@ void Hexahedron(MeshType &in)
|
||||||
template <class MeshType>
|
template <class MeshType>
|
||||||
void Square(MeshType &in)
|
void Square(MeshType &in)
|
||||||
{
|
{
|
||||||
typedef typename MeshType::ScalarType ScalarType;
|
|
||||||
typedef typename MeshType::CoordType CoordType;
|
typedef typename MeshType::CoordType CoordType;
|
||||||
typedef typename MeshType::VertexPointer VertexPointer;
|
typedef typename MeshType::VertexPointer VertexPointer;
|
||||||
typedef typename MeshType::VertexIterator VertexIterator;
|
typedef typename MeshType::VertexIterator VertexIterator;
|
||||||
|
@ -405,9 +402,7 @@ void SphericalCap(MeshType &in, float angleRad, const int subdiv = 3 )
|
||||||
template <class MeshType>
|
template <class MeshType>
|
||||||
void Sphere(MeshType &in, const int subdiv = 3 )
|
void Sphere(MeshType &in, const int subdiv = 3 )
|
||||||
{
|
{
|
||||||
typedef typename MeshType::ScalarType ScalarType;
|
|
||||||
typedef typename MeshType::CoordType CoordType;
|
typedef typename MeshType::CoordType CoordType;
|
||||||
typedef typename MeshType::VertexPointer VertexPointer;
|
|
||||||
typedef typename MeshType::VertexIterator VertexIterator;
|
typedef typename MeshType::VertexIterator VertexIterator;
|
||||||
typedef typename MeshType::FaceIterator FaceIterator;
|
typedef typename MeshType::FaceIterator FaceIterator;
|
||||||
if(in.vn==0 && in.fn==0) Icosahedron(in);
|
if(in.vn==0 && in.fn==0) Icosahedron(in);
|
||||||
|
@ -445,7 +440,6 @@ void Cone( MeshType& in,
|
||||||
const typename MeshType::ScalarType h,
|
const typename MeshType::ScalarType h,
|
||||||
const int SubDiv = 36 )
|
const int SubDiv = 36 )
|
||||||
{
|
{
|
||||||
typedef typename MeshType::ScalarType ScalarType;
|
|
||||||
typedef typename MeshType::CoordType CoordType;
|
typedef typename MeshType::CoordType CoordType;
|
||||||
typedef typename MeshType::VertexPointer VertexPointer;
|
typedef typename MeshType::VertexPointer VertexPointer;
|
||||||
typedef typename MeshType::VertexIterator VertexIterator;
|
typedef typename MeshType::VertexIterator VertexIterator;
|
||||||
|
@ -534,7 +528,6 @@ void Cone( MeshType& in,
|
||||||
template <class MeshType >
|
template <class MeshType >
|
||||||
void Box(MeshType &in, const typename MeshType::BoxType & bb )
|
void Box(MeshType &in, const typename MeshType::BoxType & bb )
|
||||||
{
|
{
|
||||||
typedef typename MeshType::ScalarType ScalarType;
|
|
||||||
typedef typename MeshType::CoordType CoordType;
|
typedef typename MeshType::CoordType CoordType;
|
||||||
typedef typename MeshType::VertexPointer VertexPointer;
|
typedef typename MeshType::VertexPointer VertexPointer;
|
||||||
typedef typename MeshType::VertexIterator VertexIterator;
|
typedef typename MeshType::VertexIterator VertexIterator;
|
||||||
|
@ -613,11 +606,9 @@ void Torus(MeshType &m, float hRingRadius, float vRingRadius, int hRingDiv=24, i
|
||||||
template <class MeshType,class V, class F >
|
template <class MeshType,class V, class F >
|
||||||
void Build( MeshType & in, const V & v, const F & f)
|
void Build( MeshType & in, const V & v, const F & f)
|
||||||
{
|
{
|
||||||
typedef typename MeshType::ScalarType ScalarType;
|
|
||||||
typedef typename MeshType::CoordType CoordType;
|
typedef typename MeshType::CoordType CoordType;
|
||||||
typedef typename MeshType::VertexPointer VertexPointer;
|
typedef typename MeshType::VertexPointer VertexPointer;
|
||||||
typedef typename MeshType::VertexIterator VertexIterator;
|
typedef typename MeshType::VertexIterator VertexIterator;
|
||||||
typedef typename MeshType::FaceIterator FaceIterator;
|
|
||||||
|
|
||||||
in.Clear();
|
in.Clear();
|
||||||
Allocator<MeshType>::AddVertices(in,v.size());
|
Allocator<MeshType>::AddVertices(in,v.size());
|
||||||
|
@ -698,9 +689,6 @@ template <class MeshType>
|
||||||
void Grid(MeshType & in, int w, int h, float wl, float hl, float *data=0)
|
void Grid(MeshType & in, int w, int h, float wl, float hl, float *data=0)
|
||||||
{
|
{
|
||||||
typedef typename MeshType::CoordType CoordType;
|
typedef typename MeshType::CoordType CoordType;
|
||||||
typedef typename MeshType::VertexPointer VertexPointer;
|
|
||||||
typedef typename MeshType::VertexIterator VertexIterator;
|
|
||||||
typedef typename MeshType::FaceIterator FaceIterator;
|
|
||||||
|
|
||||||
in.Clear();
|
in.Clear();
|
||||||
Allocator<MeshType>::AddVertices(in,w*h);
|
Allocator<MeshType>::AddVertices(in,w*h);
|
||||||
|
|
|
@ -38,13 +38,13 @@ inline bool IsEdgeManifold( EdgeType const & e, const int j )
|
||||||
|
|
||||||
if(EdgeType::HasFFAdjacency())
|
if(EdgeType::HasFFAdjacency())
|
||||||
return ( e.cFFp(j) == &e || &e == e.cFFp(j)->cFFp(e.cFFi(j)) );
|
return ( e.cFFp(j) == &e || &e == e.cFFp(j)->cFFp(e.cFFi(j)) );
|
||||||
else
|
else
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Return a boolean that indicate if the j-th edge of the face is a border.
|
/** Return a boolean that indicate if the j-th edge of the face is a border.
|
||||||
@param j Index of the edge
|
@param j Index of the edge
|
||||||
@return true if j is an edge of border, false otherwise
|
@return true if j is an edge of border, false otherwise
|
||||||
*/
|
*/
|
||||||
template <class EdgeType>
|
template <class EdgeType>
|
||||||
inline bool IsEdgeBorder(EdgeType const & e, const int j )
|
inline bool IsEdgeBorder(EdgeType const & e, const int j )
|
||||||
|
@ -59,7 +59,6 @@ inline bool IsEdgeBorder(EdgeType const & e, const int j )
|
||||||
template <class EdgeType>
|
template <class EdgeType>
|
||||||
void VVStarVE(typename EdgeType::VertexType* vp, std::vector<typename EdgeType::VertexType *> &starVec)
|
void VVStarVE(typename EdgeType::VertexType* vp, std::vector<typename EdgeType::VertexType *> &starVec)
|
||||||
{
|
{
|
||||||
typedef typename EdgeType::VertexType* VertexPointer;
|
|
||||||
starVec.clear();
|
starVec.clear();
|
||||||
edge::VEIterator<EdgeType> vei(vp);
|
edge::VEIterator<EdgeType> vei(vp);
|
||||||
while(!vei.End())
|
while(!vei.End())
|
||||||
|
|
|
@ -555,7 +555,6 @@ bool CheckFlipEdgeNormal(FaceType &f, const int z, const float angleRad)
|
||||||
{
|
{
|
||||||
typedef typename FaceType::VertexType VertexType;
|
typedef typename FaceType::VertexType VertexType;
|
||||||
typedef typename VertexType::CoordType CoordType;
|
typedef typename VertexType::CoordType CoordType;
|
||||||
typedef typename VertexType::ScalarType ScalarType;
|
|
||||||
|
|
||||||
VertexType *OldDiag0 = f.V0(z);
|
VertexType *OldDiag0 = f.V0(z);
|
||||||
VertexType *OldDiag1 = f.V1(z);
|
VertexType *OldDiag1 = f.V1(z);
|
||||||
|
@ -817,7 +816,6 @@ void VFStarVF( typename FaceType::VertexType* vp,
|
||||||
std::vector<FaceType *> &faceVec,
|
std::vector<FaceType *> &faceVec,
|
||||||
std::vector<int> &indexes)
|
std::vector<int> &indexes)
|
||||||
{
|
{
|
||||||
typedef typename FaceType::VertexType* VertexPointer;
|
|
||||||
faceVec.clear();
|
faceVec.clear();
|
||||||
indexes.clear();
|
indexes.clear();
|
||||||
face::VFIterator<FaceType> vfi(vp);
|
face::VFIterator<FaceType> vfi(vp);
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
* \ *
|
* \ *
|
||||||
* All rights reserved. *
|
* All rights reserved. *
|
||||||
* *
|
* *
|
||||||
* This program is free software; you can redistribute it and/or modify *
|
* This program is free software; you can redistribute it and/or modify *
|
||||||
* it under the terms of the GNU General Public License as published by *
|
* it under the terms of the GNU General Public License as published by *
|
||||||
* the Free Software Foundation; either version 2 of the License, or *
|
* the Free Software Foundation; either version 2 of the License, or *
|
||||||
* (at your option) any later version. *
|
* (at your option) any later version. *
|
||||||
|
@ -91,219 +91,218 @@ First Version
|
||||||
|
|
||||||
namespace vcg{
|
namespace vcg{
|
||||||
|
|
||||||
template <class SPATIAL_INDEX, class OBJPOINTDISTFUNCTOR, class OBJMARKER>
|
template <class SPATIAL_INDEX, class OBJPOINTDISTFUNCTOR, class OBJMARKER>
|
||||||
typename SPATIAL_INDEX::ObjPtr GridClosest(SPATIAL_INDEX &Si,
|
typename SPATIAL_INDEX::ObjPtr GridClosest(SPATIAL_INDEX &Si,
|
||||||
OBJPOINTDISTFUNCTOR _getPointDistance,
|
OBJPOINTDISTFUNCTOR _getPointDistance,
|
||||||
OBJMARKER & _marker,
|
OBJMARKER & _marker,
|
||||||
const typename OBJPOINTDISTFUNCTOR::QueryType & _p_obj,
|
const typename OBJPOINTDISTFUNCTOR::QueryType & _p_obj,
|
||||||
const typename SPATIAL_INDEX::ScalarType & _maxDist,
|
const typename SPATIAL_INDEX::ScalarType & _maxDist,
|
||||||
typename SPATIAL_INDEX::ScalarType & _minDist,
|
typename SPATIAL_INDEX::ScalarType & _minDist,
|
||||||
typename SPATIAL_INDEX:: CoordType &_closestPt)
|
typename SPATIAL_INDEX:: CoordType &_closestPt)
|
||||||
{
|
{
|
||||||
typedef typename SPATIAL_INDEX::ObjPtr ObjPtr;
|
typedef typename SPATIAL_INDEX::ObjPtr ObjPtr;
|
||||||
typedef SPATIAL_INDEX SpatialIndex;
|
typedef typename SPATIAL_INDEX::CoordType CoordType;
|
||||||
typedef typename SPATIAL_INDEX::CoordType CoordType;
|
typedef typename SPATIAL_INDEX::ScalarType ScalarType;
|
||||||
typedef typename SPATIAL_INDEX::ScalarType ScalarType;
|
typedef typename SPATIAL_INDEX::Box3x Box3x;
|
||||||
typedef typename SPATIAL_INDEX::Box3x Box3x;
|
|
||||||
|
|
||||||
Point3<ScalarType> _p = OBJPOINTDISTFUNCTOR::Pos(_p_obj);
|
|
||||||
// Initialize min_dist with _maxDist to exploit early rejection test.
|
|
||||||
_minDist = _maxDist;
|
|
||||||
|
|
||||||
ObjPtr winner=NULL;
|
Point3<ScalarType> _p = OBJPOINTDISTFUNCTOR::Pos(_p_obj);
|
||||||
_marker.UnMarkAll();
|
// Initialize min_dist with _maxDist to exploit early rejection test.
|
||||||
ScalarType newradius = Si.voxel.Norm();
|
_minDist = _maxDist;
|
||||||
ScalarType radius;
|
|
||||||
Box3i iboxdone,iboxtodo;
|
|
||||||
CoordType t_res;
|
|
||||||
typename SPATIAL_INDEX::CellIterator first,last,l;
|
|
||||||
if(Si.bbox.IsInEx(_p))
|
|
||||||
{
|
|
||||||
Point3i _ip;
|
|
||||||
Si.PToIP(_p,_ip);
|
|
||||||
Si.Grid( _ip[0],_ip[1],_ip[2], first, last );
|
|
||||||
for(l=first;l!=last;++l)
|
|
||||||
{
|
|
||||||
ObjPtr elem=&(**l);
|
|
||||||
if (!elem->IsD())
|
|
||||||
{
|
|
||||||
if (_getPointDistance((**l), _p_obj,_minDist, t_res)) // <-- NEW: use of distance functor
|
|
||||||
{
|
|
||||||
winner=elem;
|
|
||||||
_closestPt=t_res;
|
|
||||||
newradius=_minDist; //
|
|
||||||
}
|
|
||||||
_marker.Mark(elem);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
iboxdone=Box3i(_ip,_ip);
|
|
||||||
}
|
|
||||||
|
|
||||||
int ix,iy,iz;
|
ObjPtr winner=NULL;
|
||||||
Box3i ibox(Point3i(0,0,0),Si.siz-Point3i(1,1,1));
|
_marker.UnMarkAll();
|
||||||
do
|
ScalarType newradius = Si.voxel.Norm();
|
||||||
{
|
ScalarType radius;
|
||||||
radius=newradius;
|
Box3i iboxdone,iboxtodo;
|
||||||
Box3x boxtodo=Box3x(_p,radius);
|
CoordType t_res;
|
||||||
//boxtodo.Intersect(Si.bbox);
|
typename SPATIAL_INDEX::CellIterator first,last,l;
|
||||||
Si.BoxToIBox(boxtodo, iboxtodo);
|
if(Si.bbox.IsInEx(_p))
|
||||||
iboxtodo.Intersect(ibox);
|
{
|
||||||
if(!boxtodo.IsNull())
|
Point3i _ip;
|
||||||
{
|
Si.PToIP(_p,_ip);
|
||||||
for (ix=iboxtodo.min[0]; ix<=iboxtodo.max[0]; ix++)
|
Si.Grid( _ip[0],_ip[1],_ip[2], first, last );
|
||||||
for (iy=iboxtodo.min[1]; iy<=iboxtodo.max[1]; iy++)
|
for(l=first;l!=last;++l)
|
||||||
for (iz=iboxtodo.min[2]; iz<=iboxtodo.max[2]; iz++)
|
{
|
||||||
if(ix<iboxdone.min[0] || ix>iboxdone.max[0] || // this test is to avoid to re-process already analyzed cells.
|
ObjPtr elem=&(**l);
|
||||||
iy<iboxdone.min[1] || iy>iboxdone.max[1] ||
|
if (!elem->IsD())
|
||||||
iz<iboxdone.min[2] || iz>iboxdone.max[2] )
|
{
|
||||||
{
|
if (_getPointDistance((**l), _p_obj,_minDist, t_res)) // <-- NEW: use of distance functor
|
||||||
Si.Grid( ix, iy, iz, first, last );
|
{
|
||||||
for(l=first;l!=last;++l) if (!(**l).IsD())
|
winner=elem;
|
||||||
{
|
_closestPt=t_res;
|
||||||
ObjPtr elem=&(**l);
|
newradius=_minDist; //
|
||||||
if (!elem->IsD())
|
}
|
||||||
{
|
_marker.Mark(elem);
|
||||||
if( ! _marker.IsMarked(elem))
|
}
|
||||||
{
|
}
|
||||||
if (_getPointDistance((**l), _p_obj, _minDist, t_res))
|
iboxdone=Box3i(_ip,_ip);
|
||||||
{
|
}
|
||||||
winner=elem;
|
|
||||||
_closestPt=t_res;
|
|
||||||
};
|
|
||||||
_marker.Mark(elem);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(!winner) newradius=radius+Si.voxel.Norm();
|
|
||||||
else newradius = _minDist;
|
|
||||||
iboxdone=iboxtodo;
|
|
||||||
}
|
|
||||||
while (_minDist>radius);
|
|
||||||
|
|
||||||
return winner;
|
int ix,iy,iz;
|
||||||
}
|
Box3i ibox(Point3i(0,0,0),Si.siz-Point3i(1,1,1));
|
||||||
|
do
|
||||||
|
{
|
||||||
|
radius=newradius;
|
||||||
|
Box3x boxtodo=Box3x(_p,radius);
|
||||||
|
//boxtodo.Intersect(Si.bbox);
|
||||||
|
Si.BoxToIBox(boxtodo, iboxtodo);
|
||||||
|
iboxtodo.Intersect(ibox);
|
||||||
|
if(!boxtodo.IsNull())
|
||||||
|
{
|
||||||
|
for (ix=iboxtodo.min[0]; ix<=iboxtodo.max[0]; ix++)
|
||||||
|
for (iy=iboxtodo.min[1]; iy<=iboxtodo.max[1]; iy++)
|
||||||
|
for (iz=iboxtodo.min[2]; iz<=iboxtodo.max[2]; iz++)
|
||||||
|
if(ix<iboxdone.min[0] || ix>iboxdone.max[0] || // this test is to avoid to re-process already analyzed cells.
|
||||||
|
iy<iboxdone.min[1] || iy>iboxdone.max[1] ||
|
||||||
|
iz<iboxdone.min[2] || iz>iboxdone.max[2] )
|
||||||
|
{
|
||||||
|
Si.Grid( ix, iy, iz, first, last );
|
||||||
|
for(l=first;l!=last;++l) if (!(**l).IsD())
|
||||||
|
{
|
||||||
|
ObjPtr elem=&(**l);
|
||||||
|
if (!elem->IsD())
|
||||||
|
{
|
||||||
|
if( ! _marker.IsMarked(elem))
|
||||||
|
{
|
||||||
|
if (_getPointDistance((**l), _p_obj, _minDist, t_res))
|
||||||
|
{
|
||||||
|
winner=elem;
|
||||||
|
_closestPt=t_res;
|
||||||
|
};
|
||||||
|
_marker.Mark(elem);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(!winner) newradius=radius+Si.voxel.Norm();
|
||||||
|
else newradius = _minDist;
|
||||||
|
iboxdone=iboxtodo;
|
||||||
|
}
|
||||||
|
while (_minDist>radius);
|
||||||
|
|
||||||
template <class SPATIALINDEXING,class OBJPOINTDISTFUNCTOR, class OBJMARKER,
|
return winner;
|
||||||
class OBJPTRCONTAINER, class DISTCONTAINER, class POINTCONTAINER>
|
}
|
||||||
unsigned int GridGetKClosest(SPATIALINDEXING &_Si,
|
|
||||||
OBJPOINTDISTFUNCTOR & _getPointDistance,
|
|
||||||
OBJMARKER & _marker,
|
|
||||||
const unsigned int _k,
|
|
||||||
const typename SPATIALINDEXING::CoordType & _p,
|
|
||||||
const typename SPATIALINDEXING::ScalarType & _maxDist,
|
|
||||||
OBJPTRCONTAINER & _objectPtrs,
|
|
||||||
DISTCONTAINER & _distances,
|
|
||||||
POINTCONTAINER & _points)
|
|
||||||
{
|
|
||||||
typedef vcg::ClosestIterator<SPATIALINDEXING,OBJPOINTDISTFUNCTOR,OBJMARKER> ClosestIteratorType;
|
|
||||||
ClosestIteratorType Cli=ClosestIteratorType(_Si,_getPointDistance);
|
|
||||||
Cli.SetMarker(_marker);
|
|
||||||
Cli.Init(_p,_maxDist);
|
|
||||||
unsigned int i=0;
|
|
||||||
_objectPtrs.clear();
|
|
||||||
_distances.clear();
|
|
||||||
_points.clear();
|
|
||||||
while ((!Cli.End())&&(i<_k))
|
|
||||||
{
|
|
||||||
_objectPtrs.push_back(&(*Cli));
|
|
||||||
_distances.push_back(Cli.Dist());
|
|
||||||
_points.push_back(Cli.NearestPoint());
|
|
||||||
++Cli;
|
|
||||||
i++;
|
|
||||||
}
|
|
||||||
return (i);
|
|
||||||
}
|
|
||||||
|
|
||||||
template <class SPATIALINDEXING,class OBJRAYISECTFUNCTOR, class OBJMARKER>
|
template <class SPATIALINDEXING,class OBJPOINTDISTFUNCTOR, class OBJMARKER,
|
||||||
typename SPATIALINDEXING::ObjPtr GridDoRay(SPATIALINDEXING &_Si,
|
class OBJPTRCONTAINER, class DISTCONTAINER, class POINTCONTAINER>
|
||||||
OBJRAYISECTFUNCTOR &_rayIntersector,
|
unsigned int GridGetKClosest(SPATIALINDEXING &_Si,
|
||||||
OBJMARKER &_marker,
|
OBJPOINTDISTFUNCTOR & _getPointDistance,
|
||||||
const Ray3<typename SPATIALINDEXING::ScalarType> & _ray,
|
OBJMARKER & _marker,
|
||||||
const typename SPATIALINDEXING::ScalarType & _maxDist,
|
const unsigned int _k,
|
||||||
typename SPATIALINDEXING::ScalarType & _t)
|
const typename SPATIALINDEXING::CoordType & _p,
|
||||||
{
|
const typename SPATIALINDEXING::ScalarType & _maxDist,
|
||||||
typedef vcg::RayIterator<SPATIALINDEXING,OBJRAYISECTFUNCTOR,OBJMARKER> RayIteratorType;
|
OBJPTRCONTAINER & _objectPtrs,
|
||||||
RayIteratorType RayIte=RayIteratorType(_Si,_rayIntersector,_maxDist);
|
DISTCONTAINER & _distances,
|
||||||
RayIte.SetMarker(_marker);
|
POINTCONTAINER & _points)
|
||||||
RayIte.Init(_ray);
|
{
|
||||||
|
typedef vcg::ClosestIterator<SPATIALINDEXING,OBJPOINTDISTFUNCTOR,OBJMARKER> ClosestIteratorType;
|
||||||
|
ClosestIteratorType Cli=ClosestIteratorType(_Si,_getPointDistance);
|
||||||
|
Cli.SetMarker(_marker);
|
||||||
|
Cli.Init(_p,_maxDist);
|
||||||
|
unsigned int i=0;
|
||||||
|
_objectPtrs.clear();
|
||||||
|
_distances.clear();
|
||||||
|
_points.clear();
|
||||||
|
while ((!Cli.End())&&(i<_k))
|
||||||
|
{
|
||||||
|
_objectPtrs.push_back(&(*Cli));
|
||||||
|
_distances.push_back(Cli.Dist());
|
||||||
|
_points.push_back(Cli.NearestPoint());
|
||||||
|
++Cli;
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
return (i);
|
||||||
|
}
|
||||||
|
|
||||||
if (!RayIte.End())
|
template <class SPATIALINDEXING,class OBJRAYISECTFUNCTOR, class OBJMARKER>
|
||||||
{
|
typename SPATIALINDEXING::ObjPtr GridDoRay(SPATIALINDEXING &_Si,
|
||||||
_t=RayIte.Dist();
|
OBJRAYISECTFUNCTOR &_rayIntersector,
|
||||||
return(&(*RayIte));
|
OBJMARKER &_marker,
|
||||||
}
|
const Ray3<typename SPATIALINDEXING::ScalarType> & _ray,
|
||||||
return 0;
|
const typename SPATIALINDEXING::ScalarType & _maxDist,
|
||||||
}
|
typename SPATIALINDEXING::ScalarType & _t)
|
||||||
|
{
|
||||||
|
typedef vcg::RayIterator<SPATIALINDEXING,OBJRAYISECTFUNCTOR,OBJMARKER> RayIteratorType;
|
||||||
|
RayIteratorType RayIte=RayIteratorType(_Si,_rayIntersector,_maxDist);
|
||||||
|
RayIte.SetMarker(_marker);
|
||||||
|
RayIte.Init(_ray);
|
||||||
|
|
||||||
|
if (!RayIte.End())
|
||||||
template <class SPATIALINDEXING, class OBJPOINTDISTFUNCTOR, class OBJMARKER, class OBJPTRCONTAINER, class DISTCONTAINER, class POINTCONTAINER>
|
{
|
||||||
unsigned int GridGetInSphere(SPATIALINDEXING &_Si,
|
_t=RayIte.Dist();
|
||||||
OBJPOINTDISTFUNCTOR & _getPointDistance,
|
return(&(*RayIte));
|
||||||
OBJMARKER & _marker,
|
}
|
||||||
const typename SPATIALINDEXING::CoordType & _p,
|
return 0;
|
||||||
const typename SPATIALINDEXING::ScalarType & _r,
|
}
|
||||||
OBJPTRCONTAINER & _objectPtrs,
|
|
||||||
DISTCONTAINER & _distances,
|
|
||||||
POINTCONTAINER & _points)
|
|
||||||
{
|
|
||||||
typedef vcg::ClosestIterator<SPATIALINDEXING,OBJPOINTDISTFUNCTOR,OBJMARKER> ClosestIteratorType;
|
|
||||||
ClosestIteratorType Cli=ClosestIteratorType(_Si,_getPointDistance);
|
|
||||||
Cli.SetMarker(_marker);
|
|
||||||
Cli.Init(_p,_r);
|
|
||||||
_objectPtrs.clear();
|
|
||||||
_distances.clear();
|
|
||||||
_points.clear();
|
|
||||||
while (!Cli.End())
|
|
||||||
{
|
|
||||||
_objectPtrs.push_back(&(*Cli));
|
|
||||||
_distances.push_back(Cli.Dist());
|
|
||||||
_points.push_back(Cli.NearestPoint());
|
|
||||||
++Cli;
|
|
||||||
}
|
|
||||||
return ((int)_objectPtrs.size());
|
|
||||||
}
|
|
||||||
|
|
||||||
template <class SPATIALINDEXING,class OBJMARKER, class OBJPTRCONTAINER>
|
|
||||||
unsigned int GridGetInBox(SPATIALINDEXING &_Si,
|
|
||||||
OBJMARKER & _marker,
|
|
||||||
const vcg::Box3<typename SPATIALINDEXING::ScalarType> &_bbox,
|
|
||||||
OBJPTRCONTAINER & _objectPtrs)
|
|
||||||
{
|
|
||||||
typename SPATIALINDEXING::CellIterator first,last,l;
|
|
||||||
_objectPtrs.clear();
|
|
||||||
vcg::Box3i ibbox;
|
|
||||||
Box3i Si_ibox(Point3i(0,0,0),_Si.siz-Point3i(1,1,1));
|
|
||||||
_Si.BoxToIBox(_bbox, ibbox);
|
|
||||||
ibbox.Intersect(Si_ibox);
|
|
||||||
_marker.UnMarkAll();
|
|
||||||
if (ibbox.IsNull())
|
|
||||||
return 0;
|
|
||||||
else
|
|
||||||
{
|
|
||||||
int ix,iy,iz;
|
|
||||||
for (ix=ibbox.min[0]; ix<=ibbox.max[0]; ix++)
|
|
||||||
for (iy=ibbox.min[1]; iy<=ibbox.max[1]; iy++)
|
|
||||||
for (iz=ibbox.min[2]; iz<=ibbox.max[2]; iz++)
|
|
||||||
{
|
|
||||||
_Si.Grid( ix, iy, iz, first, last );
|
|
||||||
for(l=first;l!=last;++l)
|
|
||||||
if (!(**l).IsD())
|
|
||||||
{
|
|
||||||
typename SPATIALINDEXING::ObjPtr elem=&(**l);
|
|
||||||
vcg::Box3<typename SPATIALINDEXING::ScalarType> box_elem;
|
|
||||||
elem->GetBBox(box_elem);
|
|
||||||
if(( ! _marker.IsMarked(elem))&&(box_elem.Collide(_bbox))){
|
|
||||||
_objectPtrs.push_back(elem);
|
|
||||||
_marker.Mark(elem);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return (static_cast<unsigned int>(_objectPtrs.size()));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}//end namespace vcg
|
template <class SPATIALINDEXING, class OBJPOINTDISTFUNCTOR, class OBJMARKER, class OBJPTRCONTAINER, class DISTCONTAINER, class POINTCONTAINER>
|
||||||
|
unsigned int GridGetInSphere(SPATIALINDEXING &_Si,
|
||||||
|
OBJPOINTDISTFUNCTOR & _getPointDistance,
|
||||||
|
OBJMARKER & _marker,
|
||||||
|
const typename SPATIALINDEXING::CoordType & _p,
|
||||||
|
const typename SPATIALINDEXING::ScalarType & _r,
|
||||||
|
OBJPTRCONTAINER & _objectPtrs,
|
||||||
|
DISTCONTAINER & _distances,
|
||||||
|
POINTCONTAINER & _points)
|
||||||
|
{
|
||||||
|
typedef vcg::ClosestIterator<SPATIALINDEXING,OBJPOINTDISTFUNCTOR,OBJMARKER> ClosestIteratorType;
|
||||||
|
ClosestIteratorType Cli=ClosestIteratorType(_Si,_getPointDistance);
|
||||||
|
Cli.SetMarker(_marker);
|
||||||
|
Cli.Init(_p,_r);
|
||||||
|
_objectPtrs.clear();
|
||||||
|
_distances.clear();
|
||||||
|
_points.clear();
|
||||||
|
while (!Cli.End())
|
||||||
|
{
|
||||||
|
_objectPtrs.push_back(&(*Cli));
|
||||||
|
_distances.push_back(Cli.Dist());
|
||||||
|
_points.push_back(Cli.NearestPoint());
|
||||||
|
++Cli;
|
||||||
|
}
|
||||||
|
return ((int)_objectPtrs.size());
|
||||||
|
}
|
||||||
|
|
||||||
|
template <class SPATIALINDEXING,class OBJMARKER, class OBJPTRCONTAINER>
|
||||||
|
unsigned int GridGetInBox(SPATIALINDEXING &_Si,
|
||||||
|
OBJMARKER & _marker,
|
||||||
|
const vcg::Box3<typename SPATIALINDEXING::ScalarType> &_bbox,
|
||||||
|
OBJPTRCONTAINER & _objectPtrs)
|
||||||
|
{
|
||||||
|
typename SPATIALINDEXING::CellIterator first,last,l;
|
||||||
|
_objectPtrs.clear();
|
||||||
|
vcg::Box3i ibbox;
|
||||||
|
Box3i Si_ibox(Point3i(0,0,0),_Si.siz-Point3i(1,1,1));
|
||||||
|
_Si.BoxToIBox(_bbox, ibbox);
|
||||||
|
ibbox.Intersect(Si_ibox);
|
||||||
|
_marker.UnMarkAll();
|
||||||
|
if (ibbox.IsNull())
|
||||||
|
return 0;
|
||||||
|
else
|
||||||
|
{
|
||||||
|
int ix,iy,iz;
|
||||||
|
for (ix=ibbox.min[0]; ix<=ibbox.max[0]; ix++)
|
||||||
|
for (iy=ibbox.min[1]; iy<=ibbox.max[1]; iy++)
|
||||||
|
for (iz=ibbox.min[2]; iz<=ibbox.max[2]; iz++)
|
||||||
|
{
|
||||||
|
_Si.Grid( ix, iy, iz, first, last );
|
||||||
|
for(l=first;l!=last;++l)
|
||||||
|
if (!(**l).IsD())
|
||||||
|
{
|
||||||
|
typename SPATIALINDEXING::ObjPtr elem=&(**l);
|
||||||
|
vcg::Box3<typename SPATIALINDEXING::ScalarType> box_elem;
|
||||||
|
elem->GetBBox(box_elem);
|
||||||
|
if(( ! _marker.IsMarked(elem))&&(box_elem.Collide(_bbox))){
|
||||||
|
_objectPtrs.push_back(elem);
|
||||||
|
_marker.Mark(elem);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return (static_cast<unsigned int>(_objectPtrs.size()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}//end namespace vcg
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -141,7 +141,6 @@ namespace vcg {
|
||||||
{
|
{
|
||||||
typedef SCALAR_TYPE ScalarType;
|
typedef SCALAR_TYPE ScalarType;
|
||||||
typedef typename vcg::Point3< ScalarType > Point3t;
|
typedef typename vcg::Point3< ScalarType > Point3t;
|
||||||
typedef TRIANGLETYPE Triangle3t;
|
|
||||||
|
|
||||||
bool penetration_detected = false;
|
bool penetration_detected = false;
|
||||||
|
|
||||||
|
|
|
@ -100,10 +100,6 @@ template<class PolygonType>
|
||||||
void PolyNormals(const PolygonType &F,
|
void PolyNormals(const PolygonType &F,
|
||||||
std::vector<typename PolygonType::CoordType> &Norms)
|
std::vector<typename PolygonType::CoordType> &Norms)
|
||||||
{
|
{
|
||||||
typedef typename PolygonType::FaceType FaceType;
|
|
||||||
typedef typename PolygonType::CoordType CoordType;
|
|
||||||
typedef typename PolygonType::ScalarType ScalarType;
|
|
||||||
|
|
||||||
Norms.clear();
|
Norms.clear();
|
||||||
if (F.VN()<=2) return;
|
if (F.VN()<=2) return;
|
||||||
for (int i=0;i<F.VN();i++)
|
for (int i=0;i<F.VN();i++)
|
||||||
|
@ -126,7 +122,6 @@ typename PolygonType::CoordType PolyBarycenter(const PolygonType &F)
|
||||||
template<class PolygonType>
|
template<class PolygonType>
|
||||||
typename PolygonType::ScalarType PolyArea(const PolygonType &F)
|
typename PolygonType::ScalarType PolyArea(const PolygonType &F)
|
||||||
{
|
{
|
||||||
typedef typename PolygonType::FaceType FaceType;
|
|
||||||
typedef typename PolygonType::CoordType CoordType;
|
typedef typename PolygonType::CoordType CoordType;
|
||||||
typedef typename PolygonType::ScalarType ScalarType;
|
typedef typename PolygonType::ScalarType ScalarType;
|
||||||
|
|
||||||
|
@ -159,8 +154,6 @@ typename PolygonType::CoordType PolygonNormal(const PolygonType &F)
|
||||||
template<class PolygonType>
|
template<class PolygonType>
|
||||||
typename PolygonType::ScalarType PolyPerimeter(const PolygonType &F)
|
typename PolygonType::ScalarType PolyPerimeter(const PolygonType &F)
|
||||||
{
|
{
|
||||||
typedef typename PolygonType::FaceType FaceType;
|
|
||||||
typedef typename PolygonType::CoordType CoordType;
|
|
||||||
typedef typename PolygonType::ScalarType ScalarType;
|
typedef typename PolygonType::ScalarType ScalarType;
|
||||||
|
|
||||||
ScalarType SumL=0;
|
ScalarType SumL=0;
|
||||||
|
@ -177,11 +170,10 @@ typename PolygonType::ScalarType PolyPerimeter(const PolygonType &F)
|
||||||
template<class PolygonType>
|
template<class PolygonType>
|
||||||
typename PolygonType::ScalarType PolyNormDeviation(const PolygonType &F)
|
typename PolygonType::ScalarType PolyNormDeviation(const PolygonType &F)
|
||||||
{
|
{
|
||||||
typedef typename PolygonType::FaceType FaceType;
|
|
||||||
typedef typename PolygonType::CoordType CoordType;
|
typedef typename PolygonType::CoordType CoordType;
|
||||||
typedef typename PolygonType::ScalarType ScalarType;
|
typedef typename PolygonType::ScalarType ScalarType;
|
||||||
|
|
||||||
std::vector<typename PolygonType::CoordType> Norms;
|
std::vector<CoordType> Norms;
|
||||||
PolyNormals(F,Norms);
|
PolyNormals(F,Norms);
|
||||||
|
|
||||||
//calculate the Avg Normal
|
//calculate the Avg Normal
|
||||||
|
@ -209,7 +201,6 @@ void PolyAngleDeviation(const PolygonType &F,
|
||||||
typename PolygonType::ScalarType &AvgDev,
|
typename PolygonType::ScalarType &AvgDev,
|
||||||
typename PolygonType::ScalarType &MaxDev)
|
typename PolygonType::ScalarType &MaxDev)
|
||||||
{
|
{
|
||||||
typedef typename PolygonType::FaceType FaceType;
|
|
||||||
typedef typename PolygonType::CoordType CoordType;
|
typedef typename PolygonType::CoordType CoordType;
|
||||||
typedef typename PolygonType::ScalarType ScalarType;
|
typedef typename PolygonType::ScalarType ScalarType;
|
||||||
assert(F.VN()>2);
|
assert(F.VN()>2);
|
||||||
|
@ -246,7 +237,6 @@ void PolyAngleDeviation(const PolygonType &F,
|
||||||
template<class PolygonType>
|
template<class PolygonType>
|
||||||
vcg::Plane3<typename PolygonType::ScalarType> PolyFittingPlane(const PolygonType &F)
|
vcg::Plane3<typename PolygonType::ScalarType> PolyFittingPlane(const PolygonType &F)
|
||||||
{
|
{
|
||||||
typedef typename PolygonType::FaceType FaceType;
|
|
||||||
typedef typename PolygonType::CoordType CoordType;
|
typedef typename PolygonType::CoordType CoordType;
|
||||||
typedef typename PolygonType::ScalarType ScalarType;
|
typedef typename PolygonType::ScalarType ScalarType;
|
||||||
vcg::Plane3<ScalarType> BestPL;
|
vcg::Plane3<ScalarType> BestPL;
|
||||||
|
@ -263,7 +253,6 @@ vcg::Plane3<typename PolygonType::ScalarType> PolyFittingPlane(const PolygonType
|
||||||
template<class PolygonType>
|
template<class PolygonType>
|
||||||
typename PolygonType::ScalarType PolyFlatness(const PolygonType &F)
|
typename PolygonType::ScalarType PolyFlatness(const PolygonType &F)
|
||||||
{
|
{
|
||||||
typedef typename PolygonType::FaceType FaceType;
|
|
||||||
typedef typename PolygonType::CoordType CoordType;
|
typedef typename PolygonType::CoordType CoordType;
|
||||||
typedef typename PolygonType::ScalarType ScalarType;
|
typedef typename PolygonType::ScalarType ScalarType;
|
||||||
|
|
||||||
|
@ -293,7 +282,6 @@ template<class PolygonType>
|
||||||
void PolyPCA(const PolygonType &F,
|
void PolyPCA(const PolygonType &F,
|
||||||
typename PolygonType::CoordType PCA[])
|
typename PolygonType::CoordType PCA[])
|
||||||
{
|
{
|
||||||
typedef typename PolygonType::FaceType FaceType;
|
|
||||||
typedef typename PolygonType::CoordType CoordType;
|
typedef typename PolygonType::CoordType CoordType;
|
||||||
typedef typename PolygonType::ScalarType ScalarType;
|
typedef typename PolygonType::ScalarType ScalarType;
|
||||||
|
|
||||||
|
@ -361,7 +349,6 @@ template<class PolygonType>
|
||||||
void PolyScaledPCA(const PolygonType &F,
|
void PolyScaledPCA(const PolygonType &F,
|
||||||
typename PolygonType::CoordType PCA[])
|
typename PolygonType::CoordType PCA[])
|
||||||
{
|
{
|
||||||
typedef typename PolygonType::FaceType FaceType;
|
|
||||||
typedef typename PolygonType::CoordType CoordType;
|
typedef typename PolygonType::CoordType CoordType;
|
||||||
typedef typename PolygonType::ScalarType ScalarType;
|
typedef typename PolygonType::ScalarType ScalarType;
|
||||||
|
|
||||||
|
@ -415,7 +402,6 @@ void GetPolyTemplatePos(const PolygonType &F,
|
||||||
std::vector<typename PolygonType::CoordType> &TemplatePos,
|
std::vector<typename PolygonType::CoordType> &TemplatePos,
|
||||||
bool force_isotropy=false)
|
bool force_isotropy=false)
|
||||||
{
|
{
|
||||||
typedef typename PolygonType::FaceType FaceType;
|
|
||||||
typedef typename PolygonType::CoordType CoordType;
|
typedef typename PolygonType::CoordType CoordType;
|
||||||
typedef typename PolygonType::ScalarType ScalarType;
|
typedef typename PolygonType::ScalarType ScalarType;
|
||||||
std::vector<CoordType> UniformPos,UniformTempl;
|
std::vector<CoordType> UniformPos,UniformTempl;
|
||||||
|
@ -528,7 +514,6 @@ template<class PolygonType>
|
||||||
typename PolygonType::ScalarType PolyAspectRatio(const PolygonType &F,
|
typename PolygonType::ScalarType PolyAspectRatio(const PolygonType &F,
|
||||||
bool isotropic=false)
|
bool isotropic=false)
|
||||||
{
|
{
|
||||||
typedef typename PolygonType::FaceType FaceType;
|
|
||||||
typedef typename PolygonType::CoordType CoordType;
|
typedef typename PolygonType::CoordType CoordType;
|
||||||
typedef typename PolygonType::ScalarType ScalarType;
|
typedef typename PolygonType::ScalarType ScalarType;
|
||||||
std::vector<CoordType> TemplatePos;
|
std::vector<CoordType> TemplatePos;
|
||||||
|
|
Loading…
Reference in New Issue