Commit Graph

10 Commits

Author SHA1 Message Date
Paolo Cignoni bc218b8201 Include header cleaning and reordering. 2013-11-25 12:47:20 +00:00
Paolo Cignoni fb60087ee4 component_ocf are now part of the standard inclusion sequence of complex.h
No more need of including them.
It was needed to avoid the issue of wrong inclusion order that could trigger a failure in the partial specialization of the reflection functions that should say if a component is present or not...
2012-10-15 09:17:48 +00:00
Paolo Cignoni 2577210a54 **** SIGNIFICANT CHANGES *****
- Cleaned up include order: Now you only need to include <vcg/complex/complex.h> (no more vertex/base.h etc) 
- Added official VN() EN() FN() const members for knowing number of vertexes etc...
- Added exceptions (at last!)
    Now instead of:
       assert(HasPerVertexNormal(m)) 
    you should write:
      if(!HasPerFaceNormal(m)) throw vcg::MissingComponentException();
2012-10-04 11:10:25 +00:00
ganovelli 19755ed9b7 definition of USedTypes changed to ensure that MeshType::FaceType is the same as VertexType::FaceType (begin Vertex and Face any type among Vertex,Face,Edge,HEdge).
Compiles with gcc 4.4, .net 2005
2010-06-18 07:53:21 +00:00
ganovelli 6b807efa9c separated alltypes from usedtypes. The dummy types for simplex where char, now are derived by
their proper type (eg. the dummy type for Vertex is a simple derivation of vcg::Vertex)
2010-05-19 17:05:29 +00:00
ganovelli be64ec50c3 added inclusion of <string> 2010-03-25 16:51:20 +00:00
ganovelli f90bd789a3 added class AllTypes to implement type trait in trimesh/base.h
AllTypes is a class defining, as inner classes, global default names
for vertex,edge and face
2010-03-19 17:02:36 +00:00
Paolo Cignoni 335afeee7e Disambiguated the origin of the ScalarType and CoordType in the simplex class. Now it derives from the type specified by the vertexRef component for the faces and from the Coord component for the vertexes. To be sure the ScalarType and CoordTypes are initialized to weird point3<bool> and char just to detect easisly when the wrong types shallow... 2010-03-18 10:03:00 +00:00
Paolo Cignoni bf69d1c24a removed harmless warnings 2010-03-16 14:22:08 +00:00
ganovelli 2e739825c8 [ Changes in definition of TriMesh: PART I ]
Note for the developers: the change to make to existing projects is very little
but strictly necessary to compile. This change IS NOT backward compliant.


==== OLD ==== way to define a TriMesh:

// forward declarations
class MyVertex;
class MyEdge;
class MyFace;

class MyVertex: public VertexSimp2 < MyVertex, MyEdge, MyFace, vertex::Coord3f,...other components>{};
class MyFace: public FaceSimp2 < MyVertex, MyEdge, MyFace, face::VertexRef,...other components>{};
class MyMesh: public TriMesh<vector<MyVertex>,vector<MyFace> >{};


==== NEW ==== way to define a TriMesh:
// forward declarations
class MyVertex;
class MyEdge;
class MyFace;

// declaration of which types is used as VertexType, which type is used as FaceType and so on...
class MyUsedTypes: public vcg::UsedType < vcg::Use<MyVertex>::AsVertexType,
                                         vcg::Use<MyFace>::AsFaceType>{};

class MyVertex: public Vertex < MyUsedTypes, vertex::Coord3f,...other components>{};
class MyFace: public Face < MyUsedTypes, face::VertexRef,...other components>{};
class MyMesh: public TriMesh<vector<MyVertex>,vector<MyFace> >{};

                               ===== classes introduced         [vcg::UsedType] : it is a class containing all the types that must be passed to the definition of Vertex, Face, Edge... This
class replaces the list of classes to pass as first templates and the need to specify the maximal simplicial. So

< MyVertex, MyEdge, MyFace,  beocmes  MyUsedTypes,
and
VertexSimp2 becomes Vertex

[vcg::Use] : an auxiliary class to give a simple way to specify the role of a type

Note 2: the order of templates parameters to vcg::UsedTypes is unimportant, e.g:

class MyUsedTypes: public vcg::UsedType <vcg::Use<MyVertex>::AsVertexType,
                                        vcg::Use<MyEdge>::AsEdgeType,
                                        vcg::Use<MyFace>::AsFaceType>{};

is the same as:
class MyUsedTypes: public vcg::UsedType <vcg::Use<MyFace>::AsFaceType,
                                        vcg::Use<MyEdge>::AsEdgeType,
                                        vcg::Use<MyVertex>::AsVertexType>{};

==== the Part II will be a tiny change to the class TriMesh it self.
2010-03-15 13:10:43 +00:00