Commit Graph

813 Commits

Author SHA1 Message Date
Paolo Cignoni b6cb2fc881 added option to the Poisson sampling filter of using an additional mesh as source of already generated samples.
In this way it is possible to refine existing sampling by using different sample pools
2010-03-23 07:26:34 +00:00
Paolo Cignoni b4857331f6 added FaceFauxCrease and other small helper for managing faux edges 2010-03-23 07:23:32 +00:00
Paolo Cignoni d55a1069de converted to the new style with mark outside the trimesh class 2010-03-19 22:56:30 +00:00
ganovelli ca8d4abed3 All the functions handling TriMesh::imark have been moved outside the definition
of TriMesh to workaround an internal compiler error of vc compiler, and the usages have been
consequently updated
2010-03-19 17:14:01 +00:00
ganovelli 584936f27a [ Changes in definition of TriMesh: PART II ]
Note: No changes to existing code need be the done, this mod
should be fully backward compatible

Old way to define a TriMesh ==============
struct MyMesh: public vcg::tri::TriMesh< vector<MyVertex> , vector <MyFace> >{};

new  ways to define a TriMesh ==============

struct MyMesh: public vcg::tri::TriMesh< CONT1 >{};
struct MyMesh: public vcg::tri::TriMesh< CONT1 , CONT2>{};
struct MyMesh: public vcg::tri::TriMesh< CONT1 , CONT2, CONT3>{};

where CONT[i] can be vector< [MyVertex | MyEdge | MyFace ] > 
(the order is unimportant)
2010-03-19 17:13:31 +00:00
Paolo Cignoni 3b770c935a added updateQuality Vertex Clamp 2010-03-18 14:20:29 +00:00
Paolo Cignoni 3976724c18 removed harmless warnings and improved Cone generator 2010-03-18 10:07:39 +00:00
Paolo Cignoni 9aa23c4f6c removed harmless warnings 2010-03-18 10:03:31 +00:00
Paolo Cignoni 63e21f15cb 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:02:32 +00:00
Paolo Cignoni 2a1aebfa3d converted to the new UsedTypes syntax 2010-03-17 09:22:23 +00:00
Paolo Cignoni 80f825a428 removed harmless warnings 2010-03-16 14:25:30 +00:00
Paolo Cignoni 404831fc2f added a missing 'template' keyword between class and metod name. 2010-03-16 11:06:32 +00:00
ganovelli 09b0fb5ef7 added a way to define a scope, i.e. a collection of bounds between name of the attributes
and their type, so  that one can add an attribute without knowing its type. It is useful
when working with plugin.
example:
vcg::tri::NameTypeScope myScope;


