Commit Graph

3025 Commits

Author SHA1 Message Date
Paolo Cignoni 07f2e976ea * change all remaining Transpose to transpose,
* update the gl/math wrappers to make them more Eigen friendly
  (and remove the useless, and not used, and somehow dangerous
   *Direct and *E functions)
* add automatic reinterpret_casting from Eigen::Matrix to vcg
  specialized types
2008-10-29 00:05:44 +00:00
Paolo Cignoni 0361427bc0 big cleaning in Point* and Matrix*, now they are very closed to be simple typedef of
Eigen's Matrix. Now the dilema is how to mimic those typedefs, using inheritence ?
or using the classic workaround: typename Point3<float>::Type; with Point3<T>::Type defined
to Eigen::Matrix<T,3,1>. Anyway currently I support both (and the inheritence scheme has
to be preserved for compatibility). The advantage of the second approach is that when
eigen has to evaluate an expression it uses an Eigen::Matrix<>, so it is probably better
to only use Eigen::Matrix but I'm not 100% sure that makes a big difference especially if
we add some automatic reinterpret_cast between Eigen::Matrix and vcg::Point*....
2008-10-28 20:06:17 +00:00
Federico Ponchio 632f4842f1 Polar mode now working. 2008-10-28 16:43:56 +00:00
Paolo Cignoni c0c76bc5b8 added Polarmode prototype (doesn't work yet) 2008-10-28 15:55:40 +00:00
Paolo Cignoni 6e0b8fe1aa added import vector 2008-10-28 15:00:16 +00:00
Paolo Cignoni c1551eddfd make Point derive Eigen's Matrix and some cleanning 2008-10-28 11:47:37 +00:00
ganovelli 949637c795 added private copy constructor and assignment operator to prevent people from doing those things
added empty constructors to attribute handles
2008-10-28 11:00:30 +00:00
Paolo Cignoni 977ddb9623 some cleaning 2008-10-28 10:16:43 +00:00
ganovelli 2dc124d060 created. Example of use of user defined attributes 2008-10-28 09:18:52 +00:00
Paolo Cignoni 7befff7bec make point2 derived Eigen's Matrix, and a set of minimal fixes to make meshlab compile
with both old and new version. The fixes include:
- dot product: vec0 * vec1 => vec0.dot(vec1) (I added .dot() to the old Point classes too)
- Transpose: Transpose is an Eigen type, so we cannot keep it if Eigen is used. Therefore
  I added a .tranpose() to old matrix classes, and modified most of the Transpose() to transpose()
  both in vcg and meshlab. In fact, transpose() are free with Eigen, it simply returns a transpose
  expression without copies. On the other be carefull:  m = m.transpose() won't work as expected,
  here me must evaluate to a temporary: m = m.transpose().eval(); However, this operation in very
  rarely needed: you transpose at the same sime you set m, or you use m.transpose() directly.
- the last issue is Normalize which both modifies *this and return a ref to it. This behavior
  don't make sense anymore when using expression template, e.g., in (a+b).Normalize(), the type
  of a+b if not a Point (or whatever Vector types), it an expression of the addition of 2 points,
  so we cannot modify the value of *this, since there is no value. Therefore I've already changed
  all those .Normalize() of expressions to the Eigen's version .normalized().
- Finally I've changed the Zero to SetZero in the old Point classes too.
2008-10-28 00:59:46 +00:00
Paolo Cignoni 393ec38d54 quick fix in color4 2008-10-27 19:38:52 +00:00
Paolo Cignoni ab200fc950 Port to eigen2: state of the mess:
* curently nothing change if you don't define VCG_USE_EIGEN
* make Matrix*, Point3 and Point4 derive Eigen::Matrix (still ugly)
* now catching all the dot products to replace them by .dot()
  note that most of meshlab already compile
2008-10-27 19:35:17 +00:00
ganovelli 69ebba04b9 Created.
PolygonSupport provides the functions to import a trimesh from a polygonal mesh and viceversa.
2008-10-27 16:54:32 +00:00
ganovelli 4002b9a706 created as a first working draft.
Tessellates a simple polygon with the earcut algorithm
assuming the polygon is  almost planar
2008-10-27 16:50:45 +00:00
Massimiliano Corsini e98422ee49 fix tokenizeNextLine 2008-10-27 15:19:28 +00:00
Paolo Cignoni 4db69febbe big replacement .Zero => .SetZero, and start of Eigen's compatibilities (currently disabled by default) 2008-10-27 14:48:14 +00:00
ganovelli c0a5159672 changed member Zero() to SetZero() 2008-10-27 12:52:22 +00:00
Paolo Cignoni 3c65d927ac add svn:externals to Eigen's repo... the svn doc is not very clear, hope this time is the good one 2008-10-27 10:06:30 +00:00
Paolo Cignoni 01625bcbdf add svn:externals to Eigen's repo... hm wrong target 2008-10-27 10:02:22 +00:00
Paolo Cignoni a33d58812b add svn:externals to Eigen's repo 2008-10-27 09:59:14 +00:00
Federico Ponchio 5394003338 Fixed small error in documentation 2008-10-24 18:49:40 +00:00
Paolo Cignoni 8a8eb6fb65 add the possiblity to sort eigenvalues/vectors according to their absolute values 2008-10-24 17:21:53 +00:00
Federico Ponchio fe59b6ad4d Extrinsics.tra is now private, using Tra() 2008-10-24 16:37:24 +00:00
Paolo Cignoni 57fe4376a2 fix a few warnings 2008-10-24 12:45:02 +00:00
Paolo Cignoni 64fcbc961a compilation fix for 64bits systems 2008-10-24 12:41:50 +00:00
Paolo Cignoni 24ea4251a9 Matrix33: make const the binary operators 2008-10-24 12:20:44 +00:00
ganovelli 4783ac9a62 added an assertion 2008-10-24 10:26:28 +00:00
ganovelli d5113f6204 added missing functions
IsCurvatureDirEnabled
EnableCurvatureDir

and debugged CurvatureDirTypeOcf, which
returned wrong values and [MAJOR] wasted
8 floats per vertex every time it was included in the type (enabled or not)
2008-10-24 09:54:23 +00:00
ganovelli 3a5b6ed2f3 added missing checks in ImportLocal 2008-10-24 09:50:55 +00:00
ganovelli cba885edbe missing (unreachable) return added 2008-10-24 09:49:47 +00:00
Paolo Cignoni 9947006682 Heavy refactoring of the SVG writing code. Now it is much much shorter and hopefully more clear. 2008-10-23 16:51:58 +00:00
Paolo Cignoni 3c79fae752 Improved robustness of parsing of malformed off 2008-10-16 14:32:37 +00:00
Paolo Cignoni 8f77d3cbaa removed non-portable inclusion of GL.h (on mac gl.h is in stupid places) 2008-10-15 10:11:39 +00:00
Paolo Cignoni a3dbc3168b fix a typo in Program::Uniform() 2008-10-15 09:28:15 +00:00
Paolo Cignoni 64ce68dac0 * make EmptyRadius::HasRadius returns false
* make gl/Shader and gl/Program* a bit easier to use:
 - automatic object creation
 - add Uniform() overloads for vcg::Point*f types
2008-10-15 08:02:14 +00:00
ganovelli 79ef95435a Compacted EmptyCurvature and EmptyCurvatureDir in EmptyCurvatureData and added EmptyRadius 2008-10-14 16:47:02 +00:00
ganovelli c454c38e60 added EmptyCurvatureData and EmptyRadius 2008-10-14 16:45:36 +00:00
ganovelli 8198cf4c8b added HasFaceQualityOcf() to EmptyColorMarkQuality 2008-10-14 16:42:29 +00:00
Paolo Cignoni fc98a34972 Add an optional per vertex radius property in occ, ocf, and IO mask.
Extend derivation_chain from 10 to 12
2008-10-14 14:58:09 +00:00
Paolo Cignoni c5ec73d0f7 Added IntersectionRayMesh overload function who return hit point, baricentric's coordinates and a pointer of intersected face. 2008-10-14 14:31:35 +00:00
Paolo Cignoni 9b0875d19e added a missing std:: 2008-10-14 14:28:33 +00:00
Paolo Cignoni 6f1e8d0641 Added UpdateColor::VertexFromFace and UpdateColor::FaceFromVertex 2008-10-14 13:41:37 +00:00
ganovelli dddce06a72 use of NextFE (of the jumping_pos) instead of NextE 2008-10-14 09:47:16 +00:00
ganovelli 699ca34f0c added missing HasFaceQualityOcf() in InfoOcf 2008-10-14 09:23:36 +00:00
Paolo Cignoni f15dcf5536 compacted the EmptyMark componenet into the EmptyColorMarkQuality component, to shorten the derivation. 2008-10-14 06:41:46 +00:00
Paolo Cignoni 94178d7128 Added optional per face quality 2008-10-14 06:40:29 +00:00
Paolo Cignoni a7a400b40e Changed an old FaceType::HasFaceQuality() into the tempory aware version HasPerFaceQuality(mesh) 2008-10-14 06:39:04 +00:00
Paolo Cignoni ae6f7fee0f Added FaceQualityGray() and changed (for sake of symmetry) FaceQuality() to FaceQualityRamp() 2008-10-14 06:37:36 +00:00
Paolo Cignoni de8504ba3e Added ComputePerFaceQualityMinMax() 2008-10-14 06:36:25 +00:00
ganovelli d7920e1cc4 Added principal curvatures direction computation with by means of normal cycles:
Restricted delaunay triangulations and normal cycle
Cohen-Steiner, David   and Morvan, Jean-Marie SCG '03
2008-10-13 14:55:05 +00:00