From 242e5ab82a2327f5ffb7da4422ac01bbf84e0437 Mon Sep 17 00:00:00 2001 From: cignoni Date: Thu, 3 Apr 2008 23:12:28 +0000 Subject: [PATCH] compacted two pair of empty components to shorten derivation chains --- vcg/simplex/vertexplus/component.h | 52 +++++++++++++----------------- 1 file changed, 23 insertions(+), 29 deletions(-) diff --git a/vcg/simplex/vertexplus/component.h b/vcg/simplex/vertexplus/component.h index 3eb659ef..a2e93c91 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.26 2008/03/17 11:39:14 ganovelli +added curvature and curvatruredir (compiled .net 2005 and gcc) + Revision 1.25 2008/02/05 10:11:34 cignoni A small typo (a T:: instead of TT::) @@ -122,8 +125,8 @@ All the Components that can be added to a vertex should be defined in the namesp */ -/*------------------------- COORD -----------------------------------------*/ -template class EmptyCoord: public T { +/*------------------------- EMPTY COORD & NORMAL -----------------------------------------*/ +template class EmptyCoordNormal: public T { public: typedef vcg::Point3f CoordType; typedef CoordType::ScalarType ScalarType; @@ -132,13 +135,20 @@ public: 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; } + + typedef vcg::Point3s NormalType; + 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 HasNormalOcc() { return false; } template < class LeftV> void ImportLocal(const LeftV & left ) { T::ImportLocal( left); } - static bool HasCoord() { return false; } static void Name(std::vector & name){T::Name(name);} - }; +/*-------------------------- COORD ----------------------------------------*/ + template class Coord: public T { public: typedef A CoordType; @@ -165,18 +175,6 @@ public: static void Name(std::vector & name){name.push_back(std::st /*-------------------------- NORMAL ----------------------------------------*/ -template class EmptyNormal: public T { -public: - typedef vcg::Point3s NormalType; - 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; } - template < class LeftV> - void ImportLocal(const LeftV & left ) { T::ImportLocal( left); } - static bool HasNormal() { return false; } - static bool HasNormalOcc() { return false; } - static void Name(std::vector & name){T::Name(name);} - -}; template class Normal: public T { public: typedef A NormalType; @@ -297,18 +295,24 @@ private: int _flags; }; -/*-------------------------- COLOR ----------------------------------*/ +/*-------------------------- EMPTY COLOR & QUALITY ----------------------------------*/ -template class EmptyColor: public T { +template class EmptyColorQuality: public T { public: + typedef float QualityType; + QualityType &Q() { 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; } template < class LeftV> void ImportLocal(const LeftV & left ) { T::ImportLocal( left); } static bool HasColor() { return false; } static void Name(std::vector & name){T::Name(name);} - }; + +/*-------------------------- Color ----------------------------------*/ + template class Color: public T { public: Color():_color(vcg::Color4b::White) {} @@ -331,16 +335,6 @@ template class Color4b: public vert::Color { /*-------------------------- Quality ----------------------------------*/ -template class EmptyQuality: public T { -public: - typedef float QualityType; - QualityType &Q() { static QualityType dummyQuality(0); assert(0); return dummyQuality; } - template < class LeftV> - void ImportLocal(const LeftV & left ) { T::ImportLocal( left); } - static bool HasQuality() { return false; } - static void Name(std::vector & name){T::Name(name);} - -}; template class Quality: public TT { public: typedef A QualityType;