AddNameTypeBound<int>(myScope,std::string("number");
AddNameTypeBound<float>(myScope,std::string("incoming_light"));

we have crated a scope myScope where "number" is bound a int and incoming_light is a float

In another part of code where I may not know the type of "number", I can still do:

AddPerVertexAttribute(myScope, mesh, "number");

and an int attibute name "number" will be added.
2010-03-15 15:17:20 +00:00
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
Paolo Cignoni d340b8b92a removed harmless gcc warnings 2010-03-02 23:17:15 +00:00
Paolo Cignoni 355edd042e removed harmless warnings 2010-02-24 09:56:58 +00:00
Paolo Cignoni 9f8497013f removed harmless warnings 2010-02-24 09:55:28 +00:00
Paolo Cignoni 18c92582d4 Cleaned up the CompactFaceVector and the CompactVertexVector, Now they correctly manage existing FV and FF topology by preserving them (if they are initialized to something meaningful). 2010-02-22 17:37:51 +00:00
Paolo Cignoni 446400f6fc Now the compactvertex and compactface funtions use the importlocal chain so we are sure that all the meaningful data is correctly copied (otherwise ocf stuff will not be copied) On the other hand when using ImportLocal we do not copy pointer based stuff like adjacency and *vertex pointers* that must be terefore copied by hand... 2010-02-19 00:21:26 +00:00
Luigi Malomo 8465fa432c Modified rasterization algorithm to generate samples from buffer areas outside (texture space) border edges 2010-02-09 19:10:22 +00:00
Paolo Cignoni 796c2f0b56 Implemented MakeTriEvenBySplit (still assume that the mesh is a single connected component), removed some face assigment with the (hopefully) safer ImportLocal. 2010-01-03 02:14:51 +00:00
Paolo Cignoni 29e956d524 Corrected a small bug in CountNonManifoldVertexFFVF and changed the use of bit from selection to visit bit in the CountEdges 2010-01-03 01:59:32 +00:00
Paolo Cignoni 49bbc55cac removed harmless gcc warnings 2010-01-03 01:57:39 +00:00
Paolo Cignoni 137c239375 removed harmless gcc warnings 2010-01-03 01:31:26 +00:00
Paolo Cignoni fbbf8fe436 Removed gcc4.4 warnings 2009-12-08 15:57:19 +00:00
Paolo Cignoni 39f12e9fdd added a function to permutate the vertex vector according to a given permutation. 2009-12-07 09:05:20 +00:00
Paolo Cignoni d60fa01037 cleaning up include files 2009-12-07 08:23:02 +00:00
Paolo Cignoni 8a0c86c857 corrected the template in the normal<> function... again 2009-12-07 08:17:10 +00:00
Paolo Cignoni 760a767504 cleaning up include files 2009-12-07 08:15:59 +00:00
Paolo Cignoni 1c0ae1268c added a slightly faster version of the longest edge stratified subdivision sampling 2009-12-04 08:36:49 +00:00
Paolo Cignoni 32619f1625 harmless gcc compiling issues 2009-12-03 23:17:46 +00:00
Paolo Cignoni c749b3e143 Heavily restructured PoissonDisk resampling. Now there are two approaches, a pure pruning and a cell pruning approach 2009-12-02 15:10:12 +00:00
Paolo Cignoni 7c907e72ae Corrected a survived old style use of temporary data in smoothning of vertex normals 2009-12-01 08:37:27 +00:00
Paolo Cignoni 86d534ec95 added a missing std:: 2009-12-01 08:34:16 +00:00
Paolo Cignoni dc82ece647 Optimized version of poisson sampling 2009-11-30 15:53:23 +00:00
Paolo Cignoni a89b2ace77 added some const and inline keywords 2009-11-30 10:32:37 +00:00
Paolo Cignoni a209a9b890 Refactoring of the Poisson Sampling algorithm. Hopefully faster 2009-11-25 15:50:36 +00:00
Paolo Cignoni 3482ee805e added a few missing std:: and cleaned up a bit the requirements 2009-11-05 10:19:42 +00:00
Paolo Cignoni ad4ad4026c added computation of the per-vertex directions and values of curvature using a quadric fitting method 2009-11-05 09:55:43 +00:00
Nico Pietroni fe6d3ca34d restored changes for a corrected use of default copy constructor 2009-10-27 10:48:52 +00:00
Marco Di Benedetto a80c4d25ef fixed in-place version. 2009-10-26 12:19:21 +00:00
Marco Di Benedetto e7cbe4f558 modified typedef due to GCC complaints. 2009-10-23 20:25:54 +00:00
Marco Di Benedetto d650013e60 first commit. 2009-10-23 10:04:51 +00:00
Paolo Cignoni 8dd2320a4d add missing std:: 2009-10-15 11:53:09 +00:00
Nico Pietroni fdd33df567 minor changes 2009-10-14 16:15:50 +00:00
Nico Pietroni 01f772d7f8 corrected order of operations of decrease-increase valencies 2009-10-14 15:15:32 +00:00
Nico Pietroni 8c67be5617 added interpolator class for refinement 2009-10-14 15:05:08 +00:00
mtarini 2f1c77c69a Added a flag to choose whether to use Length based criteria or Quality based ones. 2009-10-14 14:35:25 +00:00
mtarini 7c78d81cdc added importance weighting. 2009-10-14 14:32:55 +00:00
Nico Pietroni a60c31845c added function HasConsistentEdges 2009-10-14 13:56:06 +00:00