From e888ef15602569296ec3c128b3e6a0dc2103d27b Mon Sep 17 00:00:00 2001 From: ponchio Date: Wed, 3 Jun 2009 12:23:20 +0000 Subject: [PATCH] removed some useless consts --- vcg/complex/trimesh/base.h | 2 +- vcg/container/simple_temporary_data.h | 2 +- vcg/simplex/edge/base.h | 2 +- vcg/simplex/edge/component.h | 8 ++++---- vcg/simplex/face/base.h | 8 ++++---- vcg/simplex/face/component.h | 12 ++++++------ vcg/simplex/face/component_polygon.h | 4 ++-- vcg/simplex/vertex/base.h | 2 +- vcg/simplex/vertex/component.h | 8 ++++---- vcg/space/texcoord2.h | 8 ++++---- 10 files changed, 28 insertions(+), 28 deletions(-) diff --git a/vcg/complex/trimesh/base.h b/vcg/complex/trimesh/base.h index 63f34fa7..e956014b 100644 --- a/vcg/complex/trimesh/base.h +++ b/vcg/complex/trimesh/base.h @@ -244,7 +244,7 @@ class TriMesh: public TriMeshEdgeHolder*)_handle)->Resize(sz);} void Reorder(std::vector & newVertIndex){((SimpleTempDataBase*)_handle)->Reorder(newVertIndex);} - const bool operator<(const HandlesWrapper b) const { return(_name.empty()&&b._name.empty())?(_handle < b._handle):( _name < b._name);} + bool operator<(const HandlesWrapper b) const { return(_name.empty()&&b._name.empty())?(_handle < b._handle):( _name < b._name);} }; std::set< HandlesWrapper > vert_attr; diff --git a/vcg/container/simple_temporary_data.h b/vcg/container/simple_temporary_data.h index 284dfcfe..173fcb41 100644 --- a/vcg/container/simple_temporary_data.h +++ b/vcg/container/simple_temporary_data.h @@ -93,7 +93,7 @@ public: void clear(){ datasize = 0;} - const unsigned int size() const { return datasize;} + unsigned int size() const { return datasize;} bool & operator [](const int & i){return data[i];} diff --git a/vcg/simplex/edge/base.h b/vcg/simplex/edge/base.h index d9bb9ada..233b86d2 100644 --- a/vcg/simplex/edge/base.h +++ b/vcg/simplex/edge/base.h @@ -116,7 +116,7 @@ public: }; inline int & UberFlags () { return this->Flags(); } - inline const int UberFlags() const { return this->Flags(); } + inline int UberFlags() const { return this->Flags(); } bool IsD() const {return (this->Flags() & DELETED) != 0;} /// checks if the vertex is deleted bool IsR() const {return (this->Flags() & NOTREAD) == 0;} /// checks if the vertex is readable diff --git a/vcg/simplex/edge/component.h b/vcg/simplex/edge/component.h index 2cad659e..92f236c0 100644 --- a/vcg/simplex/edge/component.h +++ b/vcg/simplex/edge/component.h @@ -44,7 +44,7 @@ public: // typedef typename T::CoordType CoordType; inline typename T::VertexType * & V( const int j ) { assert(0); static typename T::VertexType *vp=0; return vp; } inline typename T::VertexType * const & V( const int j ) const { assert(0); static typename T::VertexType *vp=0; return vp; } - inline typename T::VertexType * const cV( const int j ) const { assert(0); static typename T::VertexType *vp=0; return vp; } + inline typename T::VertexType * cV( const int j ) const { assert(0); static typename T::VertexType *vp=0; return vp; } inline typename T::CoordType & P( const int j ) { assert(0); static typename T::CoordType coord(0, 0, 0); return coord; } inline const typename T::CoordType & P( const int j ) const { assert(0); static typename T::CoordType coord(0, 0, 0); return coord; } inline const typename T::CoordType &cP( const int j ) const { assert(0); static typename T::CoordType coord(0, 0, 0); return coord; } @@ -63,7 +63,7 @@ public: inline typename T::VertexType * & V( const int j ) { assert(j>=0 && j<2); return v[j]; } inline typename T::VertexType * const & V( const int j ) const { assert(j>=0 && j<2); return v[j]; } - inline typename T::VertexType * const cV( const int j ) const { assert(j>=0 && j<2); return v[j]; } + inline typename T::VertexType * cV( const int j ) const { assert(j>=0 && j<2); return v[j]; } // Shortcut per accedere ai punti delle facce inline typename T::CoordType & P( const int j ) { assert(j>=0 && j<2); return v[j]->P(); } @@ -138,7 +138,7 @@ public: typedef int FlagType; /// Return the vector of Flags(), senza effettuare controlli sui bit int &Flags() { static int dummyflags(0); assert(0); return dummyflags; } - const int Flags() const { return 0; } + int Flags() const { return 0; } template < class LeftV> void ImportLocal(const LeftV & left ) { T::ImportLocal( left); } static bool HasFlags() { return false; } @@ -151,7 +151,7 @@ public: BitFlags(){_flags=0;} typedef int FlagType; int &Flags() {return _flags; } - const int Flags() const {return _flags; } + int Flags() const {return _flags; } template < class LeftV> void ImportLocal(const LeftV & left ) { Flags() = left.Flags(); T::ImportLocal( left); } static bool HasFlags() { return true; } diff --git a/vcg/simplex/face/base.h b/vcg/simplex/face/base.h index 5dfaf7f8..1c12f563 100644 --- a/vcg/simplex/face/base.h +++ b/vcg/simplex/face/base.h @@ -108,9 +108,9 @@ class FaceTypeHolder{ // prot - const int VN() const { return 3;} - inline const int Prev(const int & i) const { return (i+(3-1))%3;} - inline const int Next(const int & i) const { return (i+1)%3;} + int VN() const { return 3;} + inline int Prev(const int & i) const { return (i+(3-1))%3;} + inline int Next(const int & i) const { return (i+1)%3;} inline void Alloc(const int & ){} inline void Dealloc(){} }; @@ -167,7 +167,7 @@ public: { return this->Flags(); } - inline const int UberFlags() const + inline int UberFlags() const { return this->Flags(); } diff --git a/vcg/simplex/face/component.h b/vcg/simplex/face/component.h index 7c99e94b..59c3d871 100644 --- a/vcg/simplex/face/component.h +++ b/vcg/simplex/face/component.h @@ -117,8 +117,8 @@ public: // typedef typename T::CoordType CoordType; inline typename T::VertexType * & V( const int j ) { assert(0); static typename T::VertexType *vp=0; return vp; } inline typename T::VertexType * const & V( const int j ) const { assert(0); static typename T::VertexType *vp=0; return vp; } - inline typename T::VertexType * const cV( const int j ) const { assert(0); static typename T::VertexType *vp=0; return vp; } - inline typename T::CoordType & P( const int j ) { assert(0); static typename T::CoordType coord(0, 0, 0); return coord; } + inline typename T::VertexType * cV( const int j ) const { assert(0); static typename T::VertexType *vp=0; return vp; } + inline typename T::CoordType & P( const int j ) { assert(0); static typename T::CoordType coord(0, 0, 0); return coord; } inline const typename T::CoordType & P( const int j ) const { assert(0); static typename T::CoordType coord(0, 0, 0); return coord; } inline const typename T::CoordType &cP( const int j ) const { assert(0); static typename T::CoordType coord(0, 0, 0); return coord; } template @@ -139,7 +139,7 @@ public: inline typename T::VertexType * & V( const int j ) { assert(j>=0 && j<3); return v[j]; } inline typename T::VertexType * const & V( const int j ) const { assert(j>=0 && j<3); return v[j]; } - inline typename T::VertexType * const cV( const int j ) const { assert(j>=0 && j<3); return v[j]; } + inline typename T::VertexType * cV( const int j ) const { assert(j>=0 && j<3); return v[j]; } // Shortcut per accedere ai punti delle facce inline typename T::CoordType & P( const int j ) { assert(j>=0 && j<3); return v[j]->P(); } @@ -328,7 +328,7 @@ template class EmptyBitFlags: public T { public: /// Return the vector of Flags(), senza effettuare controlli sui bit int &Flags() { static int dummyflags(0); assert(0); return dummyflags; } - const int Flags() const { return 0; } + int Flags() const { return 0; } template void ImportLocal(const LeftF & leftF){ T::ImportLocal(leftF);} inline void Alloc(const int & ns){T::Alloc(ns);} @@ -343,7 +343,7 @@ template class BitFlags: public T { public: BitFlags(){_flags=0;} int &Flags() {return _flags; } - const int Flags() const {return _flags; } + int Flags() const {return _flags; } const int & cFlags() const {return _flags; } template void ImportLocal(const LeftF & leftF){ Flags() = leftF.cFlags();T::ImportLocal(leftF);} @@ -364,7 +364,7 @@ public: typedef int MarkType; inline void InitIMark() { } inline int & IMark() { assert(0); static int tmp=-1; return tmp;} - inline const int IMark() const {return 0;} + inline int IMark() const {return 0;} typedef float QualityType; typedef vcg::Color4b ColorType; diff --git a/vcg/simplex/face/component_polygon.h b/vcg/simplex/face/component_polygon.h index 297c1ad4..b54966be 100644 --- a/vcg/simplex/face/component_polygon.h +++ b/vcg/simplex/face/component_polygon.h @@ -78,7 +78,7 @@ public: // typedef typename T::CoordType CoordType; inline typename T::VertexType * & V( const int j ) { assert(0); static typename T::VertexType *vp=0; return vp; } inline typename T::VertexType * const & V( const int j ) const { assert(0); static typename T::VertexType *vp=0; return vp; } - inline typename T::VertexType * const cV( const int j ) const { assert(0); static typename T::VertexType *vp=0; return vp; } + inline typename T::VertexType * cV( const int j ) const { assert(0); static typename T::VertexType *vp=0; return vp; } inline typename T::CoordType & P( const int j ) { assert(0); static typename T::CoordType coord(0, 0, 0); return coord; } inline const typename T::CoordType & P( const int j ) const { assert(0); static typename T::CoordType coord(0, 0, 0); return coord; } inline const typename T::CoordType &cP( const int j ) const { assert(0); static typename T::CoordType coord(0, 0, 0); return coord; } @@ -95,7 +95,7 @@ public: PFVAdj(){_vpoly = NULL;} inline typename T::VertexType * & V( const int j ) { assert(j>=0 && jVN()); return _vpoly[j]; } inline typename T::VertexType * const & V( const int j ) const { assert(j>=0 && jVN()); return _vpoly[j]; } - inline typename T::VertexType * const cV( const int j ) const { assert(j>=0 && jVN()); return _vpoly[j]; } + inline typename T::VertexType * cV( const int j ) const { assert(j>=0 && jVN()); return _vpoly[j]; } /** Return the pointer to the ((j+1)%3)-th vertex of the face. diff --git a/vcg/simplex/vertex/base.h b/vcg/simplex/vertex/base.h index 2f93f1c6..7cd2fea7 100644 --- a/vcg/simplex/vertex/base.h +++ b/vcg/simplex/vertex/base.h @@ -162,7 +162,7 @@ public: }; inline int & UberFlags () { return this->Flags(); } - inline const int UberFlags() const { return this->Flags(); } + inline int UberFlags() const { return this->Flags(); } bool IsD() const {return (this->Flags() & DELETED) != 0;} /// checks if the vertex is deleted bool IsR() const {return (this->Flags() & NOTREAD) == 0;} /// checks if the vertex is readable diff --git a/vcg/simplex/vertex/component.h b/vcg/simplex/vertex/component.h index d1fe55a1..347af04f 100644 --- a/vcg/simplex/vertex/component.h +++ b/vcg/simplex/vertex/component.h @@ -265,7 +265,7 @@ public: typedef int FlagType; /// Return the vector of Flags(), senza effettuare controlli sui bit int &Flags() { static int dummyflags(0); assert(0); return dummyflags; } - const int Flags() const { return 0; } + int Flags() const { return 0; } template < class LeftV> void ImportLocal(const LeftV & left ) { T::ImportLocal( left); } static bool HasFlags() { return false; } @@ -278,7 +278,7 @@ public: BitFlags(){_flags=0;} typedef int FlagType; int &Flags() {return _flags; } - const int Flags() const {return _flags; } + int Flags() const {return _flags; } template < class LeftV> void ImportLocal(const LeftV & left ) { if(LeftV::HasFlags()) Flags() = left.Flags(); T::ImportLocal( left); } static bool HasFlags() { return true; } @@ -294,8 +294,8 @@ template class EmptyColorMarkQuality: public T { public: typedef float QualityType; QualityType &Q() { static QualityType dummyQuality(0); assert(0); return dummyQuality; } - const QualityType &cQ() const { static QualityType dummyQuality(0); assert(0); return dummyQuality; } const - static bool HasQuality() { return false; } + const QualityType &cQ() const { static QualityType dummyQuality(0); assert(0); return dummyQuality; } + static bool HasQuality() { return false; } typedef vcg::Color4b ColorType; ColorType &C() { static ColorType dumcolor(vcg::Color4b::White); assert(0); return dumcolor; } diff --git a/vcg/space/texcoord2.h b/vcg/space/texcoord2.h index ab8f7723..98793444 100644 --- a/vcg/space/texcoord2.h +++ b/vcg/space/texcoord2.h @@ -68,10 +68,10 @@ public: inline const T & V(const int i) const { assert(i>0 && i0 && i0 && i0 && i (lowercase ones). DEPRECATED. TO BE REMOVED SOON.*/ @@ -85,10 +85,10 @@ public: /**/inline const T & v(const int i) const { return _t[i][1]; } /**/ /**/inline short & n() { return _n[0]; } - /**/inline const short n() const { return _n[0]; } + /**/inline short n() const { return _n[0]; } /**/ /**/inline short & n(const int i) { return _n[i]; } - /**/inline const short n(const int i) const { return _n[i]; } + /**/inline short n(const int i) const { return _n[i]; } /**/ /**/inline Point2 & t(const int i) { return _t[i]; } /**/inline Point2 t(const int i) const { return _t[i]; }