vcglib/vcg/complex/trimesh
ganovelli c40a6c3d97 [ 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:52 +00:00
..
create completed the correct working of temporary data inside the refinement functions 2009-06-25 06:19:00 +00:00
update removed harmless gcc warnings 2010-03-02 23:17:15 +00:00
allocate.h removed harmless warnings 2010-02-24 09:56:58 +00:00
append.h added in the Append::Mesh function the possibility of copying also unreferenced vertices (indispensable for point sets!) 2009-04-04 16:58:21 +00:00
attribute_seam.h fixed in-place version. 2009-10-26 12:19:21 +00:00
autoalign_4pcs.h [SIMPLEXplus promotion] 2008-12-19 10:39:32 +00:00
base.h [ Changes in definition of TriMesh: PART I ] 2010-03-15 10:42:52 +00:00
bitquad_creation.h removed harmless gcc warnings 2010-03-02 23:17:15 +00:00
bitquad_optimization.h minor changes 2009-10-14 16:15:50 +00:00
bitquad_support.h add missing std:: 2009-10-15 11:53:09 +00:00
clean.h removed harmless gcc warnings 2010-03-02 23:17:15 +00:00
clip.h First Commit. 2006-05-02 14:17:36 +00:00
closest.h added some const and inline keywords 2009-11-30 10:32:37 +00:00
clustering.h removed harmless gcc warnings 2010-03-02 23:17:15 +00:00
crease_cut.h Removed harmless warnings 2009-06-11 23:55:06 +00:00
edge_collapse.h Added Allocator::DeleteFace and Allocator::DeleteVertex; Now the use of SetD() should be deprecated. 2007-10-16 16:46:53 +00:00
edge_support.h compiled with gcc 2009-04-01 13:07:08 +00:00
geodesic.h Changed a few geodesic function from void to bool to return possible failures (like for exmple asking for border distance on a mesh without border) 2009-05-26 22:31:58 +00:00
hole.h corrected the template in the normal<> function... again 2009-12-07 08:17:10 +00:00
inertia.h added cr at the end 2009-07-29 12:48:30 +00:00
inside.h [Namespaces changes] 2008-09-30 10:52:37 +00:00
overlap_estimation.h changed doxigen comments. 2009-08-04 21:10:08 +00:00
point_sampling.h Modified rasterization algorithm to generate samples from buffer areas outside (texture space) border edges 2010-02-09 19:10:22 +00:00
polygon_support.h Added ExtractPolygon quad support function 2009-06-26 13:05:52 +00:00
refine.h completed the correct working of temporary data inside the refinement functions 2009-06-25 06:19:00 +00:00
refine_loop.h removed harmless gcc warnings 2010-01-03 01:57:39 +00:00
smooth.h Corrected a survived old style use of temporary data in smoothning of vertex normals 2009-12-01 08:37:27 +00:00
stat.h Added ComputePerVertexQualityDistribution 2009-09-22 16:42:59 +00:00
subset.h use const_iterator for input face container. 2009-03-17 16:39:23 +00:00
textcoord_optimization.h big replacement .Zero => .SetZero, and start of Eigen's compatibilities (currently disabled by default) 2008-10-27 14:48:14 +00:00