vcglib/apps/sample
ganovelli cdfed059d3 [ 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 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.
2010-03-15 10:42:03 +00:00
..
aabb_binary_tree [SIMPLEXplus promotion] 2008-12-19 10:43:36 +00:00
colorspace *** empty log message *** 2006-08-29 12:58:40 +00:00
edgemesh_grid [ Changes in definition of TriMesh: PART I ] 2010-03-15 10:42:03 +00:00
img_filters added basic filter sample for image module 2009-08-25 16:53:04 +00:00
polygonmesh_base added base example using polygon meshes and halfedges 2008-12-19 15:36:54 +00:00
space_minimal Initial Relase 2005-09-21 10:29:33 +00:00
trackball_SDL [SIMPLEXplus promotion] 2008-12-19 10:43:36 +00:00
trimesh_QT (involuntary commit reverted) 2010-03-12 14:58:02 +00:00
trimesh_SDL [SIMPLEXplus promotion] 2008-12-19 10:43:36 +00:00
trimesh_attribute removed the (useless) template parameter to Per[XXX]DeleteAttribute 2009-03-20 10:24:13 +00:00
trimesh_ball_pivoting [SIMPLEXplus promotion] 2008-12-19 10:43:36 +00:00
trimesh_base cleaned up a bit 2009-10-27 21:43:01 +00:00
trimesh_clustering [SIMPLEXplus promotion] 2008-12-19 10:43:36 +00:00
trimesh_hole [SIMPLEXplus promotion] 2008-12-19 10:43:36 +00:00
trimesh_intersection Removed a few harmless warnings 2009-03-30 20:58:18 +00:00
trimesh_isosurface moved (and renamed) trivial walker from apps/ to vcg/complex/trimesh/create 2009-05-18 14:19:12 +00:00
trimesh_join [SIMPLEXplus promotion] 2008-12-19 10:43:36 +00:00
trimesh_optional [SIMPLEXplus promotion] 2008-12-19 10:43:36 +00:00
trimesh_pos_demo [SIMPLEXplus promotion] 2008-12-19 10:43:36 +00:00
trimesh_refine Removed a few harmless warnings 2009-03-30 20:58:18 +00:00
trimesh_smooth [SIMPLEXplus promotion] 2008-12-19 10:43:36 +00:00
trimesh_split_vertex 2009-10-26 12:19:48 +00:00
trimesh_topology [SIMPLEXplus promotion] 2008-12-19 10:43:36 +00:00
sample.pro added base example using polygon meshes and halfedges 2008-12-19 15:37:32 +00:00
sample.sln *** empty log message *** 2006-01-11 16:11:16 +00:00