From d784bebe07b4147387e8468e1e1cf36e5046098f Mon Sep 17 00:00:00 2001 From: cignoni Date: Thu, 25 Oct 2012 21:29:10 +0000 Subject: [PATCH] Added guards to avoid useless (and sometime dangerous) inclusion of internal file of the vcglib --- vcg/simplex/edge/base.h | 8 +++----- vcg/simplex/edge/component.h | 5 +++-- vcg/simplex/face/base.h | 5 +++-- vcg/simplex/face/component.h | 4 +++- vcg/simplex/face/component_occ.h | 6 ++++-- vcg/simplex/face/component_ocf.h | 9 -------- vcg/simplex/vertex/base.h | 33 +++--------------------------- vcg/simplex/vertex/component.h | 3 +++ vcg/simplex/vertex/component_occ.h | 7 +++---- vcg/simplex/vertex/component_ocf.h | 9 ++++---- 10 files changed, 29 insertions(+), 60 deletions(-) diff --git a/vcg/simplex/edge/base.h b/vcg/simplex/edge/base.h index bfd0e935..06aa1bf0 100644 --- a/vcg/simplex/edge/base.h +++ b/vcg/simplex/edge/base.h @@ -20,14 +20,12 @@ * for more details. * * * ****************************************************************************/ -#include - +#ifndef __VCG_MESH +#error "This file should not be included alone. It is automatically included by complex.h" +#endif #ifndef __VCG_EDGE_PLUS #define __VCG_EDGE_PLUS - - namespace vcg { - /*------------------------------------------------------------------*/ /* The base class of all the recusive definition chain. It is just a container of the typenames of the various simplexes. diff --git a/vcg/simplex/edge/component.h b/vcg/simplex/edge/component.h index c1631d6d..90637f69 100644 --- a/vcg/simplex/edge/component.h +++ b/vcg/simplex/edge/component.h @@ -20,8 +20,9 @@ * for more details. * * * ****************************************************************************/ -#include - +#ifndef __VCG_MESH +#error "This file should not be included alone. It is automatically included by complex.h" +#endif #ifndef __VCG_EDGE_PLUS_COMPONENT #define __VCG_EDGE_PLUS_COMPONENT diff --git a/vcg/simplex/face/base.h b/vcg/simplex/face/base.h index dc3df179..05565f78 100644 --- a/vcg/simplex/face/base.h +++ b/vcg/simplex/face/base.h @@ -20,8 +20,9 @@ * for more details. * * * ****************************************************************************/ -#include - +#ifndef __VCG_MESH +#error "This file should not be included alone. It is automatically included by complex.h" +#endif #ifndef __VCG_FACE_PLUS #define __VCG_FACE_PLUS diff --git a/vcg/simplex/face/component.h b/vcg/simplex/face/component.h index 7cb7d458..793fe9ff 100644 --- a/vcg/simplex/face/component.h +++ b/vcg/simplex/face/component.h @@ -20,7 +20,9 @@ * for more details. * * * ****************************************************************************/ -#include +#ifndef __VCG_MESH +#error "This file should not be included alone. It is automatically included by complex.h" +#endif #ifndef __VCG_FACE_PLUS_COMPONENT #define __VCG_FACE_PLUS_COMPONENT diff --git a/vcg/simplex/face/component_occ.h b/vcg/simplex/face/component_occ.h index f4e3a790..56a177cc 100644 --- a/vcg/simplex/face/component_occ.h +++ b/vcg/simplex/face/component_occ.h @@ -22,11 +22,13 @@ ****************************************************************************/ /* -Note OCC = Optional Component Compact compare with OCF(Optional Component Fast) +*/ -****************************************************************************/ +#ifndef __VCG_MESH +#error "This file should not be included alone. It is automatically included by complex.h" +#endif #ifndef __VCG_FACE_PLUS_COMPONENT_OCC #define __VCG_FACE_PLUS_COMPONENT_OCC diff --git a/vcg/simplex/face/component_ocf.h b/vcg/simplex/face/component_ocf.h index af941e62..2d29e8d9 100644 --- a/vcg/simplex/face/component_ocf.h +++ b/vcg/simplex/face/component_ocf.h @@ -19,15 +19,6 @@ * GNU General Public License (http://www.gnu.org/licenses/gpl.txt) * * for more details. * * * -****************************************************************************/ - -/* -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_FACE_PLUS_COMPONENT_OCF #define __VCG_FACE_PLUS_COMPONENT_OCF diff --git a/vcg/simplex/vertex/base.h b/vcg/simplex/vertex/base.h index 80cba3a7..3c87209c 100644 --- a/vcg/simplex/vertex/base.h +++ b/vcg/simplex/vertex/base.h @@ -20,34 +20,14 @@ * for more details. * * * ****************************************************************************/ -#include +#ifndef __VCG_MESH +#error "This file should not be included alone. It is automatically included by complex.h" +#endif #ifndef __VCG_VERTEX_PLUS #define __VCG_VERTEX_PLUS namespace vcg { -/*------------------------------------------------------------------*/ -/* -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 ImportData(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) @@ -59,13 +39,6 @@ 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::EmptyCore< UserUsedTypes >{ -//}; - - /* The Real Big Vertex class; The class __VertexArityMax__ is the one that is the Last to be derived, diff --git a/vcg/simplex/vertex/component.h b/vcg/simplex/vertex/component.h index f2364c68..1f2935bd 100644 --- a/vcg/simplex/vertex/component.h +++ b/vcg/simplex/vertex/component.h @@ -20,6 +20,9 @@ * for more details. * * * ****************************************************************************/ +#ifndef __VCG_MESH +#error "This file should not be included alone. It is automatically included by complex.h" +#endif #ifndef __VCG_VERTEX_PLUS_COMPONENT #define __VCG_VERTEX_PLUS_COMPONENT namespace vcg { diff --git a/vcg/simplex/vertex/component_occ.h b/vcg/simplex/vertex/component_occ.h index 066d55e8..45594227 100644 --- a/vcg/simplex/vertex/component_occ.h +++ b/vcg/simplex/vertex/component_occ.h @@ -33,13 +33,12 @@ Working release (compilata solo su MSVC), component_occ � migrato da component ****************************************************************************/ +#ifndef __VCG_MESH +#error "This file should not be included alone. It is automatically included by complex.h" +#endif #ifndef __VCG_VERTEX_PLUS_COMPONENT_OCC #define __VCG_VERTEX_PLUS_COMPONENT_OCC -#include -#include - - namespace vcg { namespace vertex { /* diff --git a/vcg/simplex/vertex/component_ocf.h b/vcg/simplex/vertex/component_ocf.h index bbd05f1d..41d9f08a 100644 --- a/vcg/simplex/vertex/component_ocf.h +++ b/vcg/simplex/vertex/component_ocf.h @@ -22,13 +22,12 @@ ****************************************************************************/ /* -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_MESH +#error "This file should not be included alone. It is automatically included by complex.h" +#endif #ifndef __VCG_VERTEX_PLUS_COMPONENT_OCF #define __VCG_VERTEX_PLUS_COMPONENT_OCF #ifndef __VCG_MESH