[introduction of half edges as alternative representation]
No modification should be necessary for the existing code.
most relevant changes:
creation of folder:
vcg/connectors
vcg/connectors/hedge.h
vcg/connectors/hedge_component.h
addition to the container of half edges to the trimesh:
HEdgeContainer hedge; // container
int hn; // number of half edges
addition of
vcg/trimesh/update/halfedge_indexed.h
which contains:
- the functions to compute the half edge representation from the indexed and vivecersa
- the functions to add or remove an half edge
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.
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
* update the gl/math wrappers to make them more Eigen friendly
(and remove the useless, and not used, and somehow dangerous
*Direct and *E functions)
* add automatic reinterpret_casting from Eigen::Matrix to vcg
specialized types
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
trimesh->tri
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 (4 letters namespaces):
order 0 (vertex) :vert
order 1 (edge) :edge
order 2 (triangle) :triangle
order 3 (tetrahedron) :tetrahedron
[Namespaces changes]
edge->edg
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 (4 letters namespaces):
order 0 (vertex) :vert
order 1 (edge) :edge
order 2 (triangle) :triangle
order 3 (tetrahedron) :tetrahedron
[Namespaces changes]
edge->edg
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 (4 letters namespaces):
order 0 (vertex) :vert
order 1 (edge) :edge
order 2 (triangle) :triangle
order 3 (tetrahedron) :tetrahedron
trimsh->tri
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 (4 letters namespaces):
order 0 (vertex) :vert
order 1 (edge) :edge
order 2 (triangle) :triangle
order 3 (tetrahedron) :tetrahedron