From 9bc80c05ea57516cb79ba5fd4b8e3c4e2b608917 Mon Sep 17 00:00:00 2001 From: cignoni Date: Tue, 1 Nov 2005 18:17:52 +0000 Subject: [PATCH] Added an assert(0) in all the accesses to empty components --- vcg/simplex/vertexplus/component.h | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/vcg/simplex/vertexplus/component.h b/vcg/simplex/vertexplus/component.h index 68df9517..d423852d 100644 --- a/vcg/simplex/vertexplus/component.h +++ b/vcg/simplex/vertexplus/component.h @@ -24,6 +24,9 @@ History $Log: not supported by cvs2svn $ +Revision 1.10 2005/10/15 16:24:10 ganovelli +Working release (compilata solo su MSVC), component_occ è migrato da component_opt + Revision 1.9 2005/10/14 13:30:07 cignoni Added constant access functions and reflective functions (HasSomething stuff) to all the components This is the first really working version... @@ -75,8 +78,8 @@ public: typedef CoordType::ScalarType ScalarType; CoordType &P() { static CoordType coord(0, 0, 0); return coord; } - const CoordType &P() const { static CoordType coord(0, 0, 0); return coord; } - const CoordType &cP() const { static CoordType coord(0, 0, 0); return coord; } + const CoordType &P() const { static CoordType coord(0, 0, 0); assert(0); return coord; } + const CoordType &cP() const { static CoordType coord(0, 0, 0); assert(0); return coord; } CoordType &UberP() { static CoordType coord(0, 0, 0); return coord; } static bool HasCoord() { return false; } @@ -103,8 +106,8 @@ template class Coord3d: public Coord {}; template class EmptyNormal: public T { public: typedef vcg::Point3s NormalType; - NormalType &N() { static NormalType dummy_normal(0, 0, 0); return dummy_normal; } - const NormalType cN()const { static NormalType dummy_normal(0, 0, 0); return dummy_normal; } + NormalType &N() { static NormalType dummy_normal(0, 0, 0); assert(0); return dummy_normal; } + const NormalType cN()const { static NormalType dummy_normal(0, 0, 0); assert(0); return dummy_normal; } static bool HasNormal() { return false; } static bool HasNormalOpt() { return false; } }; @@ -127,7 +130,7 @@ template class Normal3d: public Normal {}; template class EmptyTexture: public TT { public: typedef vcg::TCoord2 TextureType; - TextureType &T() { static TextureType dummy_texture; return dummy_texture; } + TextureType &T() { static TextureType dummy_texture; assert(0); return dummy_texture; } static bool HasTexture() { return false; } static bool HasTextureOpt() { return false; } @@ -151,7 +154,7 @@ template class EmptyFlag: public T { public: typedef int FlagType; /// Return the vector of Flags(), senza effettuare controlli sui bit - int &Flags() { static int dummyflags(0); return dummyflags; } + int &Flags() { static int dummyflags(0); assert(0); return dummyflags; } const int Flags() const { return 0; } static bool HasFlag() { return false; } @@ -173,7 +176,7 @@ private: template class EmptyColor: public T { public: typedef vcg::Color4b ColorType; - ColorType &C() { static ColorType dumcolor(vcg::Color4b::White); return dumcolor; } + ColorType &C() { static ColorType dumcolor(vcg::Color4b::White); assert(0); return dumcolor; } static bool HasColor() { return false; } }; template class Color: public T { @@ -192,7 +195,7 @@ template class Color4b: public Color {}; template class EmptyQuality: public T { public: typedef float QualityType; - QualityType &Q() { static QualityType dummyQuality(0); return dummyQuality; } + QualityType &Q() { static QualityType dummyQuality(0); assert(0); return dummyQuality; } static bool HasQuality() { return false; } }; template class Quality: public T { @@ -214,8 +217,8 @@ template class Qualityd: public Quality {}; template class EmptyVFAdj: public T { public: - typename T::FacePointer &VFp() { static typename T::FacePointer fp=0; return fp; } - typename T::FacePointer cVFp() { static typename T::FacePointer fp=0; return fp; } + typename T::FacePointer &VFp() { static typename T::FacePointer fp=0; assert(0); return fp; } + typename T::FacePointer cVFp() { static typename T::FacePointer fp=0; assert(0); return fp; } int &VFi(){static int z=0; return z;}; static bool HasVFAdjacency() { return false; } static bool HasVFAdjacencyOpt() { return false; }