diff --git a/vcg/complex/algorithms/geodesic.h b/vcg/complex/algorithms/geodesic.h index f0cb512d..40436918 100644 --- a/vcg/complex/algorithms/geodesic.h +++ b/vcg/complex/algorithms/geodesic.h @@ -207,12 +207,19 @@ public: typedef SimpleTempData, TempData > TempDataType; - struct pred: public std::binary_function{ - pred(){} - bool operator()(const VertDist& v0, const VertDist& v1) const - {return (v0.d > v1.d);} + class pred { + public: + pred () {}; + bool operator()(const VertDist& v0, const VertDist& v1) const + {return (v0.d > v1.d);} }; + //struct pred: public std::binary_function{ + // pred(){} + // bool operator()(const VertDist& v0, const VertDist& v1) const + // {return (v0.d > v1.d);} + //}; + /* * curr: vertex for which distance should be estimated diff --git a/vcg/complex/algorithms/stat.h b/vcg/complex/algorithms/stat.h index c9b0e7cb..14a6d8fd 100644 --- a/vcg/complex/algorithms/stat.h +++ b/vcg/complex/algorithms/stat.h @@ -250,7 +250,7 @@ public: return V; } - static ScalarType ComputeMeshVolume(const MeshType & m) + static ScalarType ComputeMeshVolume(MeshType & m) { Inertia I(m); return I.Mass(); diff --git a/vcg/complex/allocate.h b/vcg/complex/allocate.h index ee96b2c9..72b9255e 100644 --- a/vcg/complex/allocate.h +++ b/vcg/complex/allocate.h @@ -2049,7 +2049,7 @@ public: } template - static typename MeshType::template ConstPerTetraAttributeHandle FindPerTetraAttribute(MeshType &m, const std::string &name) + static typename MeshType::template ConstPerTetraAttributeHandle FindPerTetraAttribute(const MeshType &m, const std::string &name) { if(!name.empty()){ PointerToAttribute h1; diff --git a/vcg/simplex/tetrahedron/component.h b/vcg/simplex/tetrahedron/component.h index cb1a6e87..9ba9d0ed 100644 --- a/vcg/simplex/tetrahedron/component.h +++ b/vcg/simplex/tetrahedron/component.h @@ -48,7 +48,7 @@ template class EmptyCore : public T { public: //Empty vertexref inline typename T::VertexType * & V( const int ) { assert(0); static typename T::VertexType *vp=0; return vp; } - inline typename T::VertexType * const & V( const int ) const { assert(0); static typename T::VertexType *vp=0; return vp; } + inline const typename T::VertexType * V( const int ) const { assert(0); static typename T::VertexType *vp=0; return vp; } inline const typename T::VertexType * cV( const int ) const { assert(0); static typename T::VertexType *vp=0; return vp; } inline typename T::CoordType & P( const int ) { assert(0); static typename T::CoordType coord(0, 0, 0); return coord; } inline const typename T::CoordType & P( const int ) const { assert(0); static typename T::CoordType coord(0, 0, 0); return coord; } @@ -181,7 +181,8 @@ public: typedef typename T::VertexType::ScalarType ScalarType; inline typename T::VertexType * & V( const int j ) { assert(j>=0 && j<4); return v[j]; } - inline const typename T::VertexType * cV( const int j ) { assert(j>=0 && j<4); return v[j]; } + inline const typename T::VertexType * V( const int j ) const { assert(j>=0 && j<4); return v[j]; } + inline const typename T::VertexType * cV( const int j ) const { assert(j>=0 && j<4); return v[j]; } inline size_t cFtoVi (const int f, const int j) const { assert(f >= 0 && f < 4); assert(j >= 0 && j < 3); return findices[f][j]; } @@ -457,7 +458,8 @@ public: typename T::TetraPointer const cVTp( const int j ) const { assert( j >= 0 && j < 4 ); return _vtp[j]; } char & VTi( const int j ) { return _vti[j]; } - const char & cVTi( const int j ) const { return _vti[j]; } + char VTi( const int j ) const { return _vti[j]; } + char cVTi( const int j ) const { return _vti[j]; } static bool HasVTAdjacency() { return true; } static bool HasVTAdjacencyOcc() { return false; } diff --git a/vcg/simplex/vertex/component.h b/vcg/simplex/vertex/component.h index 37f27f93..251e3786 100644 --- a/vcg/simplex/vertex/component.h +++ b/vcg/simplex/vertex/component.h @@ -572,6 +572,7 @@ public: typename T::TetraPointer &VTp() { return _tp; } typename T::TetraPointer cVTp() const { return _tp; } int &VTi() {return _zp; } + int VTi() const { return _zp; } int cVTi() const { return _zp; } static bool HasVTAdjacency() { return true; } static void Name( std::vector< std::string > & name ) { name.push_back( std::string("VTAdj") ); T::Name(name); } diff --git a/wrap/io_tetramesh/import_ply.h b/wrap/io_tetramesh/import_ply.h index e77b4741..ebd4589a 100644 --- a/wrap/io_tetramesh/import_ply.h +++ b/wrap/io_tetramesh/import_ply.h @@ -142,20 +142,20 @@ public: static const PropDescriptor &VertDesc(int i) { const static PropDescriptor pv[13]={ - /*00*/ {"vertex", "x", ply::T_FLOAT, PlyType(), offsetof(LoadPly_VertAux,p),0,0,0,0,0}, - /*01*/ {"vertex", "y", ply::T_FLOAT, PlyType(), offsetof(LoadPly_VertAux,p) + sizeof(ScalarType),0,0,0,0,0}, - /*02*/ {"vertex", "z", ply::T_FLOAT, PlyType(), offsetof(LoadPly_VertAux,p) + 2 * sizeof(ScalarType),0,0,0,0,0}, - /*03*/ {"vertex", "flags", ply::T_INT, ply::T_INT, offsetof(LoadPly_VertAux,flags),0,0,0,0,0}, - /*04*/ {"vertex", "quality", ply::T_FLOAT, ply::T_FLOAT, offsetof(LoadPly_VertAux,q),0,0,0,0,0}, - /*05*/ {"vertex", "red" , ply::T_UCHAR, ply::T_UCHAR, offsetof(LoadPly_VertAux,r),0,0,0,0,0}, - /*06*/ {"vertex", "green", ply::T_UCHAR, ply::T_UCHAR, offsetof(LoadPly_VertAux,g),0,0,0,0,0}, - /*07*/ {"vertex", "blue" , ply::T_UCHAR, ply::T_UCHAR, offsetof(LoadPly_VertAux,b),0,0,0,0,0}, - /*08*/ {"vertex", "alpha" , ply::T_UCHAR, ply::T_UCHAR, offsetof(LoadPly_VertAux,a),0,0,0,0,0}, + /*00*/ {"vertex", "x", ply::T_FLOAT, PlyType(), offsetof(LoadPly_VertAux,p), 0, 0, 0, 0, 0, 0}, + /*01*/ {"vertex", "y", ply::T_FLOAT, PlyType(), offsetof(LoadPly_VertAux,p) + sizeof(ScalarType), 0, 0, 0, 0, 0, 0}, + /*02*/ {"vertex", "z", ply::T_FLOAT, PlyType(), offsetof(LoadPly_VertAux,p) + 2*sizeof(ScalarType), 0, 0, 0, 0, 0, 0}, + /*03*/ {"vertex", "flags", ply::T_INT, ply::T_INT, offsetof(LoadPly_VertAux,flags), 0, 0, 0, 0, 0, 0}, + /*04*/ {"vertex", "quality", ply::T_FLOAT, PlyType(), offsetof(LoadPly_VertAux,q), 0, 0, 0, 0, 0, 0}, + /*05*/ {"vertex", "red" , ply::T_UCHAR, ply::T_UCHAR, offsetof(LoadPly_VertAux,r), 0, 0, 0, 0, 0, 0}, + /*06*/ {"vertex", "green", ply::T_UCHAR, ply::T_UCHAR, offsetof(LoadPly_VertAux,g), 0, 0, 0, 0, 0, 0}, + /*07*/ {"vertex", "blue" , ply::T_UCHAR, ply::T_UCHAR, offsetof(LoadPly_VertAux,b), 0, 0, 0, 0, 0, 0}, + /*08*/ {"vertex", "alpha" , ply::T_UCHAR, ply::T_UCHAR, offsetof(LoadPly_VertAux,a), 0, 0, 0, 0, 0, 0}, // DOUBLE - /*09*/ {"vertex", "x", ply::T_DOUBLE, PlyType(),offsetof(LoadPly_VertAux,p),0,0,0,0,0 ,0}, - /*10*/ {"vertex", "y", ply::T_DOUBLE, PlyType(),offsetof(LoadPly_VertAux,p) + sizeof(ScalarType) ,0,0,0,0,0 ,0}, - /*11*/ {"vertex", "z", ply::T_DOUBLE, PlyType(),offsetof(LoadPly_VertAux,p) + 2*sizeof(ScalarType),0,0,0,0,0 ,0}, - /*12*/ {"vertex", "quality", ply::T_DOUBLE, PlyType(),offsetof(LoadPly_VertAux,q),0,0,0,0,0 ,0} + /*09*/ {"vertex", "x", ply::T_DOUBLE, PlyType(),offsetof(LoadPly_VertAux,p), 0, 0, 0, 0, 0, 0}, + /*10*/ {"vertex", "y", ply::T_DOUBLE, PlyType(),offsetof(LoadPly_VertAux,p) + sizeof(ScalarType), 0, 0, 0, 0, 0, 0}, + /*11*/ {"vertex", "z", ply::T_DOUBLE, PlyType(),offsetof(LoadPly_VertAux,p) + 2*sizeof(ScalarType), 0, 0, 0, 0, 0, 0}, + /*12*/ {"vertex", "quality", ply::T_DOUBLE, PlyType(),offsetof(LoadPly_VertAux,q), 0, 0, 0, 0, 0, 0} }; return pv[i]; } @@ -165,16 +165,16 @@ public: { const static PropDescriptor qf[10]= { - {"tetra", "vertex_indices", ply::T_INT, ply::T_INT, offsetof(LoadPly_TetraAux,v), 1,0,ply::T_UCHAR,ply::T_UCHAR,offsetof(LoadPly_TetraAux,size) }, - {"tetra", "flags", ply::T_INT, ply::T_INT, offsetof(LoadPly_TetraAux,flags), 0,0,0,0,0}, - {"tetra", "quality", ply::T_FLOAT, ply::T_FLOAT, offsetof(LoadPly_TetraAux,q), 0,0,0,0,0}, - {"tetra", "texcoord", ply::T_FLOAT, ply::T_FLOAT, offsetof(LoadPly_TetraAux,texcoord), 1,0,ply::T_UCHAR,ply::T_UCHAR,offsetof(LoadPly_TetraAux,ntexcoord) }, - {"tetra", "color", ply::T_FLOAT, ply::T_FLOAT, offsetof(LoadPly_TetraAux,colors), 1,0,ply::T_UCHAR,ply::T_UCHAR,offsetof(LoadPly_TetraAux,ncolors) }, - {"tetra", "texnumber", ply::T_INT, ply::T_INT, offsetof(LoadPly_TetraAux,texcoordind), 0,0,0,0,0}, - {"tetra", "red" , ply::T_UCHAR, ply::T_UCHAR, offsetof(LoadPly_TetraAux,r), 0,0,0,0,0}, - {"tetra", "green", ply::T_UCHAR, ply::T_UCHAR, offsetof(LoadPly_TetraAux,g), 0,0,0,0,0}, - {"tetra", "blue" , ply::T_UCHAR, ply::T_UCHAR, offsetof(LoadPly_TetraAux,b), 0,0,0,0,0}, - {"tetra", "alpha" , ply::T_UCHAR, ply::T_UCHAR, offsetof(LoadPly_TetraAux,a), 0,0,0,0,0}, + {"tetra", "vertex_indices", ply::T_INT, ply::T_INT, offsetof(LoadPly_TetraAux,v), 1, 0, ply::T_UCHAR,ply::T_UCHAR,offsetof(LoadPly_TetraAux,size), 0}, + {"tetra", "flags", ply::T_INT, ply::T_INT, offsetof(LoadPly_TetraAux,flags), 0, 0, 0, 0, 0, 0}, + {"tetra", "quality", ply::T_FLOAT, ply::T_FLOAT, offsetof(LoadPly_TetraAux,q), 0, 0, 0, 0, 0, 0}, + {"tetra", "texcoord", ply::T_FLOAT, ply::T_FLOAT, offsetof(LoadPly_TetraAux,texcoord), 1, 0, ply::T_UCHAR,ply::T_UCHAR,offsetof(LoadPly_TetraAux,ntexcoord), 0}, + {"tetra", "color", ply::T_FLOAT, ply::T_FLOAT, offsetof(LoadPly_TetraAux,colors), 1, 0, ply::T_UCHAR,ply::T_UCHAR,offsetof(LoadPly_TetraAux,ncolors), 0}, + {"tetra", "texnumber", ply::T_INT, ply::T_INT, offsetof(LoadPly_TetraAux,texcoordind), 0, 0, 0, 0, 0, 0}, + {"tetra", "red" , ply::T_UCHAR, ply::T_UCHAR, offsetof(LoadPly_TetraAux,r), 0, 0, 0, 0, 0, 0}, + {"tetra", "green", ply::T_UCHAR, ply::T_UCHAR, offsetof(LoadPly_TetraAux,g), 0, 0, 0, 0, 0, 0}, + {"tetra", "blue" , ply::T_UCHAR, ply::T_UCHAR, offsetof(LoadPly_TetraAux,b), 0, 0, 0, 0, 0, 0}, + {"tetra", "alpha" , ply::T_UCHAR, ply::T_UCHAR, offsetof(LoadPly_TetraAux,a), 0, 0, 0, 0, 0, 0}, }; return qf[i];