Commit Graph

15 Commits

Author SHA1 Message Date
Paolo Cignoni 696f763c3d fix the is "inaccessible" issue with g++-4.0.1 2008-10-29 11:28:51 +00:00
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
Paolo Cignoni c1551eddfd make Point derive Eigen's Matrix and some cleanning 2008-10-28 11:47:37 +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 5dd620e4e4 Added enum Dimension; 2007-05-07 07:47:59 +00:00
Marco Di Benedetto 0c31822d3c Implemented Scale() method (was only declared). 2006-10-07 16:51:43 +00:00
Marco Di Benedetto fc85374c3c Fixed product by scalar and SquaredNorm() 2006-01-19 13:53:19 +00:00
Marco Di Benedetto 2a0cf74739 Corrected return type in Angle() and protected member access in unary operator - 2005-10-15 19:11:49 +00:00
Paolo Cignoni eda550ba49 minor changes to comply gcc compiler 2005-03-18 16:35:53 +00:00
Paolo Cignoni 6a75af2188 small syntax error Math -> math in Angle 2004-05-10 13:22:25 +00:00
Paolo Cignoni c5502d119f Add V() access function 2004-04-05 11:57:32 +00:00
mtarini b84e4c7460 Added comments (Dox) !
Added Import(). Costruct(), ScalarType...  Corrected cross prod (sign). Added Angle. Now using Math:: stuff for trigon. etc.
2004-03-10 17:42:40 +00:00
Paolo Cignoni cd85d6ca7d renamed protected member v -> _v 2004-03-03 15:07:40 +00:00
Paolo Cignoni b2481bc732 First commit... 2004-02-13 00:44:53 +00:00