Commit Graph

544 Commits

Author SHA1 Message Date
Paolo Cignoni 8451875482 slight change in the PointDistance. Now it checks with an assert in the ifthenelse chain that it chooses the best projection direction and removed a warning. 2010-07-14 08:09:28 +00:00
ganovelli eb3f1a97fc added HasPerVertexVFAdjacency and HasPerFaceVFAdjacency. Removed
generic HasVFAdjacency which made the logical AND of the two and updated the 
relative calls.
2010-06-24 12:35:37 +00:00
Paolo Cignoni 799914a0d8 commented unused argument of base ImportData to remove gcc warning 2010-06-18 14:32:50 +00:00
ganovelli 585f0462e8 ImportLocal to ImportData. Adjacencies are no more handle by ImportData, but
by speficic functions in append.h (ImportPerxxxAdj(..))
2010-06-16 16:24:26 +00:00
ganovelli de851eb29e inclusion of alltypes.h 2010-05-19 17:16:58 +00:00
Paolo Cignoni 4a4039f138 fixed wrong pointer type in EHAdj class 2010-04-26 15:02:04 +00:00
Paolo Cignoni 7bd30d3ca0 fixed wrong pointer type in FHAdj class 2010-04-26 14:54:44 +00:00
Paolo Cignoni 8a47aaf62f removed a double init of a member of vector ocf and reordered members 2010-04-20 00:57:25 +00:00
Paolo Cignoni 3ee9667060 added two helper functions used for the self intersection tests 2010-04-20 00:56:08 +00:00
matteodelle 8b293069af Corrected an error in the template def. of TriMesh 2010-03-29 08:07:22 +00:00
ganovelli 261ff53ab1 [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
2010-03-25 16:52:18 +00:00
ganovelli 2f8a8945cc added inclusion of used_types.h 2010-03-19 17:21:25 +00:00
ganovelli a2341076c1 added typedef of ScalarType 2010-03-19 17:20:52 +00:00
ganovelli 21dd8aa179 Simplified reflection typedefs:
added type traits to support the mod below:

[ 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:19:51 +00:00
ganovelli 9fc476b130 added type traits to support the mod below:
[ 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:18:00 +00:00
Paolo Cignoni cf872a327c Doh! Forgot a const in the getbbox of Face Base 2010-03-18 10:28:10 +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
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 2a18ebd5f5 Heavily restructured component of vertex simplex. Compacted all the emptyXXXX into a single EmptyCore class. Cleaned up the interface for the optional stuff now there is a standard static function that can say if a given component is enabled or not. 2010-03-04 13:34:38 +00:00
Paolo Cignoni 5e1f0ce521 Heavily restructured component of vertex simplex. Compacted all the emptyXXXX into a single EmptyCore class. Cleaned up the interface for the optional stuff now there is a standard static function that can say if a given component is enabled or not. 2010-03-03 16:01:39 +00:00
Paolo Cignoni 5ef6d30d37 Added a test to check in the point to face distance computation to manage the case of degenerated faces. Now correctly resort to distance point to segment. 2010-03-03 00:35:20 +00:00
Paolo Cignoni fc6483307b added a missing cVFi() 2010-02-23 16:45:45 +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
Nico Pietroni 98eba3ef33 corrected minor compiling issues 2010-02-22 01:03:23 +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
Paolo Cignoni 3b152298cc added runtime assert to prevent dangerous simplex to simplex assignment in the case of OCF optional attributes. 2010-02-11 00:14:35 +00:00
Paolo Cignoni a26b0e34f9 Cleaned up Detach functions and added a special, simpler version of Detatch for 2Manifold cases 2010-01-03 02:01:45 +00:00
Paolo Cignoni 7030dbb151 small change. The FFp<i> shortcuts seems no more used... 2009-12-07 08:31:01 +00:00
Paolo Cignoni 3e7b2267f0 added a missing const to the distance functor 2009-12-02 15:11:00 +00:00
Marco Di Benedetto 939da657a9 added public: to TexCoord* Name(). 2009-12-01 17:36:27 +00:00
Marco Di Benedetto 5b076c064e added public: to WedgeColor* and Color Name(). 2009-12-01 17:35:42 +00:00
Paolo Cignoni 302a7725fa removed harmless warnings 2009-11-17 23:34:46 +00:00
Paolo Cignoni 70ae4d5c50 made public the self inspection member 'name' of the components. I do not know why it was not public in that case. 2009-11-05 22:35:56 +00:00
Paolo Cignoni 5ef3e2ca50 added a missing const cQ() for ocf face component 2009-11-01 09:51:53 +00:00
Paolo Cignoni 6051c1eeaa added a missing IsVFAdjacencyEnabled and a missing typename 2009-10-29 17:16:41 +00:00
Nico Pietroni 74bd57f2fa missing CurvatureType and CurvatureDirType inside EmptyCurvatureData 2009-10-14 17:19:56 +00:00
mtarini 1664791bf3 minor: local variable rename to avoid weird compilation problems. 2009-10-14 14:30:28 +00:00
Nico Pietroni c57e10951c corrected funtion Normal::ImportLocal 2009-10-14 14:25:59 +00:00
Nico Pietroni ea6553f1d5 corrected funtion NormalAbs::ImportLocal 2009-10-14 14:25:00 +00:00
ganovelli 5c0f228a4d added few missing Has*Ocf 2009-10-08 15:46:31 +00:00
Nico Pietroni 98e834c540 corrected 1 bug in PointDistance function 2009-09-18 09:16:17 +00:00
Marco Di Benedetto 6fb6cfbb24 added const to method. 2009-09-03 14:48:22 +00:00
Marco Di Benedetto ae09d558f0 added const to method. 2009-09-03 14:48:08 +00:00
Paolo Cignoni 415228fcd4 Added some missing importLocal functions 2009-08-30 13:54:06 +00:00
Marco Di Benedetto be1d887db6 Renamed LeftT to RightT, added some checks and fixed method name. 2009-08-28 15:26:40 +00:00
granzuglia 14eb3697ec changes in order to compile with gcc 3.x 2009-07-15 16:25:25 +00:00
Marco Di Benedetto 85ccd7dc0b removed unused parameter warning. 2009-06-30 19:00:47 +00:00
Marco Di Benedetto 015d94f736 fixed typo in normal and color (was ImporLocal()). 2009-06-29 05:46:43 +00:00
Marco Di Benedetto 460e6bd73a fixed initialization and resizing bugs on texcoords. 2009-06-29 03:33:56 +00:00
Marco Di Benedetto e5d07a7d62 added specializations for HasPerVertexNormal() and HasPerVertexColor(). 2009-06-28 22:41:05 +00:00