Necessary changes for compilation with gcc 3.4.6. Especially the hash function is a problem
This commit is contained in:
parent
06047a697d
commit
e2733d55df
|
|
@ -24,6 +24,9 @@
|
||||||
History
|
History
|
||||||
|
|
||||||
$Log: not supported by cvs2svn $
|
$Log: not supported by cvs2svn $
|
||||||
|
Revision 1.13 2006/11/07 11:47:11 cignoni
|
||||||
|
gcc compiling issues
|
||||||
|
|
||||||
Revision 1.12 2006/11/07 07:56:43 cignoni
|
Revision 1.12 2006/11/07 07:56:43 cignoni
|
||||||
Added missing std::
|
Added missing std::
|
||||||
|
|
||||||
|
|
@ -150,7 +153,7 @@ namespace vcg {
|
||||||
|
|
||||||
void Refresh(MESH &m)
|
void Refresh(MESH &m)
|
||||||
{
|
{
|
||||||
p.f = (MESH::FacePointer)(faceindex + &(*(m.face.begin())));
|
p.f = (typename MESH::FacePointer)(faceindex + &(*(m.face.begin())));
|
||||||
}
|
}
|
||||||
|
|
||||||
bool operator < (const HoleInfo & hh) const {return size < hh.size;}
|
bool operator < (const HoleInfo & hh) const {return size < hh.size;}
|
||||||
|
|
@ -1136,6 +1139,9 @@ namespace vcg {
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
using TrivialEar<MSH_TYPE>::e0;
|
||||||
|
using TrivialEar<MSH_TYPE>::e1;
|
||||||
|
using TrivialEar<MSH_TYPE>::quality;
|
||||||
TrivialEarN(){}
|
TrivialEarN(){}
|
||||||
TrivialEarN(const face::Pos<typename MSH_TYPE::FaceType> & ep)
|
TrivialEarN(const face::Pos<typename MSH_TYPE::FaceType> & ep)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -23,6 +23,9 @@
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
History
|
History
|
||||||
$Log: not supported by cvs2svn $
|
$Log: not supported by cvs2svn $
|
||||||
|
Revision 1.12 2006/11/07 11:28:02 cignoni
|
||||||
|
Added Quality weighted laplacian smoothing
|
||||||
|
|
||||||
Revision 1.11 2006/10/19 07:33:03 cignoni
|
Revision 1.11 2006/10/19 07:33:03 cignoni
|
||||||
Corrected Laplacian, Added selection to HCSmooth
|
Corrected Laplacian, Added selection to HCSmooth
|
||||||
|
|
||||||
|
|
@ -677,7 +680,7 @@ void NormalSmooth(MESH_TYPE &m,
|
||||||
|
|
||||||
for(fi=m.face.begin();fi!=m.face.end();++fi)
|
for(fi=m.face.begin();fi!=m.face.end();++fi)
|
||||||
{
|
{
|
||||||
CoordType bc=Barycenter<MESH_TYPE::FaceType>(*fi);
|
CoordType bc=Barycenter<typename MESH_TYPE::FaceType>(*fi);
|
||||||
// 1) Clear all the selected flag of faces that are vertex-adjacent to fi
|
// 1) Clear all the selected flag of faces that are vertex-adjacent to fi
|
||||||
for(i=0;i<3;++i)
|
for(i=0;i<3;++i)
|
||||||
{
|
{
|
||||||
|
|
@ -824,7 +827,7 @@ void FastFitMesh(MESH_TYPE &m,
|
||||||
VFLocalIterator ep(&*vi);
|
VFLocalIterator ep(&*vi);
|
||||||
for (;!ep.End();++ep)
|
for (;!ep.End();++ep)
|
||||||
{
|
{
|
||||||
CoordType bc=Barycenter<MESH_TYPE::FaceType>(*ep.F());
|
CoordType bc=Barycenter<typename MESH_TYPE::FaceType>(*ep.F());
|
||||||
Sum += ep.F()->N()*(ep.F()->N()*(bc - (*vi).P()));
|
Sum += ep.F()->N()*(ep.F()->N()*(bc - (*vi).P()));
|
||||||
++cnt;
|
++cnt;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -24,6 +24,10 @@
|
||||||
History
|
History
|
||||||
|
|
||||||
$Log: not supported by cvs2svn $
|
$Log: not supported by cvs2svn $
|
||||||
|
Revision 1.11 2005/12/06 18:22:31 pietroni
|
||||||
|
changed FaceType::ComputeNormal and FaceType::ComputeNormalizedNormal
|
||||||
|
with face::ComputeNormal and face::ComputeNormalizedNormal
|
||||||
|
|
||||||
Revision 1.10 2005/12/06 15:30:45 ponchio
|
Revision 1.10 2005/12/06 15:30:45 ponchio
|
||||||
added #include triangle3.h for Normal(...)
|
added #include triangle3.h for Normal(...)
|
||||||
|
|
||||||
|
|
@ -98,7 +102,7 @@ static void PerFace(ComputeMeshType &m)
|
||||||
if( !m.HasPerFaceNormal()) return;
|
if( !m.HasPerFaceNormal()) return;
|
||||||
FaceIterator f;
|
FaceIterator f;
|
||||||
for(f=m.face.begin();f!=m.face.end();++f)
|
for(f=m.face.begin();f!=m.face.end();++f)
|
||||||
if( !(*f).IsD() ) face::ComputeNormal(*f);
|
if( !(*f).IsD() ) /*face::*/ComputeNormal(*f);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -40,6 +40,16 @@
|
||||||
#include <ext/hash_map>
|
#include <ext/hash_map>
|
||||||
#include <ext/hash_set>
|
#include <ext/hash_set>
|
||||||
#define STDEXT __gnu_cxx
|
#define STDEXT __gnu_cxx
|
||||||
|
// It's terrible but gnu's hash_map needs an instantiation of hash() for
|
||||||
|
// every key type! So we cast the pointer to void*
|
||||||
|
namespace __gnu_cxx
|
||||||
|
{
|
||||||
|
template <> class hash<void *>: private hash<unsigned long>
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
size_t operator()(const void *ptr) const { return hash<unsigned long>::operator()((unsigned long)ptr); }
|
||||||
|
};
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
@ -68,7 +78,11 @@ namespace vcg
|
||||||
|
|
||||||
typedef OBJECT_TYPE* ObjectPointer;
|
typedef OBJECT_TYPE* ObjectPointer;
|
||||||
typedef std::pair< ObjectPointer, int > hPair;
|
typedef std::pair< ObjectPointer, int > hPair;
|
||||||
|
#ifdef __GNUC__
|
||||||
|
typedef typename STDEXT::hash_map< /*ObjectPointer*/void*, int >::iterator hIterator;
|
||||||
|
#else
|
||||||
typedef typename STDEXT::hash_map< ObjectPointer, int >::iterator hIterator;
|
typedef typename STDEXT::hash_map< ObjectPointer, int >::iterator hIterator;
|
||||||
|
#endif
|
||||||
typedef std::pair< hIterator, bool > hInsertResult;
|
typedef std::pair< hIterator, bool > hInsertResult;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
@ -132,7 +146,11 @@ namespace vcg
|
||||||
}
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
#ifdef __GNUC__
|
||||||
|
STDEXT::hash_map< void*, int > inserted_objects;
|
||||||
|
#else
|
||||||
STDEXT::hash_map< OBJECT_TYPE*, int > inserted_objects;
|
STDEXT::hash_map< OBJECT_TYPE*, int > inserted_objects;
|
||||||
|
#endif
|
||||||
std::vector< DisjointSetNode > nodes;
|
std::vector< DisjointSetNode > nodes;
|
||||||
};
|
};
|
||||||
};// end of namespace vcg
|
};// end of namespace vcg
|
||||||
|
|
|
||||||
|
|
@ -24,6 +24,9 @@
|
||||||
History
|
History
|
||||||
|
|
||||||
$Log: not supported by cvs2svn $
|
$Log: not supported by cvs2svn $
|
||||||
|
Revision 1.5 2006/11/07 11:29:24 cignoni
|
||||||
|
Corrected some errors in the reflections Has*** functions
|
||||||
|
|
||||||
Revision 1.4 2006/10/31 16:02:59 ganovelli
|
Revision 1.4 2006/10/31 16:02:59 ganovelli
|
||||||
vesione 2005 compliant
|
vesione 2005 compliant
|
||||||
|
|
||||||
|
|
@ -278,7 +281,7 @@ namespace tri
|
||||||
bool HasPerVertexQuality (const TriMesh < vert::vector_ocf< VertType > , FaceContainerType > & m)
|
bool HasPerVertexQuality (const TriMesh < vert::vector_ocf< VertType > , FaceContainerType > & m)
|
||||||
{
|
{
|
||||||
if(VertType::HasQualityOcf()) return m.vert.IsQualityEnabled();
|
if(VertType::HasQualityOcf()) return m.vert.IsQualityEnabled();
|
||||||
else return VertexType::HasQuality();
|
else return VertType::HasQuality();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -236,18 +236,18 @@ namespace vcg
|
||||||
E.push_back(MSTEdge(&tangent_planes[i], iRiemannianEdge->plane, iRiemannianEdge->weight));
|
E.push_back(MSTEdge(&tangent_planes[i], iRiemannianEdge->plane, iRiemannianEdge->weight));
|
||||||
|
|
||||||
std::sort( E.begin(), E.end() );
|
std::sort( E.begin(), E.end() );
|
||||||
vcg::DisjointSet<Plane> set;
|
vcg::DisjointSet<Plane> planeset;
|
||||||
|
|
||||||
for (typename std::vector< Plane >::iterator iPlane=tangent_planes.begin(); iPlane!=ePlane; iPlane++)
|
for (typename std::vector< Plane >::iterator iPlane=tangent_planes.begin(); iPlane!=ePlane; iPlane++)
|
||||||
set.MakeSet( &*iPlane );
|
planeset.MakeSet( &*iPlane );
|
||||||
|
|
||||||
typename std::vector< MSTEdge >::iterator iMSTEdge = E.begin();
|
typename std::vector< MSTEdge >::iterator iMSTEdge = E.begin();
|
||||||
typename std::vector< MSTEdge >::iterator eMSTEdge = E.end();
|
typename std::vector< MSTEdge >::iterator eMSTEdge = E.end();
|
||||||
std::vector< MSTEdge > unoriented_tree;
|
std::vector< MSTEdge > unoriented_tree;
|
||||||
Plane *u, *v;
|
Plane *u, *v;
|
||||||
for ( ; iMSTEdge!=eMSTEdge; iMSTEdge++)
|
for ( ; iMSTEdge!=eMSTEdge; iMSTEdge++)
|
||||||
if ((u=set.FindSet(iMSTEdge->u))!=(v=set.FindSet(iMSTEdge->v)))
|
if ((u=planeset.FindSet(iMSTEdge->u))!=(v=planeset.FindSet(iMSTEdge->v)))
|
||||||
unoriented_tree.push_back( *iMSTEdge ), set.Union(u, v);
|
unoriented_tree.push_back( *iMSTEdge ), planeset.Union(u, v);
|
||||||
E.clear();
|
E.clear();
|
||||||
|
|
||||||
// compute for each plane the list of sorting edges
|
// compute for each plane the list of sorting edges
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue