From 5ced1eb198fba9245001ae9518b48296dc83c4db Mon Sep 17 00:00:00 2001 From: alemuntoni Date: Thu, 18 Mar 2021 17:17:09 +0100 Subject: [PATCH] face const correctness --- vcg/simplex/face/component.h | 89 ++++++++++++++++++++++++-------- vcg/simplex/face/component_ocf.h | 66 +++++++++++++++++++---- 2 files changed, 123 insertions(+), 32 deletions(-) diff --git a/vcg/simplex/face/component.h b/vcg/simplex/face/component.h index 8134eac6..2fda0b9d 100644 --- a/vcg/simplex/face/component.h +++ b/vcg/simplex/face/component.h @@ -37,10 +37,13 @@ namespace face { template class EmptyCore: public T { public: inline typename T::VertexType * &V( const int ) { assert(0); static typename T::VertexType *vp=0; return vp; } + inline typename T::VertexType * V( const int ) const { assert(0); static typename T::VertexType *vp=0; return vp; } inline typename T::VertexType * cV( const int ) const { assert(0); static typename T::VertexType *vp=0; return vp; } inline typename T::VertexType * &FVp( const int i ) { return this->V(i); } + inline typename T::VertexType * FVp( const int i ) const { return this->cV(i); } inline typename T::VertexType * cFVp( const int i ) const { return this->cV(i); } inline typename T::CoordType &P( const int ) { assert(0); static typename T::CoordType coord(0, 0, 0); return coord; } + inline typename T::CoordType P( const int ) const { assert(0); static typename T::CoordType coord(0, 0, 0); return coord; } inline typename T::CoordType cP( const int ) const { assert(0); static typename T::CoordType coord(0, 0, 0); return coord; } static bool HasVertexRef() { return false; } @@ -49,23 +52,28 @@ public: typedef typename T::VertexType::NormalType NormalType; typedef NormalType WedgeNormalType; NormalType &N() { static NormalType dummy_normal(0, 0, 0); assert(0); return dummy_normal; } - NormalType cN() const { static NormalType dummy_normal(0, 0, 0); return dummy_normal; } + const NormalType& N() const { static NormalType dummy_normal(0, 0, 0); return dummy_normal; } + const NormalType& cN() const { static NormalType dummy_normal(0, 0, 0); return dummy_normal; } WedgeNormalType &WN(int) { static NormalType dummy_normal(0, 0, 0); assert(0); return dummy_normal; } - WedgeNormalType cWN(int) const { static NormalType dummy_normal(0, 0, 0); return dummy_normal; } + const WedgeNormalType& WN(int) const { static NormalType dummy_normal(0, 0, 0); return dummy_normal; } + const WedgeNormalType& cWN(int) const { static NormalType dummy_normal(0, 0, 0); return dummy_normal; } typedef int WedgeTexCoordType; typedef vcg::TexCoord2 TexCoordType; TexCoordType &WT(const int) { static TexCoordType dummy_texture; assert(0); return dummy_texture;} - TexCoordType const &cWT(const int) const { static TexCoordType dummy_texture; return dummy_texture;} + const TexCoordType & WT(const int) const { static TexCoordType dummy_texture; return dummy_texture;} + const TexCoordType &cWT(const int) const { static TexCoordType dummy_texture; return dummy_texture;} typedef int FlagType; int &Flags() { static int dummyflags(0); assert(0); return dummyflags; } + int Flags() const { return 0; } int cFlags() const { return 0; } static bool HasFlags() { return false; } inline void InitIMark() { } inline int &IMark() { assert(0); static int tmp=-1; return tmp;} + inline int IMark() const { return 0;} inline int cIMark() const { return 0;} typedef int MarkType; @@ -74,13 +82,17 @@ public: typedef vcg::Color4b ColorType; typedef ColorType WedgeColorType; ColorType &C() { static ColorType dumcolor(vcg::Color4b::White); assert(0); return dumcolor; } - ColorType cC() const { static ColorType dumcolor(vcg::Color4b::White); assert(0); return dumcolor; } + const ColorType& C() const { static ColorType dumcolor(vcg::Color4b::White); assert(0); return dumcolor; } + const ColorType& cC() const { static ColorType dumcolor(vcg::Color4b::White); assert(0); return dumcolor; } WedgeColorType &WC(const int) { static ColorType dumcolor(vcg::Color4b::White); assert(0); return dumcolor; } - WedgeColorType cWC(const int) const { static ColorType dumcolor(vcg::Color4b::White); assert(0); return dumcolor; } + const WedgeColorType& WC(const int) const { static ColorType dumcolor(vcg::Color4b::White); assert(0); return dumcolor; } + const WedgeColorType& cWC(const int) const { static ColorType dumcolor(vcg::Color4b::White); assert(0); return dumcolor; } QualityType &Q() { static QualityType dummyQuality(0); assert(0); return dummyQuality; } - QualityType cQ() const { static QualityType dummyQuality(0); assert(0); return dummyQuality; } + const QualityType& Q() const { static QualityType dummyQuality(0); assert(0); return dummyQuality; } + const QualityType& cQ() const { static QualityType dummyQuality(0); assert(0); return dummyQuality; } Quality3Type &Q3() { static Quality3Type dummyQuality3(0,0,0); assert(0); return dummyQuality3; } - Quality3Type cQ3() const { static Quality3Type dummyQuality3(0,0,0); assert(0); return dummyQuality3; } + const Quality3Type& Q3() const { static Quality3Type dummyQuality3(0,0,0); assert(0); return dummyQuality3; } + const Quality3Type& cQ3() const { static Quality3Type dummyQuality3(0,0,0); assert(0); return dummyQuality3; } static bool HasColor() { return false; } static bool HasQuality() { return false; } @@ -106,17 +118,22 @@ public: typedef int VFAdjType; typename T::FacePointer &VFp(int) { static typename T::FacePointer fp=0; assert(0); return fp; } + typename T::FacePointer VFp(int) const { static typename T::FacePointer fp=0; assert(0); return fp; } typename T::FacePointer cVFp(int) const { static typename T::FacePointer fp=0; assert(0); return fp; } typename T::FacePointer &FFp(int) { static typename T::FacePointer fp=0; assert(0); return fp; } + typename T::FacePointer FFp(int) const { static typename T::FacePointer fp=0; assert(0); return fp; } typename T::FacePointer cFFp(int) const { static typename T::FacePointer fp=0; assert(0); return fp; } typename T::EdgePointer &FEp(int) { static typename T::EdgePointer fp=0; assert(0); return fp; } + typename T::EdgePointer FEp(int) const { static typename T::EdgePointer fp=0; assert(0); return fp; } typename T::EdgePointer cFEp(int) const { static typename T::EdgePointer fp=0; assert(0); return fp; } typename T::HEdgePointer &FHp() { static typename T::HEdgePointer fp=0; assert(0); return fp; } + typename T::HEdgePointer FHp() const { static typename T::HEdgePointer fp=0; assert(0); return fp; } typename T::HEdgePointer cFHp() const { static typename T::HEdgePointer fp=0; assert(0); return fp; } char &VFi(int) { static char z=0; assert(0); return z;} char VFi(int) const { static char z=0; assert(0); return z;} - char &FFi(int) { static char z=0; assert(0); return z;} char cVFi(int) const { static char z=0; assert(0); return z;} + char &FFi(int) { static char z=0; assert(0); return z;} + char FFi(int) const { static char z=0; assert(0); return z;} char cFFi(int) const { static char z=0; assert(0); return z;} bool IsVFInitialized(const int j) const {return static_cast(this)->cVFi(j)!=-1;} void VFClear(int j) { @@ -135,13 +152,17 @@ public: typedef typename T::ScalarType CurScalarType; CurVecType &PD1() { static typename T::CoordType dummy(0, 0, 0); assert(0); return dummy; } CurVecType &PD2() { static typename T::CoordType dummy(0, 0, 0); assert(0); return dummy; } - CurVecType cPD1() const { static typename T::CoordType dummy(0, 0, 0); assert(0); return dummy; } - CurVecType cPD2() const { static typename T::CoordType dummy(0, 0, 0); assert(0); return dummy; } + const CurVecType& PD1() const { static typename T::CoordType dummy(0, 0, 0); assert(0); return dummy; } + const CurVecType& PD2() const { static typename T::CoordType dummy(0, 0, 0); assert(0); return dummy; } + const CurVecType& cPD1() const { static typename T::CoordType dummy(0, 0, 0); assert(0); return dummy; } + const CurVecType& cPD2() const { static typename T::CoordType dummy(0, 0, 0); assert(0); return dummy; } CurScalarType &K1() { static typename T::ScalarType dummy(0); assert(0); return dummy; } CurScalarType &K2() { static typename T::ScalarType dummy(0); assert(0); return dummy; } - CurScalarType cK1() const { static typename T::ScalarType dummy(0); assert(0); return dummy; } - CurScalarType cK2() const { static typename T::ScalarType dummy(0); assert(0); return dummy; } + const CurScalarType& K1() const { static typename T::ScalarType dummy(0); assert(0); return dummy; } + const CurScalarType& K2() const { static typename T::ScalarType dummy(0); assert(0); return dummy; } + const CurScalarType& cK1() const { static typename T::ScalarType dummy(0); assert(0); return dummy; } + const CurScalarType& cK2() const { static typename T::ScalarType dummy(0); assert(0); return dummy; } static bool HasCurvatureDir() { return false; } @@ -177,8 +198,9 @@ public: inline const typename T::VertexType * V (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]; } - inline CoordType &P( const int j ) { assert(j>=0 && j<3); return v[j]->P(); } /// \brief Shortcut: the position of the i-th vertex (equivalent to \c V(i)->P() ) - inline CoordType cP( const int j ) const { assert(j>=0 && j<3); return v[j]->cP(); } + inline CoordType &P( const int j ) { assert(j>=0 && j<3); return v[j]->P(); } /// \brief Shortcut: the position of the i-th vertex (equivalent to \c V(i)->P() ) + inline const CoordType &P( const int j ) const { assert(j>=0 && j<3); return v[j]->P(); } + inline CoordType cP( const int j ) const { assert(j>=0 && j<3); return v[j]->cP(); } inline typename T::VertexType * & V0( const int j ) { return V(j);} /** \brief Return the pointer to the j-th vertex of the face. */ inline typename T::VertexType * & V1( const int j ) { return V((j+1)%3);} /** \brief Return the pointer to the ((j+1)%3)-th vertex of the face. */ @@ -193,6 +215,9 @@ public: inline CoordType & P0( const int j ) { return V(j)->P();} inline CoordType & P1( const int j ) { return V((j+1)%3)->P();} inline CoordType & P2( const int j ) { return V((j+2)%3)->P();} + inline const CoordType & P0( const int j ) const { return V(j)->P();} + inline const CoordType & P1( const int j ) const { return V((j+1)%3)->P();} + inline const CoordType & P2( const int j ) const { return V((j+2)%3)->P();} inline const CoordType & cP0( const int j ) const { return cV(j)->P();} inline const CoordType & cP1( const int j ) const { return cV((j+1)%3)->P();} inline const CoordType & cP2( const int j ) const { return cV((j+2)%3)->P();} @@ -240,7 +265,8 @@ template class WedgeNormal: public T { public: typedef typename T::VertexType::NormalType WedgeNormalType; inline WedgeNormalType &WN(int j) { return _wnorm[j]; } - inline WedgeNormalType cWN(int j) const { return _wnorm[j]; } + inline const WedgeNormalType& WN(int j) const { return _wnorm[j]; } + inline const WedgeNormalType& cWN(int j) const { return _wnorm[j]; } template void ImportData(const RightValueType & rightF){ if(rightF.IsWedgeNormalEnabled()) for (int i=0; i<3; ++i) { WN(i) = rightF.cWN(i); } T::ImportData(rightF);} inline void Alloc(const int & ns){T::Alloc(ns);} @@ -256,7 +282,8 @@ template class WedgeRealNormal: public T { public: typedef A WedgeNormalType; inline WedgeNormalType &WN(int i) { return _wn[i]; } - inline WedgeNormalType cWN(int i) const { return _wn[i]; } + inline const WedgeNormalType& WN(int i) const { return _wn[i]; } + inline const WedgeNormalType& cWN(int i) const { return _wn[i]; } template void ImportData(const RightValueType & rightF){ if(RightValueType::HasWedgeNormal()) for (int i=0; i<3; ++i) { WN(i) = rightF.cWN(i); } T::ImportData(rightF);} inline void Alloc(const int & ns){T::Alloc(ns);} @@ -293,7 +320,8 @@ public: typedef int WedgeTexCoordType; typedef A TexCoordType; TexCoordType &WT(const int i) { return _wt[i]; } - TexCoordType cWT(const int i) const { return _wt[i]; } + const TexCoordType& WT(const int i) const { return _wt[i]; } + const TexCoordType& cWT(const int i) const { return _wt[i]; } template void ImportData(const RightValueType & rightF){ if(rightF.IsWedgeTexCoordEnabled()) @@ -329,6 +357,7 @@ public: BitFlags():_flags(0) {} typedef int FlagType; int &Flags() {return _flags; } + int Flags() const {return _flags; } int cFlags() const {return _flags; } template void ImportData(const RightValueType & rightF){ @@ -351,7 +380,8 @@ public: typedef A ColorType; Color():_color(vcg::Color4b::White) {} ColorType &C() { return _color; } - ColorType cC() const { return _color; } + const ColorType& C() const { return _color; } + const ColorType& cC() const { return _color; } template void ImportData(const RightValueType & rightF){ if(rightF.IsColorEnabled()) C() = rightF.cC(); @@ -370,7 +400,8 @@ template class WedgeColor: public T { public: typedef A WedgeColorType; WedgeColorType &WC(int i) { return _color[i]; } - WedgeColorType cWC(int i) const { return _color[i]; } + const WedgeColorType& WC(int i) const { return _color[i]; } + const WedgeColorType& cWC(int i) const { return _color[i]; } template void ImportData(const RightValueType & rightF){ @@ -404,7 +435,8 @@ public: typedef A QualityType; Quality():_quality(0) {} QualityType &Q() { return _quality; } - QualityType cQ() const { return _quality; } + const QualityType& Q() const { return _quality; } + const QualityType& cQ() const { return _quality; } template void ImportData(const RightValueType & rightF){ if(rightF.IsQualityEnabled()) @@ -434,7 +466,8 @@ template class Quality3: public T { public: typedef vcg::Point3 Quality3Type; Quality3Type &Q3() { return _quality; } - Quality3Type cQ3() const { return _quality; } + const Quality3Type& Q3() const { return _quality; } + const Quality3Type& cQ3() const { return _quality; } template void ImportData(const RightValueType & rightF){ if(rightF.IsQuality3Enabled()) Q3() = rightF.cQ3(); @@ -468,6 +501,7 @@ template class Mark: public T { public: Mark():_imark(0){} inline int &IMark() { return _imark;} + inline int IMark() const { return _imark;} inline int cIMark() const { return _imark;} inline void InitIMark() { _imark = 0; } static bool HasMark() { return true; } @@ -501,11 +535,15 @@ public: CurVecType &PD1() { return _curv.max_dir;} CurVecType &PD2() { return _curv.min_dir;} + const CurVecType &PD1() const { return _curv.max_dir;} + const CurVecType &PD2() const { return _curv.min_dir;} CurVecType cPD1() const { return _curv.max_dir;} CurVecType cPD2() const { return _curv.min_dir;} CurScalarType &K1() { return _curv.k1;} CurScalarType &K2() { return _curv.k2;} + const CurScalarType &K1() const { return _curv.k1;} + const CurScalarType &K2() const { return _curv.k2;} CurScalarType cK1() const {return _curv.k1;} CurScalarType cK2() const {return _curv.k2;} template < class RightValueType> @@ -560,8 +598,10 @@ public: _vfi[2]=-1; } typename T::FacePointer &VFp(const int j) { assert(j>=0 && j<3); return _vfp[j]; } + typename T::FacePointer VFp(const int j) const { assert(j>=0 && j<3); return _vfp[j]; } typename T::FacePointer cVFp(const int j) const { assert(j>=0 && j<3); return _vfp[j]; } char &VFi(const int j) {return _vfi[j]; } + char VFi(const int j)const {return _vfi[j]; } char cVFi(const int j)const {return _vfi[j]; } template void ImportData(const RightValueType & rightF){T::ImportData(rightF);} @@ -589,6 +629,7 @@ public: typename T::FacePointer &EFp(const int j) { assert(j>=0 && j<3); return _efp[j]; } typename T::FacePointer cEFp(const int j) const { assert(j>=0 && j<3); return _efp[j]; } char &VFi(const int j) {return _efi[j]; } + char VFi(const int j) const {return _efi[j]; } template void ImportData(const RightValueType & rightF){T::ImportData(rightF);} inline void Alloc(const int & ns){T::Alloc(ns);} @@ -624,12 +665,16 @@ public: _ffp[2]=nullptr; } typename T::FacePointer &FFp(const int j) { assert(j>=0 && j<3); return _ffp[j]; } + typename T::FacePointer FFp(const int j) const { assert(j>=0 && j<3); return _ffp[j]; } typename T::FacePointer cFFp(const int j) const { assert(j>=0 && j<3); return _ffp[j]; } char &FFi(const int j) { return _ffi[j]; } + char FFi(const int j) const { return _ffi[j]; } char cFFi(const int j) const { return _ffi[j]; } typename T::FacePointer &FFp1( const int j ) { return FFp((j+1)%3);} typename T::FacePointer &FFp2( const int j ) { return FFp((j+2)%3);} + typename T::FacePointer FFp1( const int j ) const { return FFp((j+1)%3);} + typename T::FacePointer FFp2( const int j ) const { return FFp((j+2)%3);} typename T::FacePointer cFFp1( const int j ) const { return FFp((j+1)%3);} typename T::FacePointer cFFp2( const int j ) const { return FFp((j+2)%3);} @@ -657,6 +702,7 @@ public: } typename T::EdgePointer &FEp( int j) { assert(j>=0 && j<3); return _fep[j]; } + typename T::EdgePointer FEp( int j) const { assert(j>=0 && j<3); return _fep[j]; } typename T::EdgePointer cFEp( int j) const { assert(j>=0 && j<3); return _fep[j]; } typename T::EdgePointer &FEp1( int j ) { return FEp((j+1)%3);} @@ -682,6 +728,7 @@ template class FHAdj: public T { public: FHAdj(){_fh=0;} typename T::HEdgePointer &FHp( ) { return _fh; } + typename T::HEdgePointer FHp( ) const { return _fh; } typename T::HEdgePointer cFHp( ) const { return _fh; } template diff --git a/vcg/simplex/face/component_ocf.h b/vcg/simplex/face/component_ocf.h index 2707dc22..3f676006 100644 --- a/vcg/simplex/face/component_ocf.h +++ b/vcg/simplex/face/component_ocf.h @@ -398,6 +398,11 @@ public: return (*this).Base().AV[(*this).Index()]._fp[j]; } + typename T::FacePointer VFp(const int j) const { + if(! (*this).Base().VFAdjacencyEnabled ) return 0; + else return (*this).Base().AV[(*this).Index()]._fp[j]; + } + typename T::FacePointer cVFp(const int j) const { if(! (*this).Base().VFAdjacencyEnabled ) return 0; else return (*this).Base().AV[(*this).Index()]._fp[j]; @@ -436,6 +441,11 @@ public: return (*this).Base().AF[(*this).Index()]._fp[j]; } + typename T::FacePointer FFp(const int j) const { + if(! (*this).Base().FFAdjacencyEnabled ) return 0; + else return (*this).Base().AF[(*this).Index()]._fp[j]; + } + typename T::FacePointer cFFp(const int j) const { if(! (*this).Base().FFAdjacencyEnabled ) return 0; else return (*this).Base().AF[(*this).Index()]._fp[j]; @@ -445,6 +455,12 @@ public: assert((*this).Base().FFAdjacencyEnabled); return (*this).Base().AF[(*this).Index()]._zp[j]; } + + char FFi(const int j) const { + assert((*this).Base().FFAdjacencyEnabled); + return (*this).Base().AF[(*this).Index()]._zp[j]; + } + char cFFi(const int j) const { assert((*this).Base().FFAdjacencyEnabled); return (*this).Base().AF[(*this).Index()]._zp[j]; @@ -452,11 +468,14 @@ public: typename T::FacePointer &FFp1( const int j ) { return FFp((j+1)%3);} typename T::FacePointer &FFp2( const int j ) { return FFp((j+2)%3);} + typename T::FacePointer FFp1( const int j ) const { return FFp((j+1)%3);} + typename T::FacePointer FFp2( const int j ) const { return FFp((j+2)%3);} typename T::FacePointer cFFp1( const int j ) const { return FFp((j+1)%3);} typename T::FacePointer cFFp2( const int j ) const { return FFp((j+2)%3);} typename T::FacePointer &Neigh( const int j ) { return FFp(j);} - typename T::FacePointer cNeigh( const int j ) const { return cFFp(j);} + typename T::FacePointer Neigh( const int j ) const { return FFp(j);} + typename T::FacePointer cNeigh( const int j ) const { return FFp(j);} unsigned int SizeNeigh(){return 3;} template @@ -479,7 +498,13 @@ public: // you cannot use Normals before enabling them with: yourmesh.face.EnableNormal() assert((*this).Base().NormalEnabled); return (*this).Base().NV[(*this).Index()]; } - NormalType cN() const { + + const NormalType& N() const { + // you cannot use Normals before enabling them with: yourmesh.face.EnableNormal() + assert((*this).Base().NormalEnabled); + return (*this).Base().NV[(*this).Index()]; } + + const NormalType& cN() const { // you cannot use Normals before enabling them with: yourmesh.face.EnableNormal() assert((*this).Base().NormalEnabled); return (*this).Base().NV[(*this).Index()]; } @@ -518,13 +543,17 @@ public: CurVecType &PD1() { assert((*this).Base().CurvatureDirEnabled); return (*this).Base().CDV[(*this).Index()].max_dir; } CurVecType &PD2() { assert((*this).Base().CurvatureDirEnabled); return (*this).Base().CDV[(*this).Index()].min_dir; } - CurVecType cPD1() const { assert((*this).Base().CurvatureDirEnabled); return (*this).Base().CDV[(*this).Index()].max_dir; } - CurVecType cPD2() const { assert((*this).Base().CurvatureDirEnabled); return (*this).Base().CDV[(*this).Index()].min_dir; } + const CurVecType& PD1() const { assert((*this).Base().CurvatureDirEnabled); return (*this).Base().CDV[(*this).Index()].max_dir; } + const CurVecType& PD2() const { assert((*this).Base().CurvatureDirEnabled); return (*this).Base().CDV[(*this).Index()].min_dir; } + const CurVecType& cPD1() const { assert((*this).Base().CurvatureDirEnabled); return (*this).Base().CDV[(*this).Index()].max_dir; } + const CurVecType& cPD2() const { assert((*this).Base().CurvatureDirEnabled); return (*this).Base().CDV[(*this).Index()].min_dir; } CurScalarType &K1() { assert((*this).Base().CurvatureDirEnabled); return (*this).Base().CDV[(*this).Index()].k1; } CurScalarType &K2() { assert((*this).Base().CurvatureDirEnabled); return (*this).Base().CDV[(*this).Index()].k2; } - CurScalarType cK1() const { assert((*this).Base().CurvatureDirEnabled); return (*this).Base().CDV[(*this).Index()].k1; } - CurScalarType cK2() const { assert((*this).Base().CurvatureDirEnabled); return (*this).Base().CDV[(*this).Index()].k2; } + const CurScalarType& K1() const { assert((*this).Base().CurvatureDirEnabled); return (*this).Base().CDV[(*this).Index()].k1; } + const CurScalarType& K2() const { assert((*this).Base().CurvatureDirEnabled); return (*this).Base().CDV[(*this).Index()].k2; } + const CurScalarType& cK1() const { assert((*this).Base().CurvatureDirEnabled); return (*this).Base().CDV[(*this).Index()].k1; } + const CurScalarType& cK2() const { assert((*this).Base().CurvatureDirEnabled); return (*this).Base().CDV[(*this).Index()].k2; } template void ImportData(const RightFaceType & rightF){ @@ -554,7 +583,11 @@ public: assert((*this).Base().QualityEnabled); return (*this).Base().QV[(*this).Index()]; } - QualityType cQ() const { + const QualityType& Q() const { + assert((*this).Base().QualityEnabled); + return (*this).Base().QV[(*this).Index()]; + } + const QualityType& cQ() const { assert((*this).Base().QualityEnabled); return (*this).Base().QV[(*this).Index()]; } @@ -580,7 +613,11 @@ public: assert((*this).Base()._ColorEnabled); return (*this).Base().CV[(*this).Index()]; } - ColorType cC() const { + const ColorType& C() const { + assert((*this).Base()._ColorEnabled); + return (*this).Base().CV[(*this).Index()]; + } + const ColorType& cC() const { assert((*this).Base()._ColorEnabled); return (*this).Base().CV[(*this).Index()]; } @@ -605,6 +642,10 @@ public: assert((*this).Base().MarkEnabled); return (*this).Base().MV[(*this).Index()]; } + inline int IMark() const { + assert((*this).Base().MarkEnabled); + return (*this).Base().MV[(*this).Index()]; + } inline int cIMark() const { assert((*this).Base().MarkEnabled); return (*this).Base().MV[(*this).Index()]; @@ -628,7 +669,8 @@ public: WedgeTexCoordOcf(){ } typedef A TexCoordType; TexCoordType &WT(const int i) { assert((*this).Base().WedgeTexEnabled); return (*this).Base().WTV[(*this).Index()].wt[i]; } - TexCoordType cWT(const int i) const { assert((*this).Base().WedgeTexEnabled); return (*this).Base().WTV[(*this).Index()].wt[i]; } + const TexCoordType& WT(const int i) const { assert((*this).Base().WedgeTexEnabled); return (*this).Base().WTV[(*this).Index()].wt[i]; } + const TexCoordType& cWT(const int i) const { assert((*this).Base().WedgeTexEnabled); return (*this).Base().WTV[(*this).Index()].wt[i]; } template void ImportData(const RightFaceType & rightF){ if(this->IsWedgeTexCoordEnabled() && rightF.IsWedgeTexCoordEnabled()) @@ -648,7 +690,8 @@ public: WedgeColorOcf(){ } typedef A WedgeColorType; WedgeColorType &WC(const int i) { assert((*this).Base().WedgeColorEnabled); return (*this).Base().WCV[(*this).Index()].wc[i]; } - const WedgeColorType cWC(const int i) const { assert((*this).Base().WedgeColorEnabled); return (*this).Base().WCV[(*this).Index()].wc[i]; } + const WedgeColorType& WC(const int i) const { assert((*this).Base().WedgeColorEnabled); return (*this).Base().WCV[(*this).Index()].wc[i]; } + const WedgeColorType& cWC(const int i) const { assert((*this).Base().WedgeColorEnabled); return (*this).Base().WCV[(*this).Index()].wc[i]; } template void ImportData(const RightFaceType & rightF){ if(this->IsWedgeColorEnabled() && rightF.IsWedgeColorEnabled()) @@ -668,7 +711,8 @@ public: WedgeNormalOcf(){ } typedef A WedgeNormalType; WedgeNormalType &WN(const int i) { assert((*this).Base().WedgeNormalEnabled); return (*this).Base().WNV[(*this).Index()].wn[i]; } - WedgeNormalType const &cWN(const int i) const { assert((*this).Base().WedgeNormalEnabled); return (*this).Base().WNV[(*this).Index()].wn[i]; } + const WedgeNormalType & WN(const int i) const { assert((*this).Base().WedgeNormalEnabled); return (*this).Base().WNV[(*this).Index()].wn[i]; } + const WedgeNormalType &cWN(const int i) const { assert((*this).Base().WedgeNormalEnabled); return (*this).Base().WNV[(*this).Index()].wn[i]; } template void ImportData(const RightFaceType & rightF){ if(this->IsWedgeNormalEnabled() && rightF.IsWedgeNormalEnabled())