Commit Graph

137 Commits

Author SHA1 Message Date
Nico Pietroni c1e19b4b55 added assert(0) for cVFi function if does not exixts the component 2012-05-25 13:19:03 +00:00
Marco Di Benedetto 1c5f2c2264 added static capability query function for ocf vertex texcoord (VertexVectorHasPerVertexTexCoord()) (not having it caused false positives). 2012-04-10 16:47:15 +00:00
Marco Di Benedetto a82ac9639f added constant accessors without the infamous "c" prefix for color (C()) and texcoord (T()). 2012-04-10 15:46:20 +00:00
granzuglia 1548d6415a added missing functions in Empty:
- static bool HasCurvatureDir() { return false; }
- static bool IsCurvatureEnabled(const typename TT::VertexType *)  { return false; }
2012-04-06 08:10:32 +00:00
Paolo Cignoni b0d7d5c52e removed harmless gcc warnings 2012-04-04 10:05:35 +00:00
Paolo Cignoni 8a631d48c1 Corrected a significant bug in the reflection types for ocf components.
Changed the basic reflection mechanism: Instead of having a function templates over all the four containers now we template over Trimesh and we rely on a second function templated on face/vert that wants a vector<face> ; this second function only is eventually overloaded by another function that needs a vector_ocf of faces. 

That is Before we had:
- in complex.h

template < class  CType0, class CType1, class CType2 , class CType3>
bool HasPerFaceVFAdjacency   (const TriMesh < CType0, CType1, CType2, CType3> & /*m*/) {return TriMesh < CType0 , CType1, CType2, CType3>::FaceContainer::value_type::HasVFAdjacency();}

- in the component_ocf.h

template < class VertContainerType, class FaceType, class Container1, class Container2  >
		bool HasPerFaceVFAdjacency (const TriMesh < VertContainerType , face::vector_ocf< FaceType >, Container1, Container2 > & m)
	{
	  if(FaceType::HasVFAdjacencyOcf()) return m.face.IsVFAdjacencyEnabled();
	  else return FaceType::FaceType::HasVFAdjacency();
	}


While now we have:
- in complex.h

template < class FaceType  > bool   FaceVectorHasPerFaceVFAdjacency     (const std::vector<FaceType  > &) {  return FaceType::HasVFAdjacency(); }
template < class TriMeshType> bool   HasPerFaceVFAdjacency     (const TriMeshType &m) { return tri::FaceVectorHasPerFaceVFAdjacency  (m.vert); }

- and in component_ocf.h

template < class FaceType >
  bool FaceVectorHasPerFaceVFAdjacency(const face::vector_ocf<FaceType> &fv)
  {
    if(FaceType::HasVFAdjacencyOcf()) return fv.IsVFAdjacencyEnabled();
    else return FaceType::HasVFAdjacency();
  }
2012-03-31 01:16:58 +00:00
ganovelli 749f67c3b6 added curvature direction 2012-03-28 11:56:10 +00:00
Paolo Cignoni c8e202738c added initialization of VE adjacency components to something that allows to discriminate between the uninitializated adjacency and a vertex with no edges 2012-02-09 17:53:08 +00:00
ganovelli d256abfaaf added PointScaledDistanceFunctor 2011-12-21 16:15:32 +00:00
Paolo Cignoni dee3de3cc8 Added correct overloading of ImportData for per vertex curvature component. 2011-11-01 18:33:52 +00:00
Paolo Cignoni 2fe129645b Rolled back 2011-10-05 15:04:40 +00:00
ganovelli a815890b15 minimal addition to support neighboorhood relation between vertices
and between faces
2011-06-14 16:18:34 +00:00
Paolo Cignoni 5a21c7cd76 Removed the ReorderVert function used for permutating the accessory attributes of OCF components. IT should not be used. 2010-11-09 08:27:44 +00:00
ganovelli 3bd7cbe5ea added cQ() to QualityOcf 2010-11-06 16:38:15 +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 8a47aaf62f removed a double init of a member of vector ocf and reordered members 2010-04-20 00:57:25 +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 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 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 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
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 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
Paolo Cignoni 302a7725fa removed harmless warnings 2009-11-17 23:34:46 +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
Nico Pietroni c57e10951c corrected funtion Normal::ImportLocal 2009-10-14 14:25:59 +00:00
Paolo Cignoni 415228fcd4 Added some missing importLocal functions 2009-08-30 13:54:06 +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
Marco Di Benedetto 24327b218c added HasColorOcf(). 2009-06-28 22:39:57 +00:00
Marco Di Benedetto 4dae9d3d97 added cN() and fixed assert in color. 2009-06-28 03:18:49 +00:00
Marco Di Benedetto 29b9011026 added HasNormalOcf() and HasColorOcf(). 2009-06-28 03:14:48 +00:00
Paolo Cignoni ace6a183b3 added a missing HasPerVertexTexture() 2009-06-24 20:30:36 +00:00
Paolo Cignoni a88ee5b244 Added ocf management of per vertex texture coord 2009-06-23 20:45:44 +00:00
Federico Ponchio e888ef1560 removed some useless consts 2009-06-03 12:23:20 +00:00
Paolo Cignoni 8be6f002a3 Significant rewrote of the ImportLocal framework. Now it can really manage differently typed meshes.
It still requires that for OCF meshes the user enable stuff as needed.
2009-04-05 23:33:04 +00:00
Paolo Cignoni 2631ae5351 Added sph49f, disabled ImportLocal for a while 2009-03-25 07:51:28 +00:00
Paolo Cignoni b8fc43e7c6 Added non optional per vertex radius component 2009-03-18 15:53:52 +00:00
Paolo Cignoni eca304e5f5 mark of Vertex should not be named HasFaceMarkOcf!! 2008-12-21 01:39:46 +00:00
ganovelli c9b6f8f7c8 2008-12-19 10:31:56 +00:00
ganovelli ca3f973398 added unsupported to deprecated in the warning 2008-12-12 18:11:42 +00:00