From c9b6f8f7c866e2a9ade2cb0aa86cf308429ef6a4 Mon Sep 17 00:00:00 2001 From: ganovelli Date: Fri, 19 Dec 2008 10:31:56 +0000 Subject: [PATCH] --- vcg/simplex/vertex/base.h | 1109 ++++------------- vcg/simplex/vertex/base_old.h | 985 +++++++++++++++ vcg/simplex/vertex/component.h | 610 +++++++++ vcg/simplex/vertex/component_occ.h | 268 ++++ vcg/simplex/vertex/component_ocf.h | 645 ++++++++++ vcg/simplex/vertex/component_sph.h | 58 + vcg/simplex/vertex/{vertex.h => vertex_old.h} | 0 vcg/simplex/vertex/with/ae.h | 23 - vcg/simplex/vertex/with/af.h | 23 - vcg/simplex/vertex/with/afatvcvnvq.h | 35 - vcg/simplex/vertex/with/afvcvmvn.h | 32 - vcg/simplex/vertex/with/afvcvnvq.h | 33 - vcg/simplex/vertex/with/afvm.h | 29 - vcg/simplex/vertex/with/afvmvn.h | 28 - vcg/simplex/vertex/with/afvmvnvq.h | 31 - vcg/simplex/vertex/with/afvn.h | 29 - vcg/simplex/vertex/with/at.h | 23 - vcg/simplex/vertex/with/atvmvn.h | 27 - vcg/simplex/vertex/with/atvn.h | 25 - vcg/simplex/vertex/with/atvnvm.h | 27 - vcg/simplex/vertex/with/readme.txt | 53 - vcg/simplex/vertex/with/vc.h | 26 - vcg/simplex/vertex/with/vcvmvnvq.h | 27 - vcg/simplex/vertex/with/vcvmvnvt.h | 32 - vcg/simplex/vertex/with/vcvn.h | 28 - vcg/simplex/vertex/with/vcvnvq.h | 25 - vcg/simplex/vertex/with/vcvq.h | 23 - vcg/simplex/vertex/with/vm.h | 27 - vcg/simplex/vertex/with/vmvn.h | 28 - vcg/simplex/vertex/with/vmvnvt.h | 30 - vcg/simplex/vertex/with/vn.h | 25 - vcg/simplex/vertex/with/vnvq.h | 23 - vcg/simplex/vertex/with/vnvt.h | 27 - vcg/simplex/vertex/with/vq.h | 21 - 34 files changed, 2774 insertions(+), 1661 deletions(-) create mode 100644 vcg/simplex/vertex/base_old.h create mode 100644 vcg/simplex/vertex/component.h create mode 100644 vcg/simplex/vertex/component_occ.h create mode 100644 vcg/simplex/vertex/component_ocf.h create mode 100644 vcg/simplex/vertex/component_sph.h rename vcg/simplex/vertex/{vertex.h => vertex_old.h} (100%) delete mode 100644 vcg/simplex/vertex/with/ae.h delete mode 100644 vcg/simplex/vertex/with/af.h delete mode 100644 vcg/simplex/vertex/with/afatvcvnvq.h delete mode 100644 vcg/simplex/vertex/with/afvcvmvn.h delete mode 100644 vcg/simplex/vertex/with/afvcvnvq.h delete mode 100644 vcg/simplex/vertex/with/afvm.h delete mode 100644 vcg/simplex/vertex/with/afvmvn.h delete mode 100644 vcg/simplex/vertex/with/afvmvnvq.h delete mode 100644 vcg/simplex/vertex/with/afvn.h delete mode 100644 vcg/simplex/vertex/with/at.h delete mode 100644 vcg/simplex/vertex/with/atvmvn.h delete mode 100644 vcg/simplex/vertex/with/atvn.h delete mode 100644 vcg/simplex/vertex/with/atvnvm.h delete mode 100644 vcg/simplex/vertex/with/readme.txt delete mode 100644 vcg/simplex/vertex/with/vc.h delete mode 100644 vcg/simplex/vertex/with/vcvmvnvq.h delete mode 100644 vcg/simplex/vertex/with/vcvmvnvt.h delete mode 100644 vcg/simplex/vertex/with/vcvn.h delete mode 100644 vcg/simplex/vertex/with/vcvnvq.h delete mode 100644 vcg/simplex/vertex/with/vcvq.h delete mode 100644 vcg/simplex/vertex/with/vm.h delete mode 100644 vcg/simplex/vertex/with/vmvn.h delete mode 100644 vcg/simplex/vertex/with/vmvnvt.h delete mode 100644 vcg/simplex/vertex/with/vn.h delete mode 100644 vcg/simplex/vertex/with/vnvq.h delete mode 100644 vcg/simplex/vertex/with/vnvt.h delete mode 100644 vcg/simplex/vertex/with/vq.h diff --git a/vcg/simplex/vertex/base.h b/vcg/simplex/vertex/base.h index 5920bf62..4a971304 100644 --- a/vcg/simplex/vertex/base.h +++ b/vcg/simplex/vertex/base.h @@ -22,342 +22,180 @@ ****************************************************************************/ /**************************************************************************** History -$Log: not supported by cvs2svn $ -Revision 1.30 2007/02/26 14:21:44 turini -VTb moved to VTp - -Revision 1.29 2007/02/20 14:08:34 ganovelli -added QualityType to comply vertexplus type - -Revision 1.28 2006/08/23 15:34:20 marfr960 -added minimal comments - -Revision 1.26 2005/11/12 18:41:14 cignoni -Added HasFlags and initialization of flags at construction. - -Revision 1.25 2005/10/14 13:25:50 cignoni -Added cVFp member - -Revision 1.24 2005/10/06 14:26:39 pietroni -added getBBox method - -Revision 1.23 2005/03/18 16:38:36 fiorin -Minor changes - -Revision 1.22 2005/03/18 00:13:45 cignoni -Removed NormalizedNormalV (out of standard and wrong) and -added the member functions Normal and NormalizedNormal() (just like for faces) - -Revision 1.21 2004/10/28 00:50:49 cignoni -Better Doxygen documentation - -Revision 1.20 2004/10/11 17:45:05 ganovelli -added template on corrdinate type (default Point3) - -Revision 1.19 2004/09/28 15:24:56 fiorin -DUMMY classes definition moved into vcg namespace - -Revision 1.18 2004/08/25 15:15:27 ganovelli -minor changes to comply gcc compiler (typename's and stuff) - -Revision 1.17 2004/07/20 15:24:53 pietroni -corrected NormalizedNormalV function... - -Revision 1.16 2004/07/15 11:25:01 ganovelli -VFb moved to VFp, userbit to bitflag,setV, inclusion of pos.h - -Revision 1.15 2004/07/15 10:13:48 pietroni -adde NormalizedNormalV funtion to compute the normal on a vertex - -Revision 1.14 2004/05/13 22:44:40 ganovelli -syntax error (typo) - -Revision 1.13 2004/05/13 22:40:02 ganovelli -default template parameters - -Revision 1.12 2004/05/13 12:49:22 pietroni -no default template parameters... each one must be specified - -Revision 1.12 2004/05/10 13:31:13 ganovelli -function for edge adjacency added $Log: not supported by cvs2svn $ -Revision 1.30 2007/02/26 14:21:44 turini -VTb moved to VTp +Revision 1.12 2008/03/17 11:39:14 ganovelli +added curvature and curvatruredir (compiled .net 2005 and gcc) -Revision 1.29 2007/02/20 14:08:34 ganovelli -added QualityType to comply vertexplus type +Revision 1.11 2008/02/04 21:26:49 ganovelli +added ImportLocal which imports all local attributes into vertexplus and faceplus. +A local attribute is everything (N(), C(), Q()....) except pointers to other simplices +(i.e. FFAdj, VFAdj, VertexRef) which are set to NULL. +Added some function for const attributes -Revision 1.28 2006/08/23 15:34:20 marfr960 -added minimal comments +Revision 1.10 2007/03/12 15:37:21 tarini +Texture coord name change! "TCoord" and "Texture" are BAD. "TexCoord" is GOOD. -Revision 1.26 2005/11/12 18:41:14 cignoni -Added HasFlags and initialization of flags at construction. +Revision 1.9 2007/02/12 19:00:56 ganovelli +added Name(std:vector& n) that fills n with the names of the attribute of the vertex type -Revision 1.25 2005/10/14 13:25:50 cignoni -Added cVFp member +Revision 1.8 2006/09/28 17:34:11 cignoni +Added Missing GetBBox function -Revision 1.24 2005/10/06 14:26:39 pietroni -added getBBox method +Revision 1.7 2006/02/27 17:42:43 ponchio +Added some documentation. -Revision 1.23 2005/03/18 16:38:36 fiorin -Minor changes +Revision 1.6 2005/12/05 15:58:10 cignoni +Removed spurious definition of flags in Aritymax that was overriding the correct definition in EmplyBitFlags and BitFlags classes -Revision 1.22 2005/03/18 00:13:45 cignoni -Removed NormalizedNormalV (out of standard and wrong) and -added the member functions Normal and NormalizedNormal() (just like for faces) +Revision 1.5 2005/12/02 00:44:41 cignoni +Reformatted and compacted flags code. -Revision 1.21 2004/10/28 00:50:49 cignoni -Better Doxygen documentation +Revision 1.4 2005/11/16 22:59:35 cignoni +Standardized name of flags. It is plural becouse each simplex has many flag. -Revision 1.20 2004/10/11 17:45:05 ganovelli -added template on corrdinate type (default Point3) +Revision 1.3 2005/11/12 18:36:51 cignoni +Added 'Visited' flag functions -Revision 1.19 2004/09/28 15:24:56 fiorin -DUMMY classes definition moved into vcg namespace +Revision 1.2 2004/04/03 13:33:55 cignoni +Missing include -Revision 1.18 2004/08/25 15:15:27 ganovelli -minor changes to comply gcc compiler (typename's and stuff) +Revision 1.1 2004/03/29 08:36:26 cignoni +First working version! -Revision 1.17 2004/07/20 15:24:53 pietroni -corrected NormalizedNormalV function... - -Revision 1.16 2004/07/15 11:25:01 ganovelli -VFb moved to VFp, userbit to bitflag,setV, inclusion of pos.h - -Revision 1.15 2004/07/15 10:13:48 pietroni -adde NormalizedNormalV funtion to compute the normal on a vertex - -Revision 1.14 2004/05/13 22:44:40 ganovelli -syntax error (typo) - -Revision 1.13 2004/05/13 22:40:02 ganovelli -default template parameters - -Revision 1.12 2004/05/13 12:49:22 pietroni -no default template parameters... each one must be specified - -Revision 1.11 2004/05/10 13:31:13 ganovelli -function for edge adjacency added - -Revision 1.10 2004/05/10 13:13:17 cignoni -added void to Convert, corrected return object in VFp - -Revision 1.9 2004/05/06 15:28:10 pietroni -changed names to VF topology function (was missed) - -Revision 1.8 2004/05/05 17:03:25 pietroni -changed name to topology functions - -Revision 1.7 2004/04/28 11:37:14 pietroni -*** empty log message *** - -Revision 1.6 2004/04/26 09:40:15 pietroni -*** empty log message *** - -Revision 1.6 2004/04/23 14:55:06 pietroni -conversion funtion - -Revision 1.5 2004/03/10 00:59:06 cignoni -minor changes - -Revision 1.4 2004/03/03 16:07:57 cignoni -Yet another cr lf mismatch - -Revision 1.3 2004/02/24 21:36:39 cignoni -grouped documentation, changed typenames and reflection mechanism - -Revision 1.2 2004/02/13 02:09:39 cignoni -First working release, with doxygen comment structure - -Revision 1.1 2004/02/10 01:11:28 cignoni -Edited Comments and GPL license ****************************************************************************/ +#ifndef __VCG_VERTEX_PLUS +#define __VCG_VERTEX_PLUS - -#ifndef VERTEX_TYPE -#pragma message("\nYou should never directly include this file\_n") -#else - -#pragma message("VCGLIB Warning: this way to define the simplex vertex is DEPRECATED and no more SUPPORTED") -#pragma message("VCGLIB Warning: use vcg/simplex/vertexplus instead ") - -#include -#include -#include -#include -#include - +//#include +#include +#include +#include +#include namespace vcg { - class DUMMYFACETYPE; - class DUMMYEDGETYPE; - class DUMMYTETRATYPE; -/** \addtogroup vertex */ -//@{ -/*! - * This class represent the generic configurable Vertex; - * Usually you never direclty use this class with this name but you build - * your own type by directly including one of the .h files under the face/with - * directory. Each file specify a class type with the desired fields. So for example - * including 'vcg/simplex/vertex/with/VCVN.h' allow you to use the class VertVCVN that has per-vertex color and normal stored inside. - */ -template , class CoordTYPE= Point3 > -class VERTEX_TYPE -{ +/*------------------------------------------------------------------*/ +/* +The base class of all the recusive definition chain. It is just a container of the typenames of the various simplexes. +These typenames must be known form all the derived classes. +*/ + +template +class VertexTypeHolder{ + public: + typedef BVT VertType; + typedef BET EdgeType; + typedef BFT FaceType; + typedef BTT TetraType; + typedef BVT *VertPointer; + typedef BET *EdgePointer; + typedef BFT *FacePointer; + typedef BTT *TetraPointer; + template < class LeftV> + void ImportLocal(const LeftV & /* left */ ) { } + static void Name(std::vector & name){} + +}; + +/* The base class form which we start to add our components. +it has the empty definition for all the standard members (coords, color flags) +Note: +in order to avoid both virtual classes and ambiguous definitions all +the subsequent overrides must be done in a sequence of derivation. + +In other words we cannot derive and add in a single derivation step +(with multiple ancestor), both the real (non-empty) normal and color but +we have to build the type a step a time (deriving from a single ancestor at a time). + + +*/ +template +class VertexBase: public vertex::EmptyTexCoord< + vertex::EmptyVFAdj< + vertex::EmptyVEAdj< + vertex::EmptyColorQuality< + vertex::EmptyBitFlags< + vertex::EmptyCoordNormal< + vertex::EmptyCurvatureData< + vertex::EmptyRadius< + VertexTypeHolder > > > > > > > >{ +}; + + +/* The Real Big Vertex class; + +The class __VertexArityMax__ is the one that is the Last to be derived, +and therefore is the only one to know the real members +(after the many overrides) so all the functions with common behaviour +using the members defined in the various Empty/nonEmpty component classes +MUST be defined here. + +I.e. IsD() that uses the overridden Flags() member must be defined here. + +*/ + +template class A, template class B, + template class C, template class D, + template class E, template class F, + template class G, template class H, + template class I, template class J, + template class K, template class L> +class VertexArityMax: public Arity12 { + +// ----- Flags stuff ----- public: + - /// The scalar type used to represent coords (i.e. float, double, ...) - typedef FLTYPE ScalarType; - /// The coordinate type used to represent the point (i.e. Point3f, Point3d, ...) - typedef CoordTYPE CoordType; - typedef Point3 NormalType; - /// The type base of the vertex, useful for recovering the original typename after user subclassing - typedef VERTEX_TYPE BaseVertexType; - /// The type of the face pointed by the vertex if vertex edge topology is present - typedef VETYPE EdgeType; - /// The type base of the vertex, useful for recovering the original typename after user subclassing - typedef VFTYPE FaceType; - /// The type of the quality (same as scalar) - typedef ScalarType QualityType; - - -/***********************************************/ -/** @name Vertex Coords - blah - blah -**/ - //@{ -protected: - /// Spatial coordinates of the vertex - CoordType _p; - -public: - /// Return the spatial coordinate of the vertex - inline CoordType & P() - { - assert( (_flags & DELETED) == 0 ); - assert( (_flags & NOTREAD) == 0 ); - assert( (_flags & NOTWRITE) == 0 ); - return _p; - } - - /// Return the constant spatial coordinate of the vertex - inline const CoordType & P() const - { - assert( (_flags & DELETED) == 0 ); - assert( (_flags & NOTREAD) == 0 ); - return _p; - } - - /// Return the constant spatial coordinate of the vertex - inline const CoordType & cP() const - { - assert( (_flags & DELETED) == 0 ); - assert( (_flags & NOTREAD) == 0 ); - return _p; - } - - /// Return the spatial coordinate of the vertex, senza effettuare controlli sul flag - inline CoordType & UberP() - { - return _p; - } - - /// Return the constant spatial coordinate of the vertex, senza effettuare controlli sul flag - inline const CoordType & UberP() const - { - return _p; - } - - //@} - -/***********************************************/ -/** @name Vertex Flags -For each vertex we store a set of boolean values packed in a int. -The default value for each flag is 0. Most commonly used flags are the \a deleted and the \a selected ones. -Users can ask and dispose for a bit for their own purposes with the vcg::VertexFull::NewUserBit() and vcg::VertexFull::DeleteUserBit() functions. -The value returned by these functions has to be passed to the -vcg::VertexFull::SetUserBit() vcg::VertexFull::ClearUserBit() and vcg::VertexFull::IsUserBit() functions to check and modify the obtained bit flag. - -**/ -//@{ - -protected: - /// This are the flags of vertex, the default (reasonable) value is 0 - int _flags; - -public: - /// Return the vector of _flags - inline int & Flags () - { - assert( (_flags & DELETED) == 0 ); - assert( (_flags & NOTREAD) == 0 ); - return _flags; - } - - /// Return the vector of _flags, senza effettuare controlli sui bit - inline int & UberFlags () - { - return _flags; - } - inline const int UberFlags() const - { - return _flags; - } - - /// checks if the vertex is deleted - bool IsD() const {return (_flags & DELETED) != 0;} - /// checks if the vertex is readable - bool IsR() const {return (_flags & NOTREAD) == 0;} - /// checks if the vertex is modifiable - bool IsW() const {return (_flags & NOTWRITE)== 0;} - /// This funcion checks whether the vertex is both readable and modifiable - bool IsRW() const {return (_flags & (NOTREAD | NOTWRITE)) == 0;} - /// checks if the vertex is Modified - bool IsS() const {return (_flags & SELECTED) != 0;} - /// checks if the vertex is readable - bool IsB() const {return (_flags & BORDER) != 0;} - /// checks if the vertex is visited - bool IsV() const {return (_flags & VISITED) != 0;} + enum { + + DELETED = 0x0001, // This bit indicate that the vertex is deleted from the mesh + NOTREAD = 0x0002, // This bit indicate that the vertex of the mesh is not readable + NOTWRITE = 0x0004, // This bit indicate that the vertex is not modifiable + MODIFIED = 0x0008, // This bit indicate that the vertex is modified + VISITED = 0x0010, // This bit can be used to mark the visited vertex + SELECTED = 0x0020, // This bit can be used to select + BORDER = 0x0100, // Border Flag + USER0 = 0x0200 // First user bit + }; + inline int & UberFlags () { return this->Flags(); } + inline const 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 + bool IsW() const {return (this->Flags() & NOTWRITE)== 0;}/// checks if the vertex is modifiable + bool IsRW() const {return (this->Flags() & (NOTREAD | NOTWRITE)) == 0;}/// This funcion checks whether the vertex is both readable and modifiable + bool IsS() const {return (this->Flags() & SELECTED) != 0;}/// checks if the vertex is Selected + bool IsB() const {return (this->Flags() & BORDER) != 0;}/// checks if the vertex is a border one + bool IsV() const {return (this->Flags() & VISITED) != 0;}/// checks if the vertex Has been visited + /** Set the flag value @param flagp Valore da inserire nel flag */ - void SetFlags(int flagp) {_flags=flagp;} + void SetFlags(int flagp) {this->Flags()=flagp;} /** Set the flag value @param flagp Valore da inserire nel flag */ - void ClearFlags() {_flags=0;} - - /// deletes the vertex from the mesh - void SetD() {_flags |=DELETED;} - /// un-delete a vertex - void ClearD() {_flags &=(~DELETED);} - /// marks the vertex as readable - void SetR() {_flags &=(~NOTREAD);} - /// marks the vertex as not readable - void ClearR() {_flags |=NOTREAD;} - /// marks the vertex as writable - void ClearW() {_flags |=NOTWRITE;} - /// marks the vertex as not writable - void SetW() {_flags &=(~NOTWRITE);} - /// select the vertex - void SetS() {_flags |=SELECTED;} - /// Un-select a vertex - void ClearS() {_flags &= ~SELECTED;} - /// Set vertex as ob border - void SetB() {_flags |=BORDER;} - void ClearB() {_flags &=~BORDER;} - /// checks if the vertex is visited - void ClearV() {_flags &= ~VISITED;} - /// checks if the vertex is visited - void SetV() {_flags |=VISITED;} - /// Return the first bit that is not still used + void ClearFlags() {this->Flags()=0;} + void SetD() {this->Flags() |=DELETED;}/// deletes the vertex from the mesh + void ClearD() {this->Flags() &=(~DELETED);}/// un-delete a vertex + void SetR() {this->Flags() &=(~NOTREAD);}/// marks the vertex as readable + void ClearR() {this->Flags() |=NOTREAD;}/// marks the vertex as not readable + void ClearW() {this->Flags() |=NOTWRITE;}/// marks the vertex as writable + void SetW() {this->Flags() &=(~NOTWRITE);}/// marks the vertex as not writable + void SetS() {this->Flags() |=SELECTED;}/// select the vertex + void ClearS() {this->Flags() &= ~SELECTED;}/// Un-select a vertex + void SetB() {this->Flags() |=BORDER;} + void ClearB() {this->Flags() &=~BORDER;} + void SetV() {this->Flags() |=VISITED;} + void ClearV() {this->Flags() &=~VISITED;} + +/// Return the first bit that is not still used static int &LastBitFlag() { static int b =USER0; @@ -381,605 +219,74 @@ static inline bool DeleteBitFlag(int bitval) return false; } /// This function checks if the given user bit is true - bool IsUserBit(int userBit){return (_flags & userBit) != 0;} + bool IsUserBit(int userBit){return (this->Flags() & userBit) != 0;} /// This function set the given user bit - void SetUserBit(int userBit){_flags |=userBit;} + void SetUserBit(int userBit){this->Flags() |=userBit;} /// This function clear the given user bit - void ClearUserBit(int userBit){_flags &= (~userBit);} - - - //@} - - -/*#******************* -* Bounding box * -**********************/ + void ClearUserBit(int userBit){this->Flags() &= (~userBit);} -void GetBBox( Box3 & bb ) const -{ - bb.Set( cP() ); -} + template + void GetBBox( BoxType & bb ) const + { bb.Set(this->P()); } -/***********************************************/ -/** @name Vertex Texture Coords - blah - blah - **/ -//@{ + }; -#ifdef __VCGLIB_VERTEX_VT -protected: - TCTYPE _t; + +/* + +These are the three main classes that are used by the library user to define its own vertexes. +The user MUST specify the names of all the type involved in a generic complex. +so for example when defining a vertex of a trimesh you must know the name of the type of the edge and of the face. +Typical usage example: + +A vertex with coords, flags and normal for use in a standard trimesh: + +class VertexNf : public VertexSimp2< VertexNf, EdgeProto, FaceProto, vert::Coord3d, vert::Flag, vert::Normal3f > {}; + + +A vertex with coords, and normal for use in a tetrahedral mesh AND in a standard trimesh: + +class TetraVertex : public VertexSimp3< TetraVertex, EdgeProto, FaceProto, TetraProto, vert::Coord3d, vert::Normal3f > {}; + + +A summary of the available vertex attributes (see component.h for more details): + +Coord3f, Coord3d, +Normal3s, Normal3f, Normal3d +Mark //a int component (incremental mark) +BitFlags +TexCoord2s, TexCoord2f, TexCoord2d +Color4b +Qualitys, Qualityf, Qualityd +VFAdj //topology (vertex->face adjacency) +*/ + +template class A = DefaultDeriver, template class B = DefaultDeriver, + template class C = DefaultDeriver, template class D = DefaultDeriver, + template class E = DefaultDeriver, template class F = DefaultDeriver, + template class G = DefaultDeriver, template class H = DefaultDeriver, + template class I = DefaultDeriver, template class J = DefaultDeriver, + template class K = DefaultDeriver, template class L = DefaultDeriver> + class VertexSimp3: public VertexArityMax {}; + +template class A = DefaultDeriver, template class B = DefaultDeriver, + template class C = DefaultDeriver, template class D = DefaultDeriver, + template class E = DefaultDeriver, template class F = DefaultDeriver, + template class G = DefaultDeriver, template class H = DefaultDeriver, + template class I = DefaultDeriver, template class J = DefaultDeriver, + template class K = DefaultDeriver, template class L = DefaultDeriver> + class VertexSimp2: public VertexArityMax {}; + +template class A = DefaultDeriver, template class B = DefaultDeriver, + template class C = DefaultDeriver, template class D = DefaultDeriver, + template class E = DefaultDeriver, template class F = DefaultDeriver, + template class G = DefaultDeriver, template class H = DefaultDeriver, + template class I = DefaultDeriver, template class J = DefaultDeriver, + template class K = DefaultDeriver, template class L = DefaultDeriver> + class VertexSimp1: public VertexArityMax {}; + +}// end namespace #endif - -public: - TCTYPE & T() - { -#ifdef __VCGLIB_VERTEX_VT - return _t; -#else - assert(0); - return *(TCTYPE*)(&_flags); -#endif - } - - const TCTYPE & T() const - { -#ifdef __VCGLIB_VERTEX_VT - return _t; -#else - assert(0); - return *(TCTYPE*)(&_flags); -#endif - } - -//@} - -/***********************************************/ -/** @name Per vertex Color - blah - blah - **/ -//@{ - -#ifdef __VCGLIB_VERTEX_VC -protected: - Color4b _c; -#endif - -public: - Color4b & C() - { -#ifdef __VCGLIB_VERTEX_VC - return _c; -#else - assert(0); - return *(Color4b*)(&_flags); -#endif - } - - const Color4b & C() const - { -#ifdef __VCGLIB_VERTEX_VC - return _c; -#else - return Color4b(Color4b::White); -#endif - } - //@} - -/***********************************************/ -/** @name Vertex Quality - blah - blah - **/ - //@{ - -#ifdef __VCGLIB_VERTEX_VQ -protected: - float _q; -#endif - -public: - float & Q() - { -#ifdef __VCGLIB_VERTEX_VQ - return _q; -#else - assert(0); - return *(float*)(&_flags); -#endif - } - - const float & Q() const - { -#ifdef __VCGLIB_VERTEX_VQ - return _q; -#else - return 1; -#endif - } - //@} -/** @name Vertex-Edge Adjacency - blah - blah - **/ - //@{ - -#if ((defined __VCGLIB_VERTEX_EA) || (defined __VCGLIB_VERTEX_EAS)) - // Puntatore ad un edge appartenente alla stella del vertice, implementa l'adiacenza vertice-edge -protected: - EdgeType *_ep; - int _ei; -#endif - -public: -inline EdgeType * & VEp() - { -#if ((defined __VCGLIB_VERTEX_EA) || (defined __VCGLIB_VERTEX_EAS)) - return _ep; -#else - assert(0);// you are probably trying to use VF topology in a vertex without it - return *((EdgeType **)(_flags)); -#endif - } - -inline const EdgeType * & VEp() const - { -#if ((defined __VCGLIB_VERTEX_EA) || (defined __VCGLIB_VERTEX_EAS)) - return _ep; -#else - assert(0);// you are probably trying to use VF topology in a vertex without it - return (EdgeType *)this; -#endif - } - -inline int & VEi() - { -#if ((defined __VCGLIB_VERTEX_EA) || (defined __VCGLIB_VERTEX_EAS)) - - return _ei; -#else - assert(0);// you are probably trying to use VF topology in a vertex without it - return _flags; -#endif - } - -inline const int & VEi() const - { -#if ((defined __VCGLIB_VERTEX_EA) || (defined __VCGLIB_VERTEX_EAS)) - return _ei; -#else - assert(0);// you are probably trying to use VF topology in a vertex without it - return (void *)this; -#endif - } - //@} -/***********************************************/ -/** @name Vertex-Face Adjacency - blah - blah - **/ - //@{ - -#if ((defined __VCGLIB_VERTEX_AF) || (defined __VCGLIB_VERTEX_AFS)) - // Puntatore ad una faccia appartenente alla stella del vertice, implementa l'adiacenza vertice-faccia -protected: - VFTYPE *_vfb; - int _vfi; -#endif - -public: -inline VFTYPE * & VFp() - { -#if ((defined __VCGLIB_VERTEX_AF) || (defined __VCGLIB_VERTEX_AFS)) - return _vfb; -#else - assert(0);// you are probably trying to use VF topology in a vertex without it - static VFTYPE *dum; - return dum; -#endif - } - -inline const VFTYPE * & VFp() const - { -#if ((defined __VCGLIB_VERTEX_AF) || (defined __VCGLIB_VERTEX_AFS)) - return _vfb; -#else - assert(0);// you are probably trying to use VF topology in a vertex without it - return (VFTYPE *)0; -#endif - } - -inline const VFTYPE * cVFp() const - { -#if ((defined __VCGLIB_VERTEX_AF) || (defined __VCGLIB_VERTEX_AFS)) - return _vfb; -#else - assert(0);// you are probably trying to use VF topology in a vertex without it - return (VFTYPE *)0; -#endif - } - -inline int & VFi() - { -#if ((defined __VCGLIB_VERTEX_AF) || (defined __VCGLIB_VERTEX_AFS)) - - return _vfi; -#else - assert(0);// you are probably trying to use VF topology in a vertex without it - return _flags; -#endif - } - -inline const int & VFi() const - { -#if ((defined __VCGLIB_VERTEX_AF) || (defined __VCGLIB_VERTEX_AFS)) - return _vfi; -#else - assert(0);// you are probably trying to use VF topology in a vertex without it - return (void *)this; -#endif - } - - - - //@} - - /***********************************************/ -/** @name Vertex-Tetrahedron Adjacency - blah - blah - **/ - //@{ - -#if ((defined __VCGLIB_VERTEX_AT) || (defined __VCGLIB_VERTEX_ATS)) - // Pointer to first tetrahedron of the start implements the Vertex-Tetrahedron Topology -protected: - VTTYPE *_vtp; - int _vti; -#endif - -public: -inline VTTYPE * & VTp() - { -#if ((defined __VCGLIB_VERTEX_AT) || (defined __VCGLIB_VERTEX_ATS)) - return _vtp; -#else - assert(0);// you are probably trying to use VF topology in a vertex without it - return *((VTTYPE **)(_flags)); -#endif - } - -inline const VTTYPE * & VTp() const - { -#if ((defined __VCGLIB_VERTEX_AT) || (defined __VCGLIB_VERTEX_ATS)) - return _vtp; -#else - assert(0);// you are probably trying to use VF topology in a vertex without it - return (VTTYPE *)this; -#endif - } - -inline int & VTi() - { -#if ((defined __VCGLIB_VERTEX_AT) || (defined __VCGLIB_VERTEX_ATS)) - - return _vti; -#else - assert(0);// you are probably trying to use VF topology in a vertex without it - return _flags; -#endif - } - -inline const int & VTi() const - { -#if ((defined __VCGLIB_VERTEX_AT) || (defined __VCGLIB_VERTEX_ATS)) - return _vti; -#else - assert(0);// you are probably trying to use VF topology in a vertex without it - return (void *)this; -#endif - } - - - - //@} - -/***********************************************/ -/** @name Vertex Incremental Mark - blah - blah - **/ - //@{ - -#ifdef __VCGLIB_VERTEX_VM -protected: - /// The incremental vertex mark - int _imark; -#endif // Mark -public: -#ifdef __VCGLIB_VERTEX_VM - /// This function return the vertex incremental mark - inline int & IMark() - { - assert( (_flags & DELETED) == 0 ); - assert( (_flags & NOTREAD) == 0 ); - assert( (_flags & NOTWRITE) == 0 ); - return _imark; - } - - /// This function return the constant vertex incremental mark - inline const int & IMark() const - { - assert( (_flags & DELETED) == 0 ); - assert( (_flags & NOTREAD) == 0 ); - return _imark; - } -#endif - - /// Initialize the _imark system of the vertex - inline void InitIMark() - { -#ifdef __VCGLIB_VERTEX_VM - _imark = 0; -#endif - } - - //@} - - /***********************************************/ - /** @name Vertex Normal - blah - blah - **/ - //@{ - -#ifdef __VCGLIB_VERTEX_VN -protected: - CoordType _n; -#endif - -public: - /// Return the vertex normal - inline CoordType & N() - { - assert( (_flags & DELETED) == 0 ); - assert( (_flags & NOTREAD) == 0 ); - assert( (_flags & NOTWRITE) == 0 ); -#ifdef __VCGLIB_VERTEX_VN - return _n; -#else - assert(0); - return *(CoordType *)this; -#endif - } - - /// Return the constant vertex normal - inline const CoordType & N() const - { - assert( (_flags & DELETED) == 0 ); - assert( (_flags & NOTREAD) == 0 ); -#ifdef __VCGLIB_VERTEX_VN - return _n; -#else - assert(0); - return *(CoordType *)this; -#endif - } - - inline const CoordType cN() const - { - assert( (_flags & DELETED) == 0 ); - assert( (_flags & NOTREAD) == 0 ); -#ifdef __VCGLIB_VERTEX_VN - return _n; -#else - return CoordType(0,0,0); -#endif - } - /// Return the Normal of the vertex - inline CoordType & UberN() - { -#ifdef __VCGLIB_VERTEX_VN - return _n; -#else - assert(0); - return *(CoordType *)this; -#endif - } - - /// Return the constant normal of the vertex - inline const CoordType & UberN() const - { -#ifdef __VCGLIB_VERTEX_VN - return _n; -#else - assert(0); - return *(CoordType *)this; -#endif - } - -template -const CoordType GenericNormal() -{ - if (!HasVFAdjacency()) - { - assert(0); - return (VERTEX_TYPE::CoordType (0,0,0)); - } - else - { - vcg::face::VFIterator VFi=vcg::face::VFIterator(); - VFi.f=VFp(); - VFi.z=VFi(); - typename VERTEX_TYPE::CoordType N= typename VERTEX_TYPE::CoordType(0,0,0); - while (!VFi.End()) - { - N+=VFi.f->Normal(); - VFi++; - } - if(NormalizeFlag) N.Normalize(); - return N; - } -} - -/// Return the un-normalized value of the vertex normal as it correspond to the current geometry. -/// It is always computed and never use any stored value. -/// REQUIRES vertex-face topology -const CoordType Normal() { return GenericNormal(); } - -/// Return the normalized value of the vertex normal as it correspond to the current geometry. -/// It is always computed and never use any stored value. -/// REQUIRES vertex-face topology -const CoordType NormalizedNormal() { return GenericNormal(); } - - - //@} - - /***********************************************/ - /** @name Reflection Functions - Static functions that give information about the current vertex type. -Reflection is a mechanism making it possible to investigate yourself. Reflection is used to investigate format of objects at runtime, invoke methods and access fields of these objects. Here we provide static const functions that are resolved at compile time and they give information about the data (normal, color etc.) supported by the current vertex type. - **/ - //@{ - -static bool HasFlags() { // Note the plural because ONE vertex has many Flags (but just one color, normal, mark, quality ecc.) - return true; -} - -static bool HasNormal() { -#ifdef __VCGLIB_VERTEX_VN - return true; -#else - return false; -#endif -} -static bool HasColor() { -#ifdef __VCGLIB_VERTEX_VC - return true; -#else - return false; -#endif -} -static bool HasMark() { -#ifdef __VCGLIB_VERTEX_VM - return true; -#else - return false; -#endif -} -static bool HasQuality() { -#ifdef __VCGLIB_VERTEX_VQ - return true; -#else - return false; -#endif -} -static bool HasTexCoord() { -#ifdef __VCGLIB_VERTEX_VT - return true; -#else - return false; -#endif -} -static bool HasVFAdjacency() { -#ifdef __VCGLIB_VERTEX_AF - return true; -#else - return false; -#endif -} -static bool HasVTAdjacency() { -#ifdef __VCGLIB_VERTEX_AT - return true; -#else - return false; -#endif -} - -static bool HasVEAdjacency() { -#ifdef __VCGLIB_VERTEX_EA - return true; -#else - return false; -#endif -} - //@} - -/***********************************************/ - /** @Conversion to other vertex - **/ - //@{ - -template -inline void Convert( VERT_TYPE &v ) -{ - P()=v.P(); - Flags()=v.Flags(); - if ((HasNormal())&&(v.HasNormal())) - N()=v.N(); - if ((HasColor())&&(v.HasColor())) - C()=v.C(); -#ifdef __VCGLIB_VERTEX_VM - if ((HasMark())&&(v.HasMark())) - IMark()=v.IMark(); -#endif - if ((HasQuality())&&(v.HasQuality())) - Q()=v.Q(); - if ((HasTexCoord())&&(v.HasTexCoord())) - T()=v.T(); -} - - //@} - - enum { - // This bit indicate that the vertex is deleted from the mesh - DELETED = 0x0001, // cancellato - // This bit indicate that the vertex of the mesh is not readable - NOTREAD = 0x0002, // non leggibile (ma forse modificabile) - // This bit indicate that the vertex is not modifiable - NOTWRITE = 0x0004, // non modificabile (ma forse leggibile) - // This bit indicate that the vertex is modified - MODIFIED = 0x0008, // modificato - // This bit can be used to mark the visited vertex - VISITED = 0x0010, // Visited - // This bit can be used to select - SELECTED = 0x0020, // Selection flag - // Border Flag - BORDER = 0x0100, - // First user bit - USER0 = 0x0200 // Fisrt user bit - }; - - - /** Return the i-th spatial value of the vertex coordinate. - @param i Index of the spatial vertex coordinate (x=0 y=1 z=2). - */ - inline ScalarType & operator [] ( const int i ){ - assert(i>=0 && i<3); - return P().V(i); - } - /** Return the i-th spatial value of the const vertex coordinate. - @param i Index of the spatial vertex coordinate (x=0 y=1 z=2). - */ - inline const FLTYPE & operator [] ( const int i ) const { - assert(i>=0 && i<3); - return P().V(i); - } - /// Operator to compare two vertices using lexicographic order - inline bool operator < ( const VERTEX_TYPE & ve) const { - return _p < ve._p; - } - inline VERTEX_TYPE() { -//#ifdef _DEBUG - _flags=0; -//#endif - }; - -}; - -//@} -} // end namespace -#endif - diff --git a/vcg/simplex/vertex/base_old.h b/vcg/simplex/vertex/base_old.h new file mode 100644 index 00000000..5920bf62 --- /dev/null +++ b/vcg/simplex/vertex/base_old.h @@ -0,0 +1,985 @@ +/**************************************************************************** +* VCGLib o o * +* Visual and Computer Graphics Library o o * +* _ O _ * +* Copyright(C) 2004 \/)\/ * +* Visual Computing Lab /\/| * +* ISTI - Italian National Research Council | * +* \ * +* All rights reserved. * +* * +* This program is free software; you can redistribute it and/or modify * +* it under the terms of the GNU General Public License as published by * +* the Free Software Foundation; either version 2 of the License, or * +* (at your option) any later version. * +* * +* This program is distributed in the hope that it will be useful, * +* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * +* GNU General Public License (http://www.gnu.org/licenses/gpl.txt) * +* for more details. * +* * +****************************************************************************/ +/**************************************************************************** + History +$Log: not supported by cvs2svn $ +Revision 1.30 2007/02/26 14:21:44 turini +VTb moved to VTp + +Revision 1.29 2007/02/20 14:08:34 ganovelli +added QualityType to comply vertexplus type + +Revision 1.28 2006/08/23 15:34:20 marfr960 +added minimal comments + +Revision 1.26 2005/11/12 18:41:14 cignoni +Added HasFlags and initialization of flags at construction. + +Revision 1.25 2005/10/14 13:25:50 cignoni +Added cVFp member + +Revision 1.24 2005/10/06 14:26:39 pietroni +added getBBox method + +Revision 1.23 2005/03/18 16:38:36 fiorin +Minor changes + +Revision 1.22 2005/03/18 00:13:45 cignoni +Removed NormalizedNormalV (out of standard and wrong) and +added the member functions Normal and NormalizedNormal() (just like for faces) + +Revision 1.21 2004/10/28 00:50:49 cignoni +Better Doxygen documentation + +Revision 1.20 2004/10/11 17:45:05 ganovelli +added template on corrdinate type (default Point3) + +Revision 1.19 2004/09/28 15:24:56 fiorin +DUMMY classes definition moved into vcg namespace + +Revision 1.18 2004/08/25 15:15:27 ganovelli +minor changes to comply gcc compiler (typename's and stuff) + +Revision 1.17 2004/07/20 15:24:53 pietroni +corrected NormalizedNormalV function... + +Revision 1.16 2004/07/15 11:25:01 ganovelli +VFb moved to VFp, userbit to bitflag,setV, inclusion of pos.h + +Revision 1.15 2004/07/15 10:13:48 pietroni +adde NormalizedNormalV funtion to compute the normal on a vertex + +Revision 1.14 2004/05/13 22:44:40 ganovelli +syntax error (typo) + +Revision 1.13 2004/05/13 22:40:02 ganovelli +default template parameters + +Revision 1.12 2004/05/13 12:49:22 pietroni +no default template parameters... each one must be specified + +Revision 1.12 2004/05/10 13:31:13 ganovelli +function for edge adjacency added + +$Log: not supported by cvs2svn $ +Revision 1.30 2007/02/26 14:21:44 turini +VTb moved to VTp + +Revision 1.29 2007/02/20 14:08:34 ganovelli +added QualityType to comply vertexplus type + +Revision 1.28 2006/08/23 15:34:20 marfr960 +added minimal comments + +Revision 1.26 2005/11/12 18:41:14 cignoni +Added HasFlags and initialization of flags at construction. + +Revision 1.25 2005/10/14 13:25:50 cignoni +Added cVFp member + +Revision 1.24 2005/10/06 14:26:39 pietroni +added getBBox method + +Revision 1.23 2005/03/18 16:38:36 fiorin +Minor changes + +Revision 1.22 2005/03/18 00:13:45 cignoni +Removed NormalizedNormalV (out of standard and wrong) and +added the member functions Normal and NormalizedNormal() (just like for faces) + +Revision 1.21 2004/10/28 00:50:49 cignoni +Better Doxygen documentation + +Revision 1.20 2004/10/11 17:45:05 ganovelli +added template on corrdinate type (default Point3) + +Revision 1.19 2004/09/28 15:24:56 fiorin +DUMMY classes definition moved into vcg namespace + +Revision 1.18 2004/08/25 15:15:27 ganovelli +minor changes to comply gcc compiler (typename's and stuff) + +Revision 1.17 2004/07/20 15:24:53 pietroni +corrected NormalizedNormalV function... + +Revision 1.16 2004/07/15 11:25:01 ganovelli +VFb moved to VFp, userbit to bitflag,setV, inclusion of pos.h + +Revision 1.15 2004/07/15 10:13:48 pietroni +adde NormalizedNormalV funtion to compute the normal on a vertex + +Revision 1.14 2004/05/13 22:44:40 ganovelli +syntax error (typo) + +Revision 1.13 2004/05/13 22:40:02 ganovelli +default template parameters + +Revision 1.12 2004/05/13 12:49:22 pietroni +no default template parameters... each one must be specified + +Revision 1.11 2004/05/10 13:31:13 ganovelli +function for edge adjacency added + +Revision 1.10 2004/05/10 13:13:17 cignoni +added void to Convert, corrected return object in VFp + +Revision 1.9 2004/05/06 15:28:10 pietroni +changed names to VF topology function (was missed) + +Revision 1.8 2004/05/05 17:03:25 pietroni +changed name to topology functions + +Revision 1.7 2004/04/28 11:37:14 pietroni +*** empty log message *** + +Revision 1.6 2004/04/26 09:40:15 pietroni +*** empty log message *** + +Revision 1.6 2004/04/23 14:55:06 pietroni +conversion funtion + +Revision 1.5 2004/03/10 00:59:06 cignoni +minor changes + +Revision 1.4 2004/03/03 16:07:57 cignoni +Yet another cr lf mismatch + +Revision 1.3 2004/02/24 21:36:39 cignoni +grouped documentation, changed typenames and reflection mechanism + +Revision 1.2 2004/02/13 02:09:39 cignoni +First working release, with doxygen comment structure + +Revision 1.1 2004/02/10 01:11:28 cignoni +Edited Comments and GPL license + +****************************************************************************/ + + +#ifndef VERTEX_TYPE +#pragma message("\nYou should never directly include this file\_n") +#else + +#pragma message("VCGLIB Warning: this way to define the simplex vertex is DEPRECATED and no more SUPPORTED") +#pragma message("VCGLIB Warning: use vcg/simplex/vertexplus instead ") + +#include +#include +#include +#include +#include + + +namespace vcg { + + class DUMMYFACETYPE; + class DUMMYEDGETYPE; + class DUMMYTETRATYPE; +/** \addtogroup vertex */ +//@{ +/*! + * This class represent the generic configurable Vertex; + * Usually you never direclty use this class with this name but you build + * your own type by directly including one of the .h files under the face/with + * directory. Each file specify a class type with the desired fields. So for example + * including 'vcg/simplex/vertex/with/VCVN.h' allow you to use the class VertVCVN that has per-vertex color and normal stored inside. + */ +template , class CoordTYPE= Point3 > +class VERTEX_TYPE +{ +public: + + /// The scalar type used to represent coords (i.e. float, double, ...) + typedef FLTYPE ScalarType; + /// The coordinate type used to represent the point (i.e. Point3f, Point3d, ...) + typedef CoordTYPE CoordType; + typedef Point3 NormalType; + /// The type base of the vertex, useful for recovering the original typename after user subclassing + typedef VERTEX_TYPE BaseVertexType; + /// The type of the face pointed by the vertex if vertex edge topology is present + typedef VETYPE EdgeType; + /// The type base of the vertex, useful for recovering the original typename after user subclassing + typedef VFTYPE FaceType; + /// The type of the quality (same as scalar) + typedef ScalarType QualityType; + + +/***********************************************/ +/** @name Vertex Coords + blah + blah +**/ + //@{ +protected: + /// Spatial coordinates of the vertex + CoordType _p; + +public: + /// Return the spatial coordinate of the vertex + inline CoordType & P() + { + assert( (_flags & DELETED) == 0 ); + assert( (_flags & NOTREAD) == 0 ); + assert( (_flags & NOTWRITE) == 0 ); + return _p; + } + + /// Return the constant spatial coordinate of the vertex + inline const CoordType & P() const + { + assert( (_flags & DELETED) == 0 ); + assert( (_flags & NOTREAD) == 0 ); + return _p; + } + + /// Return the constant spatial coordinate of the vertex + inline const CoordType & cP() const + { + assert( (_flags & DELETED) == 0 ); + assert( (_flags & NOTREAD) == 0 ); + return _p; + } + + /// Return the spatial coordinate of the vertex, senza effettuare controlli sul flag + inline CoordType & UberP() + { + return _p; + } + + /// Return the constant spatial coordinate of the vertex, senza effettuare controlli sul flag + inline const CoordType & UberP() const + { + return _p; + } + + //@} + +/***********************************************/ +/** @name Vertex Flags +For each vertex we store a set of boolean values packed in a int. +The default value for each flag is 0. Most commonly used flags are the \a deleted and the \a selected ones. +Users can ask and dispose for a bit for their own purposes with the vcg::VertexFull::NewUserBit() and vcg::VertexFull::DeleteUserBit() functions. +The value returned by these functions has to be passed to the +vcg::VertexFull::SetUserBit() vcg::VertexFull::ClearUserBit() and vcg::VertexFull::IsUserBit() functions to check and modify the obtained bit flag. + +**/ +//@{ + +protected: + /// This are the flags of vertex, the default (reasonable) value is 0 + int _flags; + +public: + /// Return the vector of _flags + inline int & Flags () + { + assert( (_flags & DELETED) == 0 ); + assert( (_flags & NOTREAD) == 0 ); + return _flags; + } + + /// Return the vector of _flags, senza effettuare controlli sui bit + inline int & UberFlags () + { + return _flags; + } + inline const int UberFlags() const + { + return _flags; + } + + /// checks if the vertex is deleted + bool IsD() const {return (_flags & DELETED) != 0;} + /// checks if the vertex is readable + bool IsR() const {return (_flags & NOTREAD) == 0;} + /// checks if the vertex is modifiable + bool IsW() const {return (_flags & NOTWRITE)== 0;} + /// This funcion checks whether the vertex is both readable and modifiable + bool IsRW() const {return (_flags & (NOTREAD | NOTWRITE)) == 0;} + /// checks if the vertex is Modified + bool IsS() const {return (_flags & SELECTED) != 0;} + /// checks if the vertex is readable + bool IsB() const {return (_flags & BORDER) != 0;} + /// checks if the vertex is visited + bool IsV() const {return (_flags & VISITED) != 0;} + + + /** Set the flag value + @param flagp Valore da inserire nel flag + */ + void SetFlags(int flagp) {_flags=flagp;} + + /** Set the flag value + @param flagp Valore da inserire nel flag + */ + void ClearFlags() {_flags=0;} + + /// deletes the vertex from the mesh + void SetD() {_flags |=DELETED;} + /// un-delete a vertex + void ClearD() {_flags &=(~DELETED);} + /// marks the vertex as readable + void SetR() {_flags &=(~NOTREAD);} + /// marks the vertex as not readable + void ClearR() {_flags |=NOTREAD;} + /// marks the vertex as writable + void ClearW() {_flags |=NOTWRITE;} + /// marks the vertex as not writable + void SetW() {_flags &=(~NOTWRITE);} + /// select the vertex + void SetS() {_flags |=SELECTED;} + /// Un-select a vertex + void ClearS() {_flags &= ~SELECTED;} + /// Set vertex as ob border + void SetB() {_flags |=BORDER;} + void ClearB() {_flags &=~BORDER;} + /// checks if the vertex is visited + void ClearV() {_flags &= ~VISITED;} + /// checks if the vertex is visited + void SetV() {_flags |=VISITED;} + /// Return the first bit that is not still used +static int &LastBitFlag() + { + static int b =USER0; + return b; + } + +/// allocate a bit among the flags that can be used by user. +static inline int NewBitFlag() + { + LastBitFlag()=LastBitFlag()<<1; + return LastBitFlag(); + } +// de-allocate a bit among the flags that can be used by user. +static inline bool DeleteBitFlag(int bitval) + { + if(LastBitFlag()==bitval) { + LastBitFlag()= LastBitFlag()>>1; + return true; + } + assert(0); + return false; + } + /// This function checks if the given user bit is true + bool IsUserBit(int userBit){return (_flags & userBit) != 0;} + /// This function set the given user bit + void SetUserBit(int userBit){_flags |=userBit;} + /// This function clear the given user bit + void ClearUserBit(int userBit){_flags &= (~userBit);} + + + //@} + + +/*#******************* +* Bounding box * +**********************/ + +void GetBBox( Box3 & bb ) const +{ + bb.Set( cP() ); +} + +/***********************************************/ +/** @name Vertex Texture Coords + blah + blah + **/ +//@{ + +#ifdef __VCGLIB_VERTEX_VT +protected: + TCTYPE _t; +#endif + +public: + TCTYPE & T() + { +#ifdef __VCGLIB_VERTEX_VT + return _t; +#else + assert(0); + return *(TCTYPE*)(&_flags); +#endif + } + + const TCTYPE & T() const + { +#ifdef __VCGLIB_VERTEX_VT + return _t; +#else + assert(0); + return *(TCTYPE*)(&_flags); +#endif + } + +//@} + +/***********************************************/ +/** @name Per vertex Color + blah + blah + **/ +//@{ + +#ifdef __VCGLIB_VERTEX_VC +protected: + Color4b _c; +#endif + +public: + Color4b & C() + { +#ifdef __VCGLIB_VERTEX_VC + return _c; +#else + assert(0); + return *(Color4b*)(&_flags); +#endif + } + + const Color4b & C() const + { +#ifdef __VCGLIB_VERTEX_VC + return _c; +#else + return Color4b(Color4b::White); +#endif + } + //@} + +/***********************************************/ +/** @name Vertex Quality + blah + blah + **/ + //@{ + +#ifdef __VCGLIB_VERTEX_VQ +protected: + float _q; +#endif + +public: + float & Q() + { +#ifdef __VCGLIB_VERTEX_VQ + return _q; +#else + assert(0); + return *(float*)(&_flags); +#endif + } + + const float & Q() const + { +#ifdef __VCGLIB_VERTEX_VQ + return _q; +#else + return 1; +#endif + } + //@} +/** @name Vertex-Edge Adjacency + blah + blah + **/ + //@{ + +#if ((defined __VCGLIB_VERTEX_EA) || (defined __VCGLIB_VERTEX_EAS)) + // Puntatore ad un edge appartenente alla stella del vertice, implementa l'adiacenza vertice-edge +protected: + EdgeType *_ep; + int _ei; +#endif + +public: +inline EdgeType * & VEp() + { +#if ((defined __VCGLIB_VERTEX_EA) || (defined __VCGLIB_VERTEX_EAS)) + return _ep; +#else + assert(0);// you are probably trying to use VF topology in a vertex without it + return *((EdgeType **)(_flags)); +#endif + } + +inline const EdgeType * & VEp() const + { +#if ((defined __VCGLIB_VERTEX_EA) || (defined __VCGLIB_VERTEX_EAS)) + return _ep; +#else + assert(0);// you are probably trying to use VF topology in a vertex without it + return (EdgeType *)this; +#endif + } + +inline int & VEi() + { +#if ((defined __VCGLIB_VERTEX_EA) || (defined __VCGLIB_VERTEX_EAS)) + + return _ei; +#else + assert(0);// you are probably trying to use VF topology in a vertex without it + return _flags; +#endif + } + +inline const int & VEi() const + { +#if ((defined __VCGLIB_VERTEX_EA) || (defined __VCGLIB_VERTEX_EAS)) + return _ei; +#else + assert(0);// you are probably trying to use VF topology in a vertex without it + return (void *)this; +#endif + } + //@} +/***********************************************/ +/** @name Vertex-Face Adjacency + blah + blah + **/ + //@{ + +#if ((defined __VCGLIB_VERTEX_AF) || (defined __VCGLIB_VERTEX_AFS)) + // Puntatore ad una faccia appartenente alla stella del vertice, implementa l'adiacenza vertice-faccia +protected: + VFTYPE *_vfb; + int _vfi; +#endif + +public: +inline VFTYPE * & VFp() + { +#if ((defined __VCGLIB_VERTEX_AF) || (defined __VCGLIB_VERTEX_AFS)) + return _vfb; +#else + assert(0);// you are probably trying to use VF topology in a vertex without it + static VFTYPE *dum; + return dum; +#endif + } + +inline const VFTYPE * & VFp() const + { +#if ((defined __VCGLIB_VERTEX_AF) || (defined __VCGLIB_VERTEX_AFS)) + return _vfb; +#else + assert(0);// you are probably trying to use VF topology in a vertex without it + return (VFTYPE *)0; +#endif + } + +inline const VFTYPE * cVFp() const + { +#if ((defined __VCGLIB_VERTEX_AF) || (defined __VCGLIB_VERTEX_AFS)) + return _vfb; +#else + assert(0);// you are probably trying to use VF topology in a vertex without it + return (VFTYPE *)0; +#endif + } + +inline int & VFi() + { +#if ((defined __VCGLIB_VERTEX_AF) || (defined __VCGLIB_VERTEX_AFS)) + + return _vfi; +#else + assert(0);// you are probably trying to use VF topology in a vertex without it + return _flags; +#endif + } + +inline const int & VFi() const + { +#if ((defined __VCGLIB_VERTEX_AF) || (defined __VCGLIB_VERTEX_AFS)) + return _vfi; +#else + assert(0);// you are probably trying to use VF topology in a vertex without it + return (void *)this; +#endif + } + + + + //@} + + /***********************************************/ +/** @name Vertex-Tetrahedron Adjacency + blah + blah + **/ + //@{ + +#if ((defined __VCGLIB_VERTEX_AT) || (defined __VCGLIB_VERTEX_ATS)) + // Pointer to first tetrahedron of the start implements the Vertex-Tetrahedron Topology +protected: + VTTYPE *_vtp; + int _vti; +#endif + +public: +inline VTTYPE * & VTp() + { +#if ((defined __VCGLIB_VERTEX_AT) || (defined __VCGLIB_VERTEX_ATS)) + return _vtp; +#else + assert(0);// you are probably trying to use VF topology in a vertex without it + return *((VTTYPE **)(_flags)); +#endif + } + +inline const VTTYPE * & VTp() const + { +#if ((defined __VCGLIB_VERTEX_AT) || (defined __VCGLIB_VERTEX_ATS)) + return _vtp; +#else + assert(0);// you are probably trying to use VF topology in a vertex without it + return (VTTYPE *)this; +#endif + } + +inline int & VTi() + { +#if ((defined __VCGLIB_VERTEX_AT) || (defined __VCGLIB_VERTEX_ATS)) + + return _vti; +#else + assert(0);// you are probably trying to use VF topology in a vertex without it + return _flags; +#endif + } + +inline const int & VTi() const + { +#if ((defined __VCGLIB_VERTEX_AT) || (defined __VCGLIB_VERTEX_ATS)) + return _vti; +#else + assert(0);// you are probably trying to use VF topology in a vertex without it + return (void *)this; +#endif + } + + + + //@} + +/***********************************************/ +/** @name Vertex Incremental Mark + blah + blah + **/ + //@{ + +#ifdef __VCGLIB_VERTEX_VM +protected: + /// The incremental vertex mark + int _imark; +#endif // Mark +public: +#ifdef __VCGLIB_VERTEX_VM + /// This function return the vertex incremental mark + inline int & IMark() + { + assert( (_flags & DELETED) == 0 ); + assert( (_flags & NOTREAD) == 0 ); + assert( (_flags & NOTWRITE) == 0 ); + return _imark; + } + + /// This function return the constant vertex incremental mark + inline const int & IMark() const + { + assert( (_flags & DELETED) == 0 ); + assert( (_flags & NOTREAD) == 0 ); + return _imark; + } +#endif + + /// Initialize the _imark system of the vertex + inline void InitIMark() + { +#ifdef __VCGLIB_VERTEX_VM + _imark = 0; +#endif + } + + //@} + + /***********************************************/ + /** @name Vertex Normal + blah + blah + **/ + //@{ + +#ifdef __VCGLIB_VERTEX_VN +protected: + CoordType _n; +#endif + +public: + /// Return the vertex normal + inline CoordType & N() + { + assert( (_flags & DELETED) == 0 ); + assert( (_flags & NOTREAD) == 0 ); + assert( (_flags & NOTWRITE) == 0 ); +#ifdef __VCGLIB_VERTEX_VN + return _n; +#else + assert(0); + return *(CoordType *)this; +#endif + } + + /// Return the constant vertex normal + inline const CoordType & N() const + { + assert( (_flags & DELETED) == 0 ); + assert( (_flags & NOTREAD) == 0 ); +#ifdef __VCGLIB_VERTEX_VN + return _n; +#else + assert(0); + return *(CoordType *)this; +#endif + } + + inline const CoordType cN() const + { + assert( (_flags & DELETED) == 0 ); + assert( (_flags & NOTREAD) == 0 ); +#ifdef __VCGLIB_VERTEX_VN + return _n; +#else + return CoordType(0,0,0); +#endif + } + /// Return the Normal of the vertex + inline CoordType & UberN() + { +#ifdef __VCGLIB_VERTEX_VN + return _n; +#else + assert(0); + return *(CoordType *)this; +#endif + } + + /// Return the constant normal of the vertex + inline const CoordType & UberN() const + { +#ifdef __VCGLIB_VERTEX_VN + return _n; +#else + assert(0); + return *(CoordType *)this; +#endif + } + +template +const CoordType GenericNormal() +{ + if (!HasVFAdjacency()) + { + assert(0); + return (VERTEX_TYPE::CoordType (0,0,0)); + } + else + { + vcg::face::VFIterator VFi=vcg::face::VFIterator(); + VFi.f=VFp(); + VFi.z=VFi(); + typename VERTEX_TYPE::CoordType N= typename VERTEX_TYPE::CoordType(0,0,0); + while (!VFi.End()) + { + N+=VFi.f->Normal(); + VFi++; + } + if(NormalizeFlag) N.Normalize(); + return N; + } +} + +/// Return the un-normalized value of the vertex normal as it correspond to the current geometry. +/// It is always computed and never use any stored value. +/// REQUIRES vertex-face topology +const CoordType Normal() { return GenericNormal(); } + +/// Return the normalized value of the vertex normal as it correspond to the current geometry. +/// It is always computed and never use any stored value. +/// REQUIRES vertex-face topology +const CoordType NormalizedNormal() { return GenericNormal(); } + + + //@} + + /***********************************************/ + /** @name Reflection Functions + Static functions that give information about the current vertex type. +Reflection is a mechanism making it possible to investigate yourself. Reflection is used to investigate format of objects at runtime, invoke methods and access fields of these objects. Here we provide static const functions that are resolved at compile time and they give information about the data (normal, color etc.) supported by the current vertex type. + **/ + //@{ + +static bool HasFlags() { // Note the plural because ONE vertex has many Flags (but just one color, normal, mark, quality ecc.) + return true; +} + +static bool HasNormal() { +#ifdef __VCGLIB_VERTEX_VN + return true; +#else + return false; +#endif +} +static bool HasColor() { +#ifdef __VCGLIB_VERTEX_VC + return true; +#else + return false; +#endif +} +static bool HasMark() { +#ifdef __VCGLIB_VERTEX_VM + return true; +#else + return false; +#endif +} +static bool HasQuality() { +#ifdef __VCGLIB_VERTEX_VQ + return true; +#else + return false; +#endif +} +static bool HasTexCoord() { +#ifdef __VCGLIB_VERTEX_VT + return true; +#else + return false; +#endif +} +static bool HasVFAdjacency() { +#ifdef __VCGLIB_VERTEX_AF + return true; +#else + return false; +#endif +} +static bool HasVTAdjacency() { +#ifdef __VCGLIB_VERTEX_AT + return true; +#else + return false; +#endif +} + +static bool HasVEAdjacency() { +#ifdef __VCGLIB_VERTEX_EA + return true; +#else + return false; +#endif +} + //@} + +/***********************************************/ + /** @Conversion to other vertex + **/ + //@{ + +template +inline void Convert( VERT_TYPE &v ) +{ + P()=v.P(); + Flags()=v.Flags(); + if ((HasNormal())&&(v.HasNormal())) + N()=v.N(); + if ((HasColor())&&(v.HasColor())) + C()=v.C(); +#ifdef __VCGLIB_VERTEX_VM + if ((HasMark())&&(v.HasMark())) + IMark()=v.IMark(); +#endif + if ((HasQuality())&&(v.HasQuality())) + Q()=v.Q(); + if ((HasTexCoord())&&(v.HasTexCoord())) + T()=v.T(); +} + + //@} + + enum { + // This bit indicate that the vertex is deleted from the mesh + DELETED = 0x0001, // cancellato + // This bit indicate that the vertex of the mesh is not readable + NOTREAD = 0x0002, // non leggibile (ma forse modificabile) + // This bit indicate that the vertex is not modifiable + NOTWRITE = 0x0004, // non modificabile (ma forse leggibile) + // This bit indicate that the vertex is modified + MODIFIED = 0x0008, // modificato + // This bit can be used to mark the visited vertex + VISITED = 0x0010, // Visited + // This bit can be used to select + SELECTED = 0x0020, // Selection flag + // Border Flag + BORDER = 0x0100, + // First user bit + USER0 = 0x0200 // Fisrt user bit + }; + + + /** Return the i-th spatial value of the vertex coordinate. + @param i Index of the spatial vertex coordinate (x=0 y=1 z=2). + */ + inline ScalarType & operator [] ( const int i ){ + assert(i>=0 && i<3); + return P().V(i); + } + /** Return the i-th spatial value of the const vertex coordinate. + @param i Index of the spatial vertex coordinate (x=0 y=1 z=2). + */ + inline const FLTYPE & operator [] ( const int i ) const { + assert(i>=0 && i<3); + return P().V(i); + } + /// Operator to compare two vertices using lexicographic order + inline bool operator < ( const VERTEX_TYPE & ve) const { + return _p < ve._p; + } + inline VERTEX_TYPE() { +//#ifdef _DEBUG + _flags=0; +//#endif + }; + +}; + +//@} +} // end namespace +#endif + diff --git a/vcg/simplex/vertex/component.h b/vcg/simplex/vertex/component.h new file mode 100644 index 00000000..fb619c25 --- /dev/null +++ b/vcg/simplex/vertex/component.h @@ -0,0 +1,610 @@ +/**************************************************************************** +* VCGLib o o * +* Visual and Computer Graphics Library o o * +* _ O _ * +* Copyright(C) 2004 \/)\/ * +* Visual Computing Lab /\/| * +* ISTI - Italian National Research Council | * +* \ * +* All rights reserved. * +* * +* This program is free software; you can redistribute it and/or modify * +* it under the terms of the GNU General Public License as published by * +* the Free Software Foundation; either version 2 of the License, or * +* (at your option) any later version. * +* * +* This program is distributed in the hope that it will be useful, * +* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * +* GNU General Public License (http://www.gnu.org/licenses/gpl.txt) * +* for more details. * +* * +****************************************************************************/ +/**************************************************************************** + History + +$Log: not supported by cvs2svn $ +Revision 1.27 2008/04/03 23:12:28 cignoni +compacted two pair of empty components to shorten derivation chains + +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::) + +Revision 1.24 2008/02/04 21:26:49 ganovelli +added ImportLocal which imports all local attributes into vertexplus and faceplus. +A local attribute is everything (N(), C(), Q()....) except pointers to other simplices +(i.e. FFAdj, VFAdj, VertexRef) which are set to NULL. +Added some function for const attributes + +Revision 1.23 2007/06/04 15:40:22 turini +Add vertex-tetrahedron adjacency component VTAdj. + +Revision 1.22 2007/03/12 15:37:21 tarini +Texture coord name change! "TCoord" and "Texture" are BAD. "TexCoord" is GOOD. + +Revision 1.21 2007/02/18 07:41:32 cignoni +Corrected small syntax errors detected by gcc + +Revision 1.20 2007/02/12 19:00:56 ganovelli +added Name(std:vector& n) that fills n with the names of the attribute of the vertex type + +Revision 1.19 2006/12/11 23:40:57 ganovelli +Has*Opt migrated to Has*Occ + +Revision 1.18 2006/11/28 22:34:28 cignoni +Added default constructor with null initialization to adjacency members. +AddFaces and AddVertices NEED to know if the topology is correctly computed to update it. + +Revision 1.17 2006/01/09 13:58:56 cignoni +Added Initialization of Color in Vertex and Face Components + +Revision 1.16 2005/11/22 23:58:03 cignoni +Added intiailization of flags to zero in the constructor, + +Revision 1.15 2005/11/18 15:44:51 cignoni +Access to constant normal changed from by val to by reference + +Revision 1.14 2005/11/16 23:02:37 cignoni +Added some missing members to EmptyMark +Standardized name of flags. It is plural becouse each simplex has many flag. + +Revision 1.13 2005/11/14 23:50:57 cignoni +Added Incremental Mark + +Revision 1.12 2005/11/12 18:35:49 cignoni +Changed HasFlag -> HasFlags + +Revision 1.11 2005/11/01 18:17:52 cignoni +Added an assert(0) in all the accesses to empty components + +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... + +Revision 1.8 2005/10/07 15:19:54 cignoni +minor updates to keep it in line with the rest of the library + +Revision 1.7 2004/05/10 13:50:32 cignoni +Updated names of adj functions to the new standards + +Revision 1.6 2004/04/05 11:53:06 cignoni +addend constant access funcs + +Revision 1.5 2004/04/03 13:35:51 cignoni +minor changes + +Revision 1.4 2004/03/31 13:15:28 cignoni +Added optional cpmponent + +Revision 1.3 2004/03/31 12:28:37 ganovelli +*** empty log message *** + +Revision 1.2 2004/03/29 14:26:38 cignoni +Error in color + +Revision 1.1 2004/03/29 08:36:26 cignoni +First working version! + + +****************************************************************************/ +#ifndef __VCG_VERTEX_PLUS_COMPONENT +#define __VCG_VERTEX_PLUS_COMPONENT +#include +#include +#include +#include +#include + +namespace vcg { + namespace vertex { +/* +Some naming Rules +All the Components that can be added to a vertex should be defined in the namespace vert: + +*/ + +/*------------------------- EMPTY COORD & NORMAL -----------------------------------------*/ +template class EmptyCoordNormal: public T { +public: + typedef vcg::Point3f CoordType; + typedef CoordType::ScalarType ScalarType; + + CoordType &P() { 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; } + + 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 void Name(std::vector & name){T::Name(name);} +}; + +/*-------------------------- COORD ----------------------------------------*/ + +template class Coord: public T { +public: + typedef A CoordType; + typedef typename CoordType::ScalarType ScalarType; + CoordType &P() { return _coord; } + const CoordType &P() const { return _coord; } + const CoordType &cP() const { return _coord; } + CoordType &UberP() { return _coord; } + + template < class LeftV> + void ImportLocal(const LeftV & left ) { P().Import(left.cP()); T::ImportLocal( left); } + static bool HasCoord() { return true; } + static void Name(std::vector & name){name.push_back(std::string("Coord"));T::Name(name);} + +private: + CoordType _coord; +}; +template class Coord3f: public Coord { +public: static void Name(std::vector & name){name.push_back(std::string("Coord3f"));T::Name(name);} +}; +template class Coord3d: public Coord { +public: static void Name(std::vector & name){name.push_back(std::string("Coord3d"));T::Name(name);} +}; + +/*-------------------------- NORMAL ----------------------------------------*/ + +template class Normal: public T { +public: + typedef A NormalType; + NormalType &N() { return _norm; } + const NormalType &cN() const { return _norm; } + template < class LeftV> + void ImportLocal(const LeftV & left ) { N() = left.cN(); T::ImportLocal( left); } + static bool HasNormal() { return true; } + static void Name(std::vector & name){name.push_back(std::string("Normal"));T::Name(name);} + +private: + NormalType _norm; +}; + +template class Normal3s: public Normal { +public:static void Name(std::vector & name){name.push_back(std::string("Normal3s"));T::Name(name);} +}; +template class Normal3f: public Normal { +public: static void Name(std::vector & name){name.push_back(std::string("Normal3f"));T::Name(name);} +}; +template class Normal3d: public Normal { +public: static void Name(std::vector & name){name.push_back(std::string("Normal3d"));T::Name(name);} +}; + + +/*-------------------------- INCREMENTAL MARK ----------------------------------------*/ + +template class EmptyMark: public T { +public: + static bool HasMark() { return false; } + static bool HasMarkOcc() { return false; } + inline void InitIMark() { } + inline int & IMark() { assert(0); static int tmp=-1; return tmp;} + inline const int & IMark() const {return 0;} + template < class LeftV> + void ImportLocal(const LeftV & left ) { T::ImportLocal( left); } + static void Name(std::vector & name){T::Name(name);} + +}; +template class Mark: public T { +public: + static bool HasMark() { return true; } + static bool HasMarkOcc() { return true; } + inline void InitIMark() { _imark = 0; } + inline int & IMark() { return _imark;} + inline const int & IMark() const {return _imark;} + template < class LeftV> + void ImportLocal(const LeftV & left ) { IMark() = left.IMark(); T::ImportLocal( left); } + static void Name(std::vector & name){name.push_back(std::string("Mark"));T::Name(name);} + + private: + int _imark; +}; + +/*-------------------------- TEXCOORD ----------------------------------------*/ + +template class EmptyTexCoord: public TT { +public: + typedef vcg::TexCoord2 TexCoordType; + TexCoordType &T() { static TexCoordType dummy_texcoord; assert(0); return dummy_texcoord; } + template < class LeftV> + void ImportLocal(const LeftV & left ) { TT::ImportLocal( left); } + static bool HasTexCoord() { return false; } + static void Name(std::vector & name){TT::Name(name);} + + }; +template class TexCoord: public TT { +public: + typedef A TexCoordType; + TexCoordType &T() { return _t; } + const TexCoordType &cT() const { return _t; } + template < class LeftV> + void ImportLocal(const LeftV & left ) { T() = left.cT(); TT::ImportLocal( left); } + static bool HasTexCoord() { return true; } + static void Name(std::vector & name){name.push_back(std::string("TexCoord"));TT::Name(name);} + +private: + TexCoordType _t; +}; + +template class TexCoord2s: public TexCoord, TT> { + static void Name(std::vector & name){name.push_back(std::string("TexCoord2s"));TT::Name(name);} + +}; +template class TexCoord2f: public TexCoord, TT> { + static void Name(std::vector & name){name.push_back(std::string("TexCoord2f"));TT::Name(name);} +}; +template class TexCoord2d: public TexCoord, TT> { + static void Name(std::vector & name){name.push_back(std::string("TexCoord2d"));TT::Name(name);} +}; + +/*------------------------- FLAGS -----------------------------------------*/ +template class EmptyBitFlags: public T { +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; } + template < class LeftV> + void ImportLocal(const LeftV & left ) { T::ImportLocal( left); } + static bool HasFlags() { return false; } + static void Name(std::vector & name){T::Name(name);} + +}; + +template class BitFlags: public T { +public: + BitFlags(){_flags=0;} + typedef int FlagType; + int &Flags() {return _flags; } + const int Flags() const {return _flags; } + template < class LeftV> + void ImportLocal(const LeftV & left ) { Flags() = left.Flags(); T::ImportLocal( left); } + static bool HasFlags() { return true; } + static void Name(std::vector & name){name.push_back(std::string("BitFlags"));T::Name(name);} + +private: + int _flags; +}; + +/*-------------------------- EMPTY COLOR & QUALITY ----------------------------------*/ + +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; } + const ColorType &cC() const { 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) {} + typedef A ColorType; + ColorType &C() { return _color; } + const ColorType &C() const { return _color; } + const ColorType &cC() const { return _color; } + template < class LeftV> + void ImportLocal(const LeftV & left ) { C() = left.cC(); T::ImportLocal( left); } + static bool HasColor() { return true; } + static void Name(std::vector & name){name.push_back(std::string("Color"));T::Name(name);} + +private: + ColorType _color; +}; + +template class Color4b: public Color { + public: static void Name(std::vector & name){name.push_back(std::string("Color4b"));TT::Name(name);} +}; + +/*-------------------------- Quality ----------------------------------*/ + +template class Quality: public TT { +public: + typedef A QualityType; + QualityType &Q() { return _quality; } + const QualityType & cQ() const {return _quality; } + template < class LeftV> + void ImportLocal(const LeftV & left ) { Q() = left.cQ(); TT::ImportLocal( left); } + static bool HasQuality() { return true; } + static void Name(std::vector & name){name.push_back(std::string("Quality"));TT::Name(name);} + +private: + QualityType _quality; +}; + +template class Qualitys: public Quality { +public: static void Name(std::vector & name){name.push_back(std::string("Qualitys"));TT::Name(name);} +}; +template class Qualityf: public Quality { +public: static void Name(std::vector & name){name.push_back(std::string("Qualityf"));TT::Name(name);} +}; +template class Qualityd: public Quality { +public: static void Name(std::vector & name){name.push_back(std::string("Qualityd"));TT::Name(name);} +}; + + + +template class EmptyCurvatureData:public TT { +public: + + typedef float ScalarType; + typedef Point3f VecType; + float &Kh() {static float dummy = 0.f; assert(0);return dummy;;} + float &Kg() { static float dummy = 0.f; assert(0);return dummy;} + const float &cKh() const {static float dummy = 0.f; assert(0);return dummy;;} + const float &cKg()const { static float dummy = 0.f;assert(0); return dummy;} + + VecType &PD1(){static VecType v(0,0,0); assert(0);return v;} + VecType &PD2(){static VecType v(0,0,0); assert(0);return v;} + const VecType &cPD1() const {static VecType v(0,0,0); assert(0);return v;} + const VecType &cPD2() const {static VecType v(0,0,0); assert(0);return v;} + + ScalarType &K1(){ static ScalarType v = 0.0;assert(0);return v;} + ScalarType &K2(){ static ScalarType v = 0.0;assert(0);return v;} + const ScalarType &cK1() const {static ScalarType v = 0.0;assert(0);return v;} + const ScalarType &cK2()const {static ScalarType v = 0.0;assert(0);return v;} + + static bool HasCurvatureOcc() { return false; } + static bool HasCurvatureOcf() { return false; } + static bool HasCurvature() { return false; } + static bool HasCurvatureDir() { return false; } + static void Name(std::vector & name){TT::Name(name);} +}; + +/*-------------------------- Curvature ----------------------------------*/ + +template class EmptyCurvature: public TT { +public: + typedef vcg::Point2 CurvatureType; + + float &Kh() {static float dummy = 0.f; return dummy;;} + float &Kg() { static float dummy = 0.f; return dummy;} + const float &cKh() const {static float dummy = 0.f; return dummy;;} + const float &cKg()const { static float dummy = 0.f; return dummy;} + + static bool HasCurvatureOcc() { return false; } + static bool HasCurvatureOcf() { return false; } + static bool HasCurvature() { return false; } + static void Name(std::vector & name){TT::Name(name);} +}; + +template class Curvature: public TT { +public: + typedef Point2 CurvatureType; + typedef typename CurvatureType::ScalarType ScalarType; + ScalarType &Kh(){ return _hk[0];} + ScalarType &Kg(){ return _hk[1];} + const ScalarType &cKh() const { return _hk[0];} + const ScalarType &cKg() const { return _hk[1];} + + static bool HasCurvature() { return true; } + static void Name(std::vector & name){name.push_back(std::string("Curvature"));TT::Name(name);} + +private: + Point2 _hk; +}; + + +template class Curvaturef: public Curvature< float, T> { +public: static void Name(std::vector & name){name.push_back(std::string("Curvaturef"));T::Name(name);} +}; +template class Curvatured: public Curvature { +public: static void Name(std::vector & name){name.push_back(std::string("Curvatured"));T::Name(name);} +}; + +/*-------------------------- Curvature Direction ----------------------------------*/ + +template +struct CurvatureDirBaseType{ + typedef Point3 VecType; + typedef S ScalarType; + CurvatureDirBaseType () {} + Point3max_dir,min_dir; // max and min curvature direction + S k1,k2;// max and min curvature values +}; + +template class EmptyCurvatureDir: public TT { +public: + typedef CurvatureDirBaseType CurvatureDirType; + + Point3f &PD1(){static Point3f dummy(0,0,0); return dummy;} + Point3f &PD2(){static Point3f dummy(0,0,0); return dummy;} + const Point3f &cPD1() const {static Point3f dummy(0,0,0); return dummy;} + const Point3f &cPD2()const {static Point3f dummy(0,0,0); return dummy;} + + float &K1(){ static float dummy(0);assert(0);return dummy;} + float &K2(){ static float dummy(0);assert(0);return dummy;} + const float &cK1()const { static float dummy(0);assert(0);return dummy;} + const float &cK2()const { static float dummy(0);assert(0);return dummy;} + + static bool HasCurvatureDir() { return false; } + static void Name(std::vector & name){TT::Name(name);} +}; + +template class CurvatureDir: public TT { +public: + typedef A CurvatureDirType; + typedef typename CurvatureDirType::VecType VecType; + typedef typename CurvatureDirType::ScalarType ScalarType; + + VecType &PD1(){ return _curv.max_dir;} + VecType &PD2(){ return _curv.min_dir;} + const VecType &cPD1() const {return _curv.max_dir;} + const VecType &cPD2() const {return _curv.min_dir;} + + ScalarType &K1(){ return _curv.k1;} + ScalarType &K2(){ return _curv.k2;} + const ScalarType &cK1() const {return _curv.k1;} + const ScalarType &cK2()const {return _curv.k2;} + + static bool HasCurvatureDir() { return true; } + static void Name(std::vector & name){name.push_back(std::string("CurvatureDir"));TT::Name(name);} + +private: + CurvatureDirType _curv; +}; + + +template class CurvatureDirf: public CurvatureDir, T> { +public: static void Name(std::vector & name){name.push_back(std::string("CurvatureDirf"));T::Name(name);} +}; +template class CurvatureDird: public CurvatureDir, T> { +public: static void Name(std::vector & name){name.push_back(std::string("CurvatureDird"));T::Name(name);} +}; + +/*-------------------------- Empty Radius ----------------------------------*/ + +template class EmptyRadius: public T { +public: + + typedef float RadiusType; + typedef RadiusType ScalarType; + + RadiusType &R(){ static ScalarType v = 0.0; assert(0 && "the radius component is not available"); return v; } + const RadiusType &cR() const { static const ScalarType v = 0.0; assert(0 && "the radius component is not available"); return v; } + + static bool HasRadius() { return false; } + static bool HasRadiusOcf() { return false; } + static void Name(std::vector & name){ T::Name(name);} +}; + + + +/*----------------------------- VEADJ ------------------------------*/ + + +template class EmptyVEAdj: public T { +public: + typename T::EdgePointer &VEp() { static typename T::EdgePointer ep=0; assert(0); return ep; } + typename T::EdgePointer cVEp() { static typename T::EdgePointer ep=0; assert(0); return ep; } + int &VEi(){static int z=0; return z;}; + template < class LeftV> + void ImportLocal(const LeftV & left ) { T::ImportLocal( left); } + static bool HasVEAdjacency() { return false; } + static bool HasVEAdjacencyOcc() { return false; } + static void Name(std::vector & name){ T::Name(name);} +}; + +template class VEAdj: public T { +public: + VEAdj(){_ep=0;} + typename T::EdgePointer &VEp() {return _ep; } + typename T::EdgePointer cVEp() {return _ep; } + int &VEi() {return _zp; } + template < class LeftV> + void ImportLocal(const LeftV & left ) { VEp() = NULL; T::ImportLocal( left); } + static bool HasVEAdjacency() { return true; } + static bool HasVEAdjacencyOcc() { return true; } + static void Name(std::vector & name){name.push_back(std::string("VEAdj"));T::Name(name);} + +private: + typename T::EdgePointer _ep ; + int _zp ; +}; + +/*----------------------------- VFADJ ------------------------------*/ + + +template class EmptyVFAdj: public T { +public: + 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;}; + template < class LeftV> + void ImportLocal(const LeftV & left ) { T::ImportLocal( left); } + static bool HasVFAdjacency() { return false; } + static bool HasVFAdjacencyOcc() { return false; } + static void Name(std::vector & name){ T::Name(name);} +}; + +template class VFAdj: public T { +public: + VFAdj(){_fp=0;} + typename T::FacePointer &VFp() {return _fp; } + typename T::FacePointer cVFp() {return _fp; } + int &VFi() {return _zp; } + template < class LeftV> + void ImportLocal(const LeftV & left ) { VFp() = NULL; T::ImportLocal( left); } + static bool HasVFAdjacency() { return true; } + static bool HasVFAdjacencyOcc() { return true; } + static void Name(std::vector & name){name.push_back(std::string("VFAdj"));T::Name(name);} + +private: + typename T::FacePointer _fp ; + int _zp ; +}; + +/*----------------------------- VTADJ ------------------------------*/ + + +template class EmptyVTAdj: public T { +public: + typename T::TetraPointer &VTp() { static typename T::TetraPointer tp = 0; assert(0); return tp; } + typename T::TetraPointer cVTp() { static typename T::TetraPointer tp = 0; assert(0); return tp; } + int &VTi() { static int z = 0; return z; }; + static bool HasVTAdjacency() { return false; } + static bool HasVTAdjacencyOcc() { return false; } + static void Name( std::vector< std::string > & name ) { T::Name(name); } +}; + +template class VTAdj: public T { +public: + VTAdj() { _tp = 0; } + typename T::TetraPointer &VTp() { return _tp; } + typename T::TetraPointer cVTp() { return _tp; } + int &VTi() {return _zp; } + static bool HasVTAdjacency() { return true; } + static bool HasVTAdjacencyOcc() { return true; } + static void Name( std::vector< std::string > & name ) { name.push_back( std::string("VTAdj") ); T::Name(name); } + +private: + typename T::TetraPointer _tp ; + int _zp ; +}; + + } // end namespace vert +}// end namespace vcg +#endif diff --git a/vcg/simplex/vertex/component_occ.h b/vcg/simplex/vertex/component_occ.h new file mode 100644 index 00000000..7c143eb8 --- /dev/null +++ b/vcg/simplex/vertex/component_occ.h @@ -0,0 +1,268 @@ +/**************************************************************************** +* VCGLib o o * +* Visual and Computer Graphics Library o o * +* _ O _ * +* Copyright(C) 2004 \/)\/ * +* Visual Computing Lab /\/| * +* ISTI - Italian National Research Council | * +* \ * +* All rights reserved. * +* * +* This program is free software; you can redistribute it and/or modify * +* it under the terms of the GNU General Public License as published by * +* the Free Software Foundation; either version 2 of the License, or * +* (at your option) any later version. * +* * +* This program is distributed in the hope that it will be useful, * +* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * +* GNU General Public License (http://www.gnu.org/licenses/gpl.txt) * +* for more details. * +* * +****************************************************************************/ +/**************************************************************************** + History + +$Log: not supported by cvs2svn $ +Revision 1.2 2007/03/12 15:37:21 tarini +Texture coord name change! "TCoord" and "Texture" are BAD. "TexCoord" is GOOD. + +Revision 1.1 2005/10/15 16:24:10 ganovelli +Working release (compilata solo su MSVC), component_occ � migrato da component_opt + + + +****************************************************************************/ +#ifndef __VCG_VERTEX_PLUS_COMPONENT_OCC +#define __VCG_VERTEX_PLUS_COMPONENT_OCC + +#include +#include + + +namespace vcg { + namespace vertex { +/* +Some naming Rules +All the Components that can be added to a vertex should be defined in the namespace vert: + +*/ + +/*------------------------- COORD -----------------------------------------*/ + +template class CoordOcc: public T { +public: + typedef A CoordType; + typedef typename CoordType::ScalarType ScalarType; + typedef typename T::VertType VertType; + CoordType &P() { return CAT< vector_occ,CoordType>::Instance()->Get((VertType*)this); } + CoordType &UberP() { return CAT< vector_occ,CoordType>::Instance()->Get((VertType*)this); } +}; +template class Coord3fOcc: public CoordOcc {}; +template class Coord3dOcc: public CoordOcc {}; + + +/*-------------------------- NORMAL ----------------------------------------*/ + +template class NormalOcc: public T { +public: + typedef A NormalType; + typedef typename T::VertType VertType; + NormalType &N() {return CAT< vector_occ,NormalType>::Instance()->Get((VertType*)this); } +/*private: + NormalType _norm; */ +}; + +template class Normal3sOcc: public NormalOcc {}; +template class Normal3fOcc: public NormalOcc {}; +template class Normal3dOcc: public NormalOcc {}; + +/*-------------------------- TEXCOORD ----------------------------------------*/ + +template class TexCoordOcc: public TT { +public: + typedef A TexCoordType; + typedef typename TT::VertType VertType; + TexCoordType &T() {return CAT< vector_occ,TexCoordType>::Instance()->Get((VertType*)this); } + static bool HasTexCoord() { return true; } + static bool HasTexCoordOcc() { return true; } + +/* private: + TexCoordType _t; */ +}; + +template class TexCoord2sOcc: public TexCoordOcc, T> {}; +template class TexCoord2fOcc: public TexCoordOcc, T> {}; +template class TexCoord2dOcc: public TexCoordOcc, T> {}; + +///*------------------------- FLAGS -----------------------------------------*/ + +template class FlagOcc: public T { +public: + typedef typename T::VertType VertType; + int &Flags() {return CAT< vector_occ,int>::Instance()->Get((VertType*)this); } + const int Flags() const {return CAT< vector_occ,int>::Instance()->Get((VertType*)this); } + static bool HasFlags() {return true;} + static bool HasFlagsOcc() {return true;} + + +}; + +///*-------------------------- COLOR ----------------------------------*/ + +template class ColorOcc: public T { +public: + typedef A ColorType; + typedef typename T::VertType VertType; + ColorType &C() { return CAT< vector_occ,ColorType>::Instance()->Get((VertType*)this); } + static bool HasColor() { return true; } +/*private: + ColorType _color; */ +}; + +template class Color4bOcc: public ColorOcc {}; + +///*-------------------------- Quality ----------------------------------*/ + +template class QualityOcc: public T { +public: + typedef A QualityType; + typedef typename T::VertType VertType; + QualityType &Q() { return CAT< vector_occ,QualityType>::Instance()->Get((VertType*)this);} + static bool HasQuality() { return true; } + +/*private: + QualityType _quality; */ +}; + +template class QualitysOcc: public QualityOcc {}; +template class QualityfOcc: public QualityOcc {}; +template class QualitydOcc: public QualityOcc {}; +// + +///*-------------------------- Curvature ----------------------------------*/ + +template class CurvatureOcc: public TT { +public: + typedef Point2 CurvatureTypeOcc; + typedef typename TT::VertType VertType; + typedef typename CurvatureTypeOcc::ScalarType ScalarType; + + ScalarType &H(){ return CAT< vector_occ,CurvatureTypeOcc>::Instance()->Get((VertType*)this)[0];} + ScalarType &K(){ return CAT< vector_occ,CurvatureTypeOcc>::Instance()->Get((VertType*)this)[1];} + const ScalarType &cH() const { return CAT< vector_occ,CurvatureTypeOcc>::Instance()->Get((VertType*)this)[0];} + const ScalarType &cK() const { return CAT< vector_occ,CurvatureTypeOcc>::Instance()->Get((VertType*)this)[1];} + + template + void ImportLocal(const LeftV & leftV){ + CAT< vector_occ,CurvatureTypeOcc>::Instance()->Get((VertType*)this)[0] = leftV.cH(); + CAT< vector_occ,CurvatureTypeOcc>::Instance()->Get((VertType*)this)[1] = leftV.cK(); + TT::ImporLocal(leftV); + } + + static bool HasCurvature() { return true; } + static bool HasCurvatureOcc() { return true; } + static void Name(std::vector & name){name.push_back(std::string("CurvatureOcc"));TT::Name(name);} + +private: +}; + +template class CurvaturefOcc: public CurvatureOcc { + static void Name(std::vector & name){name.push_back(std::string("CurvaturefOcc"));T::Name(name);} +}; +template class CurvaturedOcc: public CurvatureOcc { + static void Name(std::vector & name){name.push_back(std::string("CurvaturedOcc"));T::Name(name);} +}; + + +/*-------------------------- Curvature Direction ----------------------------------*/ + +template +struct CurvatureDirTypeOcc{ + typedef Point3 VecType; + typedef S ScalarType; + CurvatureDirTypeOcc () {} + Point3max_dir,min_dir; // max and min curvature direction + S k1,k2;// max and min curvature values +}; + + +template class CurvatureDirOcc: public TT { +public: + typedef A CurvatureDirTypeOcc; + typedef typename CurvatureDirTypeOcc::VecType VecType; + typedef typename CurvatureDirTypeOcc::ScalarType ScalarType; + typedef typename TT::VertType VertType; + + VecType &PD1(){ return CAT< vector_occ,CurvatureDirTypeOcc>::Instance()->Get((VertType*)this).max_dir;} + VecType &PD2(){ return CAT< vector_occ,CurvatureDirTypeOcc>::Instance()->Get((VertType*)this).min_dir;} + const VecType &cPD1() const {return CAT< vector_occ,CurvatureDirTypeOcc>::Instance()->Get((VertType*)this).max_dir;} + const VecType &cPD2() const {return CAT< vector_occ,CurvatureDirTypeOcc>::Instance()->Get((VertType*)this).min_dir;} + + ScalarType &K1(){ return CAT< vector_occ,CurvatureDirTypeOcc>::Instance()->Get((VertType*)this).k1;} + ScalarType &K2(){ return CAT< vector_occ,CurvatureDirTypeOcc>::Instance()->Get((VertType*)this).k2;} + const ScalarType &cK1() const {return CAT< vector_occ,CurvatureDirTypeOcc>::Instance()->Get((VertType*)this).k1;} + const ScalarType &cK2()const {return CAT< vector_occ,CurvatureDirTypeOcc>::Instance()->Get((VertType*)this).k2;} + + static bool HasCurvatureDir() { return true; } + static bool HasCurvatureDirOcc() { return true; } + static void Name(std::vector & name){name.push_back(std::string("CurvatureDir"));TT::Name(name);} + +}; + + +template class CurvatureDirfOcc: public CurvatureDirOcc, T> { +public: static void Name(std::vector & name){name.push_back(std::string("CurvatureDirf"));T::Name(name);} +}; +template class CurvatureDirdOcc: public CurvatureDirOcc, T> { +public: static void Name(std::vector & name){name.push_back(std::string("CurvatureDird"));T::Name(name);} +}; + +/*-------------------------- RADIUS ----------------------------------*/ + +template class RadiusOcc: public TT { +public: + typedef A RadiusType; + typedef A ScalarType; + typedef typename TT::VertType VertType; + + RadiusType &R(){ return CAT< vector_occ,RadiusType>::Instance()->Get((VertType*)this);} + const RadiusType &cR() const { return CAT< vector_occ,RadiusType>::Instance()->Get((VertType*)this);} + + template + void ImportLocal(const LeftV & leftV){ + CAT< vector_occ,RadiusType>::Instance()->Get((VertType*)this) = leftV.cR(); + TT::ImporLocal(leftV); + } + + static bool HasRadius() { return true; } + static bool HasRadiusOcc() { return true; } + static void Name(std::vector & name){name.push_back(std::string("RadiusOcc"));TT::Name(name);} + +private: +}; + +template class RadiusfOcc: public RadiusOcc { + static void Name(std::vector & name){name.push_back(std::string("RadiusfOcc"));T::Name(name);} +}; +template class RadiusdOcc: public RadiusOcc { + static void Name(std::vector & name){name.push_back(std::string("RadiusdOcc"));T::Name(name);} +}; + +///*----------------------------- VFADJ ------------------------------*/ + +template class VFAdjOcc: public T { +public: + typedef typename T::VertType VertType; + typedef typename T::FacePointer FacePointer; + FacePointer &Fp() {return CAT< vector_occ,FacePointer>::Instance()->Get((VertType*)this); } + int &Zp() {return _zp; } + static bool HasVFAdjacency() { return true; } +private: + typename T::FacePointer _fp ; + int _zp ; +}; + + } // end namespace vert +}// end namespace vcg +#endif diff --git a/vcg/simplex/vertex/component_ocf.h b/vcg/simplex/vertex/component_ocf.h new file mode 100644 index 00000000..07e92026 --- /dev/null +++ b/vcg/simplex/vertex/component_ocf.h @@ -0,0 +1,645 @@ +/**************************************************************************** +* VCGLib o o * +* Visual and Computer Graphics Library o o * +* _ O _ * +* Copyright(C) 2004 \/)\/ * +* Visual Computing Lab /\/| * +* ISTI - Italian National Research Council | * +* \ * +* All rights reserved. * +* * +* This program is free software; you can redistribute it and/or modify * +* it under the terms of the GNU General Public License as published by * +* the Free Software Foundation; either version 2 of the License, or * +* (at your option) any later version. * +* * +* This program is distributed in the hope that it will be useful, * +* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * +* GNU General Public License (http://www.gnu.org/licenses/gpl.txt) * +* for more details. * +* * +****************************************************************************/ +/**************************************************************************** + History + +$Log: not supported by cvs2svn $ +Revision 1.16 2008/04/03 23:15:40 cignoni +added optional mark and cleaned up some nasty type bugs. + +Revision 1.15 2008/03/17 11:39:15 ganovelli +added curvature and curvatruredir (compiled .net 2005 and gcc) + +Revision 1.14 2008/03/11 09:22:07 cignoni +Completed the garbage collecting functions CompactVertexVector and CompactFaceVector. + +Revision 1.13 2008/02/05 20:42:43 cignoni +Other small typos + +Revision 1.12 2008/02/04 21:26:49 ganovelli +added ImportLocal which imports all local attributes into vertexplus and faceplus. +A local attribute is everything (N(), C(), Q()....) except pointers to other simplices +(i.e. FFAdj, VFAdj, VertexRef) which are set to NULL. +Added some function for const attributes + +Revision 1.11 2007/12/11 18:25:31 cignoni +added missing include limits + +Revision 1.10 2007/12/11 11:36:03 cignoni +Added the CompactVertexVector garbage collecting function. + +Revision 1.9 2006/12/11 23:42:00 ganovelli +bug Index()() instead of Index() + +Revision 1.8 2006/12/04 11:17:42 ganovelli +added forward declaration of TriMesh + +Revision 1.7 2006/11/07 17:22:52 cignoni +many gcc compiling issues + +Revision 1.6 2006/11/07 15:13:57 zifnab1974 +Necessary changes for compilation with gcc 3.4.6. Especially the hash function is a problem + +Revision 1.5 2006/11/07 11:29:24 cignoni +Corrected some errors in the reflections Has*** functions + +Revision 1.4 2006/10/31 16:02:59 ganovelli +vesione 2005 compliant + +Revision 1.3 2006/02/28 11:59:55 ponchio +g++ compliance: + +begin() -> (*this).begin() and for end(), size(), Base(), Index() + +Revision 1.2 2005/12/12 11:17:32 cignoni +Corrected update function, now only the needed simplexes should be updated. + +Revision 1.1 2005/10/14 15:07:59 cignoni +First Really Working version + + +****************************************************************************/ + +/* +Note +OCF = Optional Component Fast (hopefully) +compare with OCC(Optional Component Compact) + +Mainly the trick here is to store a base pointer in each simplex... + +****************************************************************************/ +#ifndef __VCG_VERTEX_PLUS_COMPONENT_OCF +#define __VCG_VERTEX_PLUS_COMPONENT_OCF + +#include + +#include +#include + +namespace vcg { + namespace vertex { +/* +All the Components that can be added to a vertex should be defined in the namespace vert: + +*/ +template +class vector_ocf: public std::vector { + typedef std::vector BaseType; + typedef typename vector_ocf::iterator ThisTypeIterator; + +public: + vector_ocf():std::vector(){ + QualityEnabled = false; + ColorEnabled = false; + MarkEnabled = false; + NormalEnabled = false; + VFAdjacencyEnabled = false; + CurvatureEnabled = false; + CurvatureEnabled = false; + CurvatureDirEnabled = false; + RadiusEnabled = false; + } + + // override di tutte le funzioni che possono spostare + // l'allocazione in memoria del container + void push_back(const VALUE_TYPE & v) + { + BaseType::push_back(v); + BaseType::back()._ovp = this; + if (ColorEnabled) CV.push_back(vcg::Color4b(vcg::Color4b::White)); + if (MarkEnabled) MV.push_back(0); + if (NormalEnabled) NV.push_back(typename VALUE_TYPE::NormalType()); + if (VFAdjacencyEnabled) AV.push_back(VFAdjType()); + if (CurvatureEnabled) CuV.push_back(typename VALUE_TYPE::CurvatureType()); + if (CurvatureDirEnabled) CuDV.push_back(typename VALUE_TYPE::CurvatureDirType()); + if (RadiusEnabled) RadiusV.push_back(typename VALUE_TYPE::RadiusType()); + } + void pop_back(); + void resize(const unsigned int & _size) + { + const unsigned int oldsize = BaseType::size(); + BaseType::resize(_size); + if(oldsize<_size){ + ThisTypeIterator firstnew = BaseType::begin(); + advance(firstnew,oldsize); + _updateOVP(firstnew,(*this).end()); + } + if (ColorEnabled) CV.resize(_size); + if (MarkEnabled) MV.resize(_size); + if (NormalEnabled) NV.resize(_size); + if (VFAdjacencyEnabled) AV.resize(_size); + if (CurvatureEnabled) CuV.resize(_size); + if (CurvatureDirEnabled) CuDV.resize(_size); + if (RadiusEnabled) RadiusV.resize(_size); + } + + void reserve(const unsigned int & _size) + { + BaseType::reserve(_size); + if (ColorEnabled) CV.reserve(_size); + if (MarkEnabled) MV.reserve(_size); + if (NormalEnabled) NV.reserve(_size); + if (VFAdjacencyEnabled) AV.reserve(_size); + if (CurvatureEnabled) CuV.reserve(_size); + if (CurvatureDirEnabled) CuDV.reserve(_size); + if (RadiusEnabled) RadiusV.reserve(_size); + } + + void _updateOVP(ThisTypeIterator lbegin, ThisTypeIterator lend) + { + ThisTypeIterator vi; + for(vi=lbegin;vi!=lend;++vi) + (*vi)._ovp=this; + } + +// this function is called by the specialized Reorder function, that is called whenever someone call the allocator::CompactVertVector +void ReorderVert(std::vector &newVertIndex ) +{ + size_t i=0; + if (ColorEnabled) assert( CV.size() == newVertIndex.size() ); + if (MarkEnabled) assert( MV.size() == newVertIndex.size() ); + if (NormalEnabled) assert( NV.size() == newVertIndex.size() ); + if (VFAdjacencyEnabled) assert( AV.size() == newVertIndex.size() ); + if (CurvatureEnabled) assert(CuV.size() == newVertIndex.size() ); + if (CurvatureDirEnabled)assert(CuDV.size() == newVertIndex.size() ); + assert( (!RadiusEnabled) || RadiusV.size() == newVertIndex.size() ); + + for(i=0;i::max() ) + { + assert(newVertIndex[i] <= i); + if (ColorEnabled) CV[newVertIndex[i]] = CV[i]; + if (MarkEnabled) MV[newVertIndex[i]] = MV[i]; + if (NormalEnabled) NV[newVertIndex[i]] = NV[i]; + if (VFAdjacencyEnabled) AV[newVertIndex[i]] = AV[i]; + if (CurvatureEnabled) CuV[newVertIndex[i]] = CuV[i]; + if (CurvatureDirEnabled) CuDV[newVertIndex[i]] =CuDV[i]; + if (RadiusEnabled) RadiusV[newVertIndex[i]] = RadiusV[i]; + } + } + + if (ColorEnabled) CV.resize(BaseType::size()); + if (MarkEnabled) MV.resize(BaseType::size()); + if (NormalEnabled) NV.resize(BaseType::size()); + if (VFAdjacencyEnabled) AV.resize(BaseType::size()); + if (CurvatureEnabled) CuV.resize(BaseType::size()); + if (CurvatureDirEnabled) CuDV.resize(BaseType::size()); + if (RadiusEnabled) RadiusV.resize(BaseType::size()); +} + + + +//////////////////////////////////////// +// Enabling Eunctions + +bool IsQualityEnabled() const {return QualityEnabled;} +void EnableQuality() { + assert(VALUE_TYPE::HasQualityOcf()); + QualityEnabled=true; + QV.resize((*this).size()); +} + +void DisableQuality() { + assert(VALUE_TYPE::HasQualityOcf()); + QualityEnabled=false; + QV.clear(); +} + +bool IsColorEnabled() const {return ColorEnabled;} +void EnableColor() { + assert(VALUE_TYPE::HasColorOcf()); + ColorEnabled=true; + CV.resize((*this).size()); +} + +void DisableColor() { + assert(VALUE_TYPE::HasColorOcf()); + ColorEnabled=false; + CV.clear(); +} + +bool IsMarkEnabled() const {return MarkEnabled;} +void EnableMark() { + assert(VALUE_TYPE::HasFaceMarkOcf()); + MarkEnabled=true; + MV.resize((*this).size()); +} + +void DisableMark() { + assert(VALUE_TYPE::HasFaceMarkOcf()); + MarkEnabled=false; + MV.clear(); +} + +bool IsNormalEnabled() const {return NormalEnabled;} +void EnableNormal() { + assert(VALUE_TYPE::HasNormalOcf()); + NormalEnabled=true; + NV.resize((*this).size()); +} + +void DisableNormal() { + assert(VALUE_TYPE::HasNormalOcf()); + NormalEnabled=false; + NV.clear(); +} + +void EnableVFAdjacency() { + assert(VALUE_TYPE::HasVFAdjacencyOcf()); + VFAdjacencyEnabled=true; + AV.resize((*this).size()); +} + +void DisableVFAdjacency() { + assert(VALUE_TYPE::HasVFAdjacencyOcf()); + VFAdjacencyEnabled=false; + AV.clear(); +} + +bool IsCurvatureEnabled() const {return CurvatureEnabled;} +void EnableCurvature() { + assert(VALUE_TYPE::HasCurvatureOcf()); + CurvatureEnabled=true; + CuV.resize((*this).size()); +} + +void DisableCurvature() { + assert(VALUE_TYPE::HasCurvatureOcf()); + CurvatureEnabled=false; + CuV.clear(); +} + +bool IsCurvatureDirEnabled() const {return CurvatureDirEnabled;} +void EnableCurvatureDir() { + assert(VALUE_TYPE::HasCurvatureDirOcf()); + CurvatureDirEnabled=true; + CuDV.resize((*this).size()); +} + +void DisableCurvatureDir() { + assert(VALUE_TYPE::HasCurvatureDirOcf()); + CurvatureDirEnabled=false; + CuDV.clear(); +} + +bool IsRadiusEnabled() const {return RadiusEnabled;} +void EnableRadius() { + assert(VALUE_TYPE::HasRadiusOcf()); + RadiusEnabled=true; + RadiusV.resize((*this).size()); +} + +void DisableRadius() { + assert(VALUE_TYPE::HasRadiusOcf()); + RadiusEnabled=false; + RadiusV.clear(); +} + +struct VFAdjType { + typename VALUE_TYPE::FacePointer _fp ; + int _zp ; + }; + +public: + std::vector QV; + std::vector CuV; + std::vector CuDV; + std::vector RadiusV; + std::vector CV; + std::vector NV; + std::vector AV; + std::vector MV; + + bool QualityEnabled; + bool ColorEnabled; + bool NormalEnabled; + bool VFAdjacencyEnabled; + bool CurvatureEnabled; + bool CurvatureDirEnabled; + bool MarkEnabled; + bool RadiusEnabled; +}; + + +//template<> void EnableAttribute(){ NormalEnabled=true;} + +/*------------------------- COORD -----------------------------------------*/ +/*----------------------------- VFADJ ------------------------------*/ + + +template class VFAdjOcf: public T { +public: + typename T::FacePointer &VFp() { + assert((*this).Base().VFAdjacencyEnabled); + return (*this).Base().AV[(*this).Index()]._fp; + } + + typename T::FacePointer cVFp() const { + if(! (*this).Base().VFAdjacencyEnabled ) return 0; + else return (*this).Base().AV[(*this).Index()]._fp; + } + + int &VFi() { + assert((*this).Base().VFAdjacencyEnabled); + return (*this).Base().AV[(*this).Index()]._zp; + } + template + void ImportLocal(const LeftV & leftV) + { + if((*this).Base().VFAdjacencyEnabled) // init the data only if they are enabled! + { + VFp() = NULL; + VFi() = -1; + } + T::ImportLocal(leftV); + } + + static bool HasVFAdjacency() { return true; } + static bool HasVFAdjacencyOcf() {assert(!T::HasVFAdjacencyOcf()); return true; } + +private: +}; + +/*------------------------- Normal -----------------------------------------*/ + +template class NormalOcf: public T { +public: + typedef A NormalType; + static bool HasNormal() { return true; } + static bool HasNormalOcf() { return true; } + + NormalType &N() { + // you cannot use Normals before enabling them with: yourmesh.vert.EnableNormal() + assert((*this).Base().NormalEnabled); + return (*this).Base().NV[(*this).Index()]; } + const NormalType &N() const { + // you cannot use Normals before enabling them with: yourmesh.vert.EnableNormal() + assert((*this).Base().NormalEnabled); + return (*this).Base().NV[(*this).Index()]; } + + template + void ImportLocal(const LeftV & leftV){ + if((*this).Base().NormalEnabled && leftV.Base().NormalEnabled ) // copy the data only if they are enabled in both vertices + N().Import(leftV.cN()); + T::ImporLocal(leftV);} +}; + +template class Normal3sOcf: public NormalOcf {}; +template class Normal3fOcf: public NormalOcf {}; +template class Normal3dOcf: public NormalOcf {}; + +///*-------------------------- COLOR ----------------------------------*/ + +template class ColorOcf: public T { +public: + typedef A ColorType; + ColorType &C() { assert((*this).Base().NormalEnabled); return (*this).Base().CV[(*this).Index()]; } + const ColorType &cC() const { assert((*this).Base().ColorEnabled); return (*this).Base().CV[(*this).Index()]; } + template + void ImportLocal(const LeftV & leftV) + { + if((*this).Base().ColorEnabled && leftV.Base().ColorEnabled ) // copy the data only if they are enabled in both vertices + C() = leftV.cC(); + T::ImporLocal(leftV); + } + + static bool HasColor() { return true; } + static bool HasColorOcf() { assert(!T::HasColorOcf()); return true; } +}; + +template class Color4bOcf: public ColorOcf {}; + +///*-------------------------- QUALITY ----------------------------------*/ + +template class QualityOcf: public T { +public: + typedef A QualityType; + QualityType &Q() { assert((*this).Base().QualityEnabled); return (*this).Base().QV[(*this).Index()]; } + template + void ImportLocal(const LeftV & leftV) + { + if((*this).Base().QualityEnabled && leftV.Base().QualityEnabled ) // copy the data only if they are enabled in both vertices + Q() = leftV.cQ(); + T::ImporLocal(leftV); + } + static bool HasQuality() { return true; } + static bool HasQualityOcf() { assert(!T::HasQualityOcf()); return true; } +}; + +template class QualityfOcf: public QualityOcf {}; + +///*-------------------------- MARK ----------------------------------*/ + +template class MarkOcf: public T { +public: + inline int & IMark() { + assert((*this).Base().MarkEnabled); + return (*this).Base().MV[(*this).Index()]; + } + + inline int IMark() const { + assert((*this).Base().MarkEnabled); + return (*this).Base().MV[(*this).Index()]; + } + + template + void ImportLocal(const LeftV & leftV) + { + if((*this).Base().MarkEnabled && leftV.Base().MarkEnabled ) // copy the data only if they are enabled in both vertices + IMark() = leftV.IMark(); + T::ImportLocal(leftV); + } + static bool HasFaceMark() { return true; } + static bool HasFaceMarkOcf() { return true; } + inline void InitIMark() { IMark() = 0; } +}; + + +///*-------------------------- CURVATURE ----------------------------------*/ + +template class CurvatureOcf: public TT { +public: + typedef Point2 CurvatureType; + typedef typename CurvatureType::ScalarType ScalarType; + + ScalarType &Kh(){ assert((*this).Base().CurvatureEnabled); return (*this).Base().CuV[(*this).Index()][0];} + ScalarType &Kg(){ assert((*this).Base().CurvatureEnabled); return (*this).Base().CuV[(*this).Index()][1];} + const ScalarType &cKh() const { assert((*this).Base().CurvatureEnabled); return (*this).Base().CuV[(*this).Index()][0];} + const ScalarType &cKg() const { assert((*this).Base().CurvatureEnabled); return (*this).Base().CuV[(*this).Index()][1];} + + template + void ImportLocal(const LeftV & leftV){ + if((*this).Base().CurvatureEnabled && leftV.Base().CurvatureEnabled ) // copy the data only if they are enabled in both vertices + { + (*this).Base().CuV[(*this).Index()][0] = leftV.cKh(); + (*this).Base().CuV[(*this).Index()][1] = leftV.cKg(); + } + TT::ImportLocal(leftV); + } + + static bool HasCurvatureOcf() { return true; } + static void Name(std::vector & name){name.push_back(std::string("CurvatureOcf"));TT::Name(name);} + +private: +}; + +template class CurvaturefOcf: public CurvatureOcf {}; +template class CurvaturedOcf: public CurvatureOcf {}; + + +///*-------------------------- CURVATURE DIR ----------------------------------*/ + +template +struct CurvatureDirTypeOcf{ + typedef Point3 VecType; + typedef S ScalarType; + CurvatureDirTypeOcf () {} + Point3max_dir,min_dir; + S k1,k2; +}; + + +template class CurvatureDirOcf: public TT { +public: + typedef A CurvatureDirType; + typedef typename CurvatureDirType::VecType VecType; + typedef typename CurvatureDirType::ScalarType ScalarType; + + VecType &PD1(){ assert((*this).Base().CurvatureDirEnabled); return (*this).Base().CuDV[(*this).Index()].max_dir;} + VecType &PD2(){ assert((*this).Base().CurvatureDirEnabled); return (*this).Base().CuDV[(*this).Index()].min_dir;} + const VecType &cPD1() const {assert((*this).Base().CurvatureDirEnabled); return (*this).Base().CuV[(*this).Index()].max_dir;} + const VecType &cPD2() const {assert((*this).Base().CurvatureDirEnabled); return (*this).Base().CuV[(*this).Index()].min_dir;} + + ScalarType &K1(){ assert((*this).Base().CurvatureDirEnabled); return (*this).Base().CuDV[(*this).Index()].k1;} + ScalarType &K2(){ assert((*this).Base().CurvatureDirEnabled); return (*this).Base().CuDV[(*this).Index()].k2;} + const ScalarType &cK1() const {assert((*this).Base().CurvatureDirEnabled); return (*this).Base().CuDV[(*this).Index()].k1;} + const ScalarType &cK2()const {assert((*this).Base().CurvatureDirEnabled); return (*this).Base().CuDV[(*this).Index()].k2;} + + static bool HasCurvatureDirOcf() { return true; } + static void Name(std::vector & name){name.push_back(std::string("CurvatureDirOcf"));TT::Name(name);} + +private: +}; + + +template class CurvatureDirfOcf: public CurvatureDirOcf, T> { +public: static void Name(std::vector & name){name.push_back(std::string("CurvatureDirfOcf"));T::Name(name);} +}; +template class CurvatureDirdOcf: public CurvatureDirOcf, T> { +public: static void Name(std::vector & name){name.push_back(std::string("CurvatureDirdOcf"));T::Name(name);} +}; + + +///*-------------------------- RADIUS ----------------------------------*/ + +template class RadiusOcf: public TT { +public: + typedef A RadiusType; + typedef RadiusType ScalarType; + + RadiusType &R(){ assert((*this).Base().RadiusEnabled); return (*this).Base().RadiusV[(*this).Index()];} + const RadiusType &cR() const { assert((*this).Base().RadiusEnabled); return (*this).Base().RadiusV[(*this).Index()];} + + template + void ImportLocal(const LeftV & leftV) + { + if ((*this).Base().RadiusEnabled && leftV.Base().RadiusEnabled ) + (*this).Base().RadiusV[(*this).Index()] = leftV.cR(); + TT::ImportLocal(leftV); + } + + static bool HasRadius() { return true; } + static bool HasRadiusOcf() { return true; } + static void Name(std::vector & name){name.push_back(std::string("RadiusOcf")); TT::Name(name);} + +private: +}; + +template class RadiusfOcf: public RadiusOcf {}; +template class RadiusdOcf: public RadiusOcf {}; + + +///*-------------------------- InfoOpt ----------------------------------*/ + +template < class T> class InfoOcf: public T { +public: + vector_ocf &Base() const { return *_ovp;} + + inline int Index() const { + typename T::VertType const *tp=static_cast(this); + int tt2=tp- &*(_ovp->begin()); + return tt2; + } +public: + vector_ocf *_ovp; + + static bool HasQualityOcf() { return false; } + static bool HasVFAdjacencyOcf() { return false; } +}; + + +} // end namespace vert + + +namespace tri +{ + + template < class, class,class > class TriMesh; + + template < class VertexType, class FaceContainerType, class EdgeContainerType > + bool HasPerVertexRadius (const TriMesh < vertex::vector_ocf< VertexType > , FaceContainerType, EdgeContainerType > & m) + { + if(VertexType::HasRadiusOcf()) return m.vert.IsRadiusEnabled(); + else return VertexType::HasRadius(); + } + + template < class VertexType, class FaceContainerType, class EdgeContainerType > + bool HasPerVertexQuality (const TriMesh < vertex::vector_ocf< VertexType > , FaceContainerType , EdgeContainerType> & m) + { + if(VertexType::HasQualityOcf()) return m.vert.IsQualityEnabled(); + else return VertexType::HasQuality(); + } + + template < class VertexType, class FaceContainerType, class EdgeContainerType > + bool HasPerVertexCurvature (const TriMesh < vertex::vector_ocf< VertexType > , FaceContainerType, EdgeContainerType > & m) + { + if(VertexType::HasCurvatureOcf()) return m.vert.IsCurvatureEnabled(); + else return VertexType::HasCurvature(); + } + + template < class VertexType, class FaceContainerType, class EdgeContainerType > + bool HasPerVertexCurvatureDir (const TriMesh < vertex::vector_ocf< VertexType > , FaceContainerType, EdgeContainerType > & m) + { + if(VertexType::HasCurvatureDirOcf()) return m.vert.IsCurvatureDirEnabled(); + else return VertexType::HasCurvatureDir(); + } + + template < class VertexType > + void ReorderVert( std::vector &newVertIndex, vertex::vector_ocf< VertexType > &vertVec) + { + vertVec.ReorderVert(newVertIndex); + } +} +}// end namespace vcg +#endif diff --git a/vcg/simplex/vertex/component_sph.h b/vcg/simplex/vertex/component_sph.h new file mode 100644 index 00000000..a9c80b0e --- /dev/null +++ b/vcg/simplex/vertex/component_sph.h @@ -0,0 +1,58 @@ +#ifndef COMPONENT_SPH_ +#define COMPONENT_SPH_ + +#include + +namespace vcg { +namespace vertex { + +template class Sph: public T +{ +public: + typedef A SphType; + SphType &SH() { return _harmonics; } + const SphType &cSH() const { return _harmonics; } + template < class LeftV> + void ImportLocal(const LeftV & left ) { SH() = left.cSH(); T::ImportLocal( left); } + static bool HasSH() { return true; } + static void Name(std::vector & name){name.push_back(std::string("Spherical Harmonics"));T::Name(name);} + +private: + SphType _harmonics; +}; + +template class Sph9f: public Sph, T> { + public: static void Name(std::vector & name){name.push_back(std::string("Sph9f"));T::Name(name);} +}; + +template class Sph16f: public Sph, T> { + public: static void Name(std::vector & name){name.push_back(std::string("Sph16f"));T::Name(name);} +}; + +template class Sph25f: public Sph, T> { + public: static void Name(std::vector & name){name.push_back(std::string("Sph25f"));T::Name(name);} +}; + +template class Sph36f: public Sph, T> { + public: static void Name(std::vector & name){name.push_back(std::string("Sph36f"));T::Name(name);} +}; + +template class Sph9d: public Sph, T> { + public: static void Name(std::vector & name){name.push_back(std::string("Sph9d"));T::Name(name);} +}; + +template class Sph16d: public Sph, T> { + public: static void Name(std::vector & name){name.push_back(std::string("Sph16d"));T::Name(name);} +}; + +template class Sph25d: public Sph, T> { + public: static void Name(std::vector & name){name.push_back(std::string("Sph25d"));T::Name(name);} +}; + +template class Sph36d: public Sph, T> { + public: static void Name(std::vector & name){name.push_back(std::string("Sph36d"));T::Name(name);} +}; + +}} + +#endif /*COMPONENT_H_*/ diff --git a/vcg/simplex/vertex/vertex.h b/vcg/simplex/vertex/vertex_old.h similarity index 100% rename from vcg/simplex/vertex/vertex.h rename to vcg/simplex/vertex/vertex_old.h diff --git a/vcg/simplex/vertex/with/ae.h b/vcg/simplex/vertex/with/ae.h deleted file mode 100644 index 83930c99..00000000 --- a/vcg/simplex/vertex/with/ae.h +++ /dev/null @@ -1,23 +0,0 @@ -#ifndef __VCGLIB_VERTEX__AE__TYPE -#define __VCGLIB_VERTEX__AE__TYPE - -#define VERTEX_TYPE VertexAE - -#define __VCGLIB_VERTEX_AE - -#include - -#undef VERTEX_TYPE -#undef __VCGLIB_VERTEX_AE - -namespace vcg { - -template < class VETYPE, class VFTYPE, class VTTYPE> -class VertexAEf : public VertexAE {}; - -template < class VETYPE, class VFTYPE, class VTTYPE> -class VertexAEd : public VertexAE {}; - -} - -#endif diff --git a/vcg/simplex/vertex/with/af.h b/vcg/simplex/vertex/with/af.h deleted file mode 100644 index 4fa8f1bb..00000000 --- a/vcg/simplex/vertex/with/af.h +++ /dev/null @@ -1,23 +0,0 @@ -#ifndef __VCGLIB_VERTEX__AF__TYPE -#define __VCGLIB_VERTEX__AF__TYPE - -#define VERTEX_TYPE VertexAF - -#define __VCGLIB_VERTEX_AF - -#include - -#undef VERTEX_TYPE -#undef __VCGLIB_VERTEX_AF - -namespace vcg { - -template < class VETYPE, class VFTYPE, class VTTYPE> -class VertexAFf : public VertexAF {}; - -template < class VETYPE, class VFTYPE, class VTTYPE> -class VertexAFd : public VertexAF {}; - -} - -#endif diff --git a/vcg/simplex/vertex/with/afatvcvnvq.h b/vcg/simplex/vertex/with/afatvcvnvq.h deleted file mode 100644 index 51b129dc..00000000 --- a/vcg/simplex/vertex/with/afatvcvnvq.h +++ /dev/null @@ -1,35 +0,0 @@ -#ifndef __VCGLIB_VERTEX__AFATVCVNVQ__TYPE -#define __VCGLIB_VERTEX__AFATVCVNVQ__TYPE - - -#define VERTEX_TYPE VertexAFATVCVNVQ - -#define __VCGLIB_VERTEX_AF -#define __VCGLIB_VERTEX_AT -#define __VCGLIB_VERTEX_VC -#define __VCGLIB_VERTEX_VN -#define __VCGLIB_VERTEX_VQ - - -#include - - -#undef VERTEX_TYPE -#undef __VCGLIB_VERTEX_AF -#undef __VCGLIB_VERTEX_AT -#undef __VCGLIB_VERTEX_VC -#undef __VCGLIB_VERTEX_VN -#undef __VCGLIB_VERTEX_VQ - - -namespace vcg { - -template < class VETYPE, class VFTYPE, class VTTYPE> -class VertexAFATVCVNVQf : public VertexAFATVCVNVQ {}; - -template < class VETYPE, class VFTYPE, class VTTYPE> -class VertexAFATVCVNVQd : public VertexAFATVCVNVQ {}; - -} - -#endif \ No newline at end of file diff --git a/vcg/simplex/vertex/with/afvcvmvn.h b/vcg/simplex/vertex/with/afvcvmvn.h deleted file mode 100644 index 29480608..00000000 --- a/vcg/simplex/vertex/with/afvcvmvn.h +++ /dev/null @@ -1,32 +0,0 @@ -#ifndef __VCGLIB_VERTEX__VCVN__TYPE -#define __VCGLIB_VERTEX__VCVN__TYPE - - -#define VERTEX_TYPE VertexAFVCVMVN - -#define __VCGLIB_VERTEX_AF -#define __VCGLIB_VERTEX_VN -#define __VCGLIB_VERTEX_VC -#define __VCGLIB_VERTEX_VM - -#include - - -#undef VERTEX_TYPE -#undef __VCGLIB_VERTEX_VM -#undef __VCGLIB_VERTEX_AF -#undef __VCGLIB_VERTEX_VN -#undef __VCGLIB_VERTEX_VC - - -namespace vcg { - -template < class VETYPE, class VFTYPE, class VTTYPE> -class VertexAFVCVMVNf : public VertexAFVCVMVN {}; - -template < class VETYPE, class VFTYPE, class VTTYPE> -class VertexAFVCVMVNd : public VertexAFVCVMVN {}; - -} - -#endif diff --git a/vcg/simplex/vertex/with/afvcvnvq.h b/vcg/simplex/vertex/with/afvcvnvq.h deleted file mode 100644 index 7a93febb..00000000 --- a/vcg/simplex/vertex/with/afvcvnvq.h +++ /dev/null @@ -1,33 +0,0 @@ -#ifndef __VCGLIB_VERTEX__AFVCVNVQ__TYPE -#define __VCGLIB_VERTEX__AFVCVNVQ__TYPE - - -#define VERTEX_TYPE VertexAFVCVNVQ - -#define __VCGLIB_VERTEX_AF -#define __VCGLIB_VERTEX_VC -#define __VCGLIB_VERTEX_VN -#define __VCGLIB_VERTEX_VQ - - -#include - - -#undef VERTEX_TYPE -#undef __VCGLIB_VERTEX_AF -#undef __VCGLIB_VERTEX_VC -#undef __VCGLIB_VERTEX_VN -#undef __VCGLIB_VERTEX_VQ - - -namespace vcg { - -template < class VETYPE, class VFTYPE, class VTTYPE> -class VertexAFVCVNVQf : public VertexAFVCVNVQ {}; - -template < class VETYPE, class VFTYPE, class VTTYPE> -class VertexAFVCVNVQd : public VertexAFVCVNVQ {}; - -} - -#endif diff --git a/vcg/simplex/vertex/with/afvm.h b/vcg/simplex/vertex/with/afvm.h deleted file mode 100644 index c28129e8..00000000 --- a/vcg/simplex/vertex/with/afvm.h +++ /dev/null @@ -1,29 +0,0 @@ -#ifndef __VCGLIB_VERTEX__AFVM__TYPE -#define __VCGLIB_VERTEX__AFVM__TYPE - - -#define VERTEX_TYPE VertexAFVM - -#define __VCGLIB_VERTEX_AF -#define __VCGLIB_VERTEX_VM - - -#include - - -#undef VERTEX_TYPE -#undef __VCGLIB_VERTEX_AF -#undef __VCGLIB_VERTEX_VM - - -namespace vcg { - -template < class VETYPE, class VFTYPE, class VTTYPE> -class VertexAFVMf : public VertexAFVM {}; - -template < class VETYPE, class VFTYPE, class VTTYPE> -class VertexAFVMd : public VertexAFVM {}; - -} - -#endif \ No newline at end of file diff --git a/vcg/simplex/vertex/with/afvmvn.h b/vcg/simplex/vertex/with/afvmvn.h deleted file mode 100644 index b45fff39..00000000 --- a/vcg/simplex/vertex/with/afvmvn.h +++ /dev/null @@ -1,28 +0,0 @@ -#ifndef __VCGLIB_VERTEX__AF__TYPE -#define __VCGLIB_VERTEX__VM__TYPE -#define __VCGLIB_VERTEX__VN__TYPE - -#define VERTEX_TYPE VertexAFVMVN - -#define __VCGLIB_VERTEX_AF -#define __VCGLIB_VERTEX_VM -#define __VCGLIB_VERTEX_VN - -#include - -#undef VERTEX_TYPE -#undef __VCGLIB_VERTEX__AF__TYPE -#undef __VCGLIB_VERTEX__VM__TYPE -#undef __VCGLIB_VERTEX__VN__TYPE - -namespace vcg { - -template < class VETYPE, class VFTYPE, class VTTYPE> -class VertexAFVMVNf : public VertexAFVMVN {}; - -template < class VETYPE, class VFTYPE, class VTTYPE> -class VertexAFVMVNd : public VertexAFVMVN {}; - -} - -#endif diff --git a/vcg/simplex/vertex/with/afvmvnvq.h b/vcg/simplex/vertex/with/afvmvnvq.h deleted file mode 100644 index 281eabf3..00000000 --- a/vcg/simplex/vertex/with/afvmvnvq.h +++ /dev/null @@ -1,31 +0,0 @@ -#ifndef __VCGLIB_VERTEX__AF__TYPE -#define __VCGLIB_VERTEX__VM__TYPE -#define __VCGLIB_VERTEX__VN__TYPE -#define __VCGLIB_VERTEX__VQ__TYPE - -#define VERTEX_TYPE VertexAFVMVNVQ - -#define __VCGLIB_VERTEX_AF -#define __VCGLIB_VERTEX_VM -#define __VCGLIB_VERTEX_VN -#define __VCGLIB_VERTEX_VQ - -#include - -#undef VERTEX_TYPE -#undef __VCGLIB_VERTEX__AF__TYPE -#undef __VCGLIB_VERTEX__VM__TYPE -#undef __VCGLIB_VERTEX__VN__TYPE -#undef __VCGLIB_VERTEX__VQ__TYPE - -namespace vcg { - -template < class VETYPE, class VFTYPE, class VTTYPE> -class VertexAFVMVNVQf : public VertexAFVMVNVQ {}; - -template < class VETYPE, class VFTYPE, class VTTYPE> -class VertexAFVMVNVQd : public VertexAFVMVNVQ {}; - -} - -#endif diff --git a/vcg/simplex/vertex/with/afvn.h b/vcg/simplex/vertex/with/afvn.h deleted file mode 100644 index 7e9d1032..00000000 --- a/vcg/simplex/vertex/with/afvn.h +++ /dev/null @@ -1,29 +0,0 @@ -#ifndef __VCGLIB_VERTEX__AFVN__TYPE -#define __VCGLIB_VERTEX__AFVN__TYPE - - -#define VERTEX_TYPE VertexAFVN - -#define __VCGLIB_VERTEX_AF -#define __VCGLIB_VERTEX_VN - - -#include - - -#undef VERTEX_TYPE -#undef __VCGLIB_VERTEX_AF -#undef __VCGLIB_VERTEX_VN - - -namespace vcg { - -template < class VETYPE, class VFTYPE, class VTTYPE> -class VertexAFVNf : public VertexAFVN {}; - -template < class VETYPE, class VFTYPE, class VTTYPE> -class VertexAFVNd : public VertexAFVN {}; - -} - -#endif \ No newline at end of file diff --git a/vcg/simplex/vertex/with/at.h b/vcg/simplex/vertex/with/at.h deleted file mode 100644 index 123d4f56..00000000 --- a/vcg/simplex/vertex/with/at.h +++ /dev/null @@ -1,23 +0,0 @@ -#ifndef __VCGLIB_VERTEX__AT__TYPE -#define __VCGLIB_VERTEX__AT__TYPE - -#define VERTEX_TYPE VertexAT - -#define __VCGLIB_VERTEX_AT - -#include - -#undef VERTEX_TYPE -#undef __VCGLIB_VERTEX_AT - -namespace vcg { - -template < class VETYPE, class VFTYPE, class VTTYPE> -class VertexATf : public VertexAT {}; - -template < class VETYPE, class VFTYPE, class VTTYPE> -class VertexATd : public VertexAT {}; - -} - -#endif diff --git a/vcg/simplex/vertex/with/atvmvn.h b/vcg/simplex/vertex/with/atvmvn.h deleted file mode 100644 index 5009ed00..00000000 --- a/vcg/simplex/vertex/with/atvmvn.h +++ /dev/null @@ -1,27 +0,0 @@ -#ifndef __VCGLIB_VERTEX__ATVMVN__TYPE -#define __VCGLIB_VERTEX__ATVMVN__TYPE - -#define VERTEX_TYPE VertexATVMVN - -#define __VCGLIB_VERTEX_AT -#define __VCGLIB_VERTEX_VM -#define __VCGLIB_VERTEX_VN - -#include - -#undef VERTEX_TYPE -#undef __VCGLIB_VERTEX_AT -#undef __VCGLIB_VERTEX_VM -#undef __VCGLIB_VERTEX_VN - -namespace vcg { - -template < class VETYPE, class VFTYPE, class VTTYPE,class TCTYPE = TexCoord2, class CoordTYPE= Point3 > -class VertexATVMVNf : public VertexATVMVN {}; - -template < class VETYPE, class VFTYPE, class VTTYPE> -class VertexATVMVNd : public VertexATVMVN {}; - -} - -#endif diff --git a/vcg/simplex/vertex/with/atvn.h b/vcg/simplex/vertex/with/atvn.h deleted file mode 100644 index 73cd32b2..00000000 --- a/vcg/simplex/vertex/with/atvn.h +++ /dev/null @@ -1,25 +0,0 @@ -#ifndef __VCGLIB_VERTEX__AT__TYPE -#define __VCGLIB_VERTEX__AT__TYPE - -#define VERTEX_TYPE VertexATVN - -#define __VCGLIB_VERTEX_AT -#define __VCGLIB_VERTEX_VN - -#include - -#undef VERTEX_TYPE -#undef __VCGLIB_VERTEX_AT -#undef __VCGLIB_VERTEX_VN - -namespace vcg { - -template < class VETYPE, class VFTYPE, class VTTYPE> -class VertexATVNf : public VertexATVN {}; - -template < class VETYPE, class VFTYPE, class VTTYPE> -class VertexATVNd : public VertexATVN {}; - -} - -#endif diff --git a/vcg/simplex/vertex/with/atvnvm.h b/vcg/simplex/vertex/with/atvnvm.h deleted file mode 100644 index a5d40e10..00000000 --- a/vcg/simplex/vertex/with/atvnvm.h +++ /dev/null @@ -1,27 +0,0 @@ -#ifndef __VCGLIB_VERTEX__AT__TYPE -#define __VCGLIB_VERTEX__AT__TYPE - -#define VERTEX_TYPE VertexATVN - -#define __VCGLIB_VERTEX_AT -#define __VCGLIB_VERTEX_VN -#define __VCGLIB_VERTEX_VM - -#include - -#undef VERTEX_TYPE -#undef __VCGLIB_VERTEX_VM -#undef __VCGLIB_VERTEX_AT -#undef __VCGLIB_VERTEX_VN - -namespace vcg { - -template < class VETYPE, class VFTYPE, class VTTYPE> -class VertexATVNf : public VertexATVN {}; - -template < class VETYPE, class VFTYPE, class VTTYPE> -class VertexATVNd : public VertexATVN {}; - -} - -#endif diff --git a/vcg/simplex/vertex/with/readme.txt b/vcg/simplex/vertex/with/readme.txt deleted file mode 100644 index e2415c02..00000000 --- a/vcg/simplex/vertex/with/readme.txt +++ /dev/null @@ -1,53 +0,0 @@ -/**************************************************************************** -* VCGLib o o * -* Visual and Computer Graphics Library o o * -* _ O _ * -* Copyright(C) 2004 \/)\/ * -* Visual Computing Lab /\/| * -* ISTI - Italian National Research Council | * -* \ * -* All rights reserved. * -* * -* This program is free software; you can redistribute it and/or modify * -* it under the terms of the GNU General Public License as published by * -* the Free Software Foundation; either version 2 of the License, or * -* (at your option) any later version. * -* * -* This program is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * -* GNU General Public License (http://www.gnu.org/licenses/gpl.txt) * -* for more details. * -* * -****************************************************************************/ - -This folders contains most common VERTEX configuration files. - -The name of the file specifies the members that are added to the vertex -class. The name is a sequence of letter pairs, in strict alphabetical order. The -possible admitted letters pairs are: - -Adjacency Info - -AF - Vertex-Face adjacency -AE - Vertex-Edge adjacency -AT - Vertex-Tetra adjacency - -Per-Vertex Data -VC - Color -VN - Normal -VM - Incremental Mark -VQ - Quality -VT - Texture Coords - -E.g. - -#include - -generate a type - -VertexAFVCVQ - -That can store V-F adjacency, color, normal and quality. - - diff --git a/vcg/simplex/vertex/with/vc.h b/vcg/simplex/vertex/with/vc.h deleted file mode 100644 index fe02e508..00000000 --- a/vcg/simplex/vertex/with/vc.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef __VCGLIB_VERTEX__VCVN__TYPE -#define __VCGLIB_VERTEX__VCVN__TYPE - - -#define VERTEX_TYPE VertexVC - -#define __VCGLIB_VERTEX_VC - -#include - - -#undef VERTEX_TYPE -#undef __VCGLIB_VERTEX_VC - - -namespace vcg { - -template < class VETYPE, class VFTYPE, class VTTYPE> -class VertexVCf : public VertexVC {}; - -template < class VETYPE, class VFTYPE, class VTTYPE> -class VertexVCd : public VertexVC {}; - -} - -#endif diff --git a/vcg/simplex/vertex/with/vcvmvnvq.h b/vcg/simplex/vertex/with/vcvmvnvq.h deleted file mode 100644 index 640a7392..00000000 --- a/vcg/simplex/vertex/with/vcvmvnvq.h +++ /dev/null @@ -1,27 +0,0 @@ -#ifndef __VCGLIB_VERTEX__VCVMVNVQ__TYPE -#define __VCGLIB_VERTEX__VCVMVNVQ__TYPE - - -#define VERTEX_TYPE VertexVCVMVNVQ - -#define __VCGLIB_VERTEX_VC -#define __VCGLIB_VERTEX_VM -#define __VCGLIB_VERTEX_VN -#define __VCGLIB_VERTEX_VQ - -#include - - -#undef VERTEX_TYPE -#undef __VCGLIB_VERTEX_VC -#undef __VCGLIB_VERTEX_VM -#undef __VCGLIB_VERTEX_VN -#undef __VCGLIB_VERTEX_VQ - - -namespace vcg { -typedef VertexVCVMVNVQ VertexVCVMVNVQf; -typedef VertexVCVMVNVQ VertexVCVMVNVQd; -} - -#endif diff --git a/vcg/simplex/vertex/with/vcvmvnvt.h b/vcg/simplex/vertex/with/vcvmvnvt.h deleted file mode 100644 index 6a0f0ccf..00000000 --- a/vcg/simplex/vertex/with/vcvmvnvt.h +++ /dev/null @@ -1,32 +0,0 @@ -#ifndef __VCGLIB_VERTEX__VCVMVNVT__TYPE -#define __VCGLIB_VERTEX__VCVMVNVT__TYPE - - -#define VERTEX_TYPE VertexVCVMVNVT - -#define __VCGLIB_VERTEX_VC -#define __VCGLIB_VERTEX_VM -#define __VCGLIB_VERTEX_VN -#define __VCGLIB_VERTEX_VT - -#include - - -#undef VERTEX_TYPE -#undef __VCGLIB_VERTEX_VC -#undef __VCGLIB_VERTEX_VM -#undef __VCGLIB_VERTEX_VN -#undef __VCGLIB_VERTEX_VT - - -namespace vcg { - -template < class VETYPE, class VFTYPE, class VTTYPE> -class VertexVCVMVNVTf : public VertexVCVMVNVT {}; - -template < class VETYPE, class VFTYPE, class VTTYPE> -class VertexVCVMVNVTd : public VertexVCVMVNVT {}; - -} - -#endif /* __VCGLIB_VERTEX__VCVMVNVT__TYPE */ diff --git a/vcg/simplex/vertex/with/vcvn.h b/vcg/simplex/vertex/with/vcvn.h deleted file mode 100644 index 683300ee..00000000 --- a/vcg/simplex/vertex/with/vcvn.h +++ /dev/null @@ -1,28 +0,0 @@ -#ifndef __VCGLIB_VERTEX__VCVN__TYPE -#define __VCGLIB_VERTEX__VCVN__TYPE - - -#define VERTEX_TYPE VertexVCVN - -#define __VCGLIB_VERTEX_VN -#define __VCGLIB_VERTEX_VC - -#include - - -#undef VERTEX_TYPE -#undef __VCGLIB_VERTEX_VN -#undef __VCGLIB_VERTEX_VC - - -namespace vcg { - -template < class VETYPE, class VFTYPE, class VTTYPE> -class VertexVCVNf : public VertexVCVN {}; - -template < class VETYPE, class VFTYPE, class VTTYPE> -class VertexVCVNd : public VertexVCVN {}; - -} - -#endif diff --git a/vcg/simplex/vertex/with/vcvnvq.h b/vcg/simplex/vertex/with/vcvnvq.h deleted file mode 100644 index da13eb6b..00000000 --- a/vcg/simplex/vertex/with/vcvnvq.h +++ /dev/null @@ -1,25 +0,0 @@ -#ifndef __VCGLIB_VERTEX__VCVNVQ__TYPE -#define __VCGLIB_VERTEX__VCVNVQ__TYPE - - -#define VERTEX_TYPE VertexVCVNVQ - -#define __VCGLIB_VERTEX_VC -#define __VCGLIB_VERTEX_VN -#define __VCGLIB_VERTEX_VQ - -#include - - -#undef VERTEX_TYPE -#undef __VCGLIB_VERTEX_VC -#undef __VCGLIB_VERTEX_VN -#undef __VCGLIB_VERTEX_VQ - - -namespace vcg { -typedef VertexVCVNVQ VertexVCVNVQf; -typedef VertexVCVNVQ VertexVCVNVQd; -} - -#endif diff --git a/vcg/simplex/vertex/with/vcvq.h b/vcg/simplex/vertex/with/vcvq.h deleted file mode 100644 index ccd876c7..00000000 --- a/vcg/simplex/vertex/with/vcvq.h +++ /dev/null @@ -1,23 +0,0 @@ -#ifndef __VCGLIB_VERTEX__VCVQ__TYPE -#define __VCGLIB_VERTEX__VCVQ__TYPE - - -#define VERTEX_TYPE VertexVCVQ - -#define __VCGLIB_VERTEX_VC -#define __VCGLIB_VERTEX_VQ - -#include - - -#undef VERTEX_TYPE - -#undef __VCGLIB_VERTEX_VC -#undef __VCGLIB_VERTEX_VQ - -namespace vcg { -typedef VertexVCVQ VertexVCVQf; -typedef VertexVCVQ VertexVCVQd; -} - -#endif diff --git a/vcg/simplex/vertex/with/vm.h b/vcg/simplex/vertex/with/vm.h deleted file mode 100644 index 3187e2d9..00000000 --- a/vcg/simplex/vertex/with/vm.h +++ /dev/null @@ -1,27 +0,0 @@ -#ifndef __VCGLIB_VERTEX__VM__TYPE -#define __VCGLIB_VERTEX__VM__TYPE - - -#define VERTEX_TYPE VertexVM - -#define __VCGLIB_VERTEX_VM - -#include - - -#undef VERTEX_TYPE -#undef __VCGLIB_VERTEX_VM - - - -namespace vcg { - -template < class VETYPE, class VFTYPE, class VTTYPE> -class VertexVMf : public VertexVM {}; - -template < class VETYPE, class VFTYPE, class VTTYPE> -class VertexVMd : public VertexVM {}; - -} - -#endif \ No newline at end of file diff --git a/vcg/simplex/vertex/with/vmvn.h b/vcg/simplex/vertex/with/vmvn.h deleted file mode 100644 index e8db7dd3..00000000 --- a/vcg/simplex/vertex/with/vmvn.h +++ /dev/null @@ -1,28 +0,0 @@ -#ifndef __VCGLIB_VERTEX__VMVN__TYPE -#define __VCGLIB_VERTEX__VMVN__TYPE - - -#define VERTEX_TYPE VertexVMVN - -#define __VCGLIB_VERTEX_VN -#define __VCGLIB_VERTEX_VM - -#include - - -#undef VERTEX_TYPE -#undef __VCGLIB_VERTEX_VM -#undef __VCGLIB_VERTEX_VN - - -namespace vcg { - -template < class VETYPE, class VFTYPE, class VTTYPE> -class VertexVMVNf : public VertexVMVN {}; - -template < class VETYPE, class VFTYPE, class VTTYPE> -class VertexVMVNd : public VertexVMVN {}; - -} - -#endif diff --git a/vcg/simplex/vertex/with/vmvnvt.h b/vcg/simplex/vertex/with/vmvnvt.h deleted file mode 100644 index 97e4a977..00000000 --- a/vcg/simplex/vertex/with/vmvnvt.h +++ /dev/null @@ -1,30 +0,0 @@ -#ifndef __VCGLIB_VERTEX__VMVNVT__TYPE -#define __VCGLIB_VERTEX__VMVNVT__TYPE - - -#define VERTEX_TYPE VertexVMVNVT - -#define __VCGLIB_VERTEX_VM -#define __VCGLIB_VERTEX_VN -#define __VCGLIB_VERTEX_VT - -#include - -#undef __VCGLIB_VERTEX_VM -#undef __VCGLIB_VERTEX_VN -#undef __VCGLIB_VERTEX_VT - -#undef VERTEX_TYPE - -namespace vcg { - -template < class VETYPE, class VFTYPE, class VTTYPE> -class VertexVMVNVTf : public VertexVMVNVT {}; - -template < class VETYPE, class VFTYPE, class VTTYPE> -class VertexVMVNVTd : public VertexVMVNVT {}; - -} - - -#endif /* __VCGLIB_VERTEX__VMVNVT__TYPE */ diff --git a/vcg/simplex/vertex/with/vn.h b/vcg/simplex/vertex/with/vn.h deleted file mode 100644 index b73801c9..00000000 --- a/vcg/simplex/vertex/with/vn.h +++ /dev/null @@ -1,25 +0,0 @@ -#ifndef __VCGLIB_VERTEX__VN__TYPE -#define __VCGLIB_VERTEX__VN__TYPE - - -#define VERTEX_TYPE VertexVN - -#define __VCGLIB_VERTEX_VN - -#include - - -#undef VERTEX_TYPE -#undef __VCGLIB_VERTEX_VN - - -namespace vcg { -template < class VETYPE, class VFTYPE, class VTTYPE> -class VertexVNf : public VertexVN {}; - -template < class VETYPE, class VFTYPE, class VTTYPE> -class VertexVNd : public VertexVN {}; - -} - -#endif diff --git a/vcg/simplex/vertex/with/vnvq.h b/vcg/simplex/vertex/with/vnvq.h deleted file mode 100644 index 8619d5bb..00000000 --- a/vcg/simplex/vertex/with/vnvq.h +++ /dev/null @@ -1,23 +0,0 @@ -#ifndef __VCGLIB_VERTEX__VNVQ__TYPE -#define __VCGLIB_VERTEX__VNVQ__TYPE - - -#define VERTEX_TYPE VertexVNVQ - -#define __VCGLIB_VERTEX_VN -#define __VCGLIB_VERTEX_VQ - -#include - - -#undef VERTEX_TYPE -#undef __VCGLIB_VERTEX_VN -#undef __VCGLIB_VERTEX_VQ - - -namespace vcg { -typedef VertexVNVQ VertexVNVQf; -typedef VertexVNVQ VertexVNVQd; -} - -#endif diff --git a/vcg/simplex/vertex/with/vnvt.h b/vcg/simplex/vertex/with/vnvt.h deleted file mode 100644 index 28d22c52..00000000 --- a/vcg/simplex/vertex/with/vnvt.h +++ /dev/null @@ -1,27 +0,0 @@ -#ifndef __VCGLIB_VERTEX__VNVT__TYPE -#define __VCGLIB_VERTEX__VNVT__TYPE - - -#define VERTEX_TYPE VertexVNVT - -#define __VCGLIB_VERTEX_VN -#define __VCGLIB_VERTEX_VT - -#include - - -#undef VERTEX_TYPE -#undef __VCGLIB_VERTEX_VN -#undef __VCGLIB_VERTEX_VT - - -namespace vcg { -template < class VETYPE, class VFTYPE, class VTTYPE> -class VertexVNVTf : public VertexVNVT {}; - -template < class VETYPE, class VFTYPE, class VTTYPE> -class VertexVNVTd : public VertexVNVT {}; - -} - -#endif diff --git a/vcg/simplex/vertex/with/vq.h b/vcg/simplex/vertex/with/vq.h deleted file mode 100644 index fd4ef51e..00000000 --- a/vcg/simplex/vertex/with/vq.h +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef __VCGLIB_VERTEX__VQ__TYPE -#define __VCGLIB_VERTEX__VQ__TYPE - - -#define VERTEX_TYPE VertexVQ - -#define __VCGLIB_VERTEX_VQ - -#include - - -#undef VERTEX_TYPE - -#undef __VCGLIB_VERTEX_VQ - -namespace vcg { -typedef VertexVQ VertexVQf; -typedef VertexVQ VertexVQd; -} - -#endif