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 typenames to pass as first templates and the need to specify the maximal simplicial. So
<MyVertex, MyEdge, MyFace becomes <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>{};
Note 3: you only need to specify the type you use. If you do not have edges you do not need
to include vcg::Use<MyEdge>::AsEdgeType in the template list of UsedTypes.
==== the Part II will be a tiny change to the class TriMesh it self.
This modification removes the old way to define simplexes (already deprecated and unsupported).
In the following SIMPLEX = [vertex|edge|face|tetrahedron]
All the stuff that was in vcg/simplex/SIMPLEXplus/ has now been promoted to vcg/simplex/
Details:
- the folder vcg/simplex/SIMPLEX/with has been removed
- the file vcg/simplex/SIMPLEX/base.h has been renamed into vcg/simplex/SIMPLEX/base_old.h
- the content of vcg/simplex/SIMPLEXplus/ has been moved into vcg/simplex/SIMPLEX/
- the folder vcg/simplex/SIMPLEXplus/ has been removed
Actions the update the code using vcglib:
replace <vcg/simplex/SIMPLEXplus/*> with <vcg/simplex/SIMPLEX/*> in every include
for MESHLAB users: already done along with this commit
vert->vertex
clean up of some namespaces to comply the following naming:
Complexes (3 letters namespaces):
order 0 (point cloud ) :vrt
order 1 (edge meshes) :edg
order 2 (triangle meshes) :tri
order 3 (triangle meshes) :tet
Simplexes (extended namespaces):
order 0 (vertex) :vertex
order 1 (edge) :edge
order 2 (triangle) :triangle (temporarily it remains "face")
order 3 (tetrahedron) :tetrahedron