Commit Graph

266 Commits

Author SHA1 Message Date
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 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
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
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
Paolo Cignoni 24ea4251a9 Matrix33: make const the binary operators 2008-10-24 12:20:44 +00:00
Paolo Cignoni 39e2cf2b3e Spherical Harmonics are templatized on the number of coefficients 2008-10-08 14:01:34 +00:00
ganovelli d0d580c4ae Changed GetIntrinsics into:
GetExtrinsicsToWorldMatrix and
GetWorldToExtrinsicsMatrix
2008-10-07 10:57:09 +00:00
ganovelli e16d065e93 [Namespaces changes]
vert->vertex


clean up of some namespaces to comply the following naming:

Complexes (3 letters namespaces):
order 0 (point cloud    ) :vrt
order 1 (edge meshes)     :edg
order 2 (triangle meshes) :tri
order 3 (triangle meshes) :tet

Simplexes (extended namespaces):
order 0 (vertex)      :vertex 
order 1 (edge)        :edge 
order 2 (triangle)    :triangle (temporarily it remains "face")
order 3 (tetrahedron) :tetrahedron
2008-09-30 11:41:58 +00:00
ganovelli bb741600ca <limits.h> to <limit> 2008-09-30 11:41:04 +00:00
ganovelli a2e3e5b725 Removed Similarity from Shot
Problem: Shot was using similarity merely to store
rotation and translation. 
There was an incompatibility in that Similarity::ToMatrix
gives scale*rotation*translation while in Shot
the translation stores the viewpoint and the rotation the orientation of the Shot.

In this version, a small class ReferenceFrame was done to play the role of similarity and MultMatrix and MultSimilarity functions were added to transform the frame by multiplying it for a Matrix44 (or applying a similarity).

NOTE: the file export_ply.ply and import_ply.h must also be updated.

-- only compiled with .net ---
2008-09-26 17:07:32 +00:00
Federico Ponchio e5258c6aa3 Attempting to make similarity compatible with both quaternions and matrix44 2008-09-26 15:37:53 +00:00
ganovelli 3d8400f86e added a missing templatization od Point3 in Decompose (thanks Oscar Barney) 2008-09-22 13:49:15 +00:00
ganovelli efd69c8291 qualifier Camera<S>:: removed in inline definition (thanks Oscar Barney) 2008-09-22 13:42:49 +00:00
ganovelli 889b2ddaa3 chamged " to < in the #include 2008-09-22 09:35:01 +00:00
ganovelli f2ed76753c added inclusion of functional 2008-09-22 09:10:58 +00:00
granzuglia b9ce07204e Minor changes according to new Point<N,S> definition. 2008-09-10 14:06:13 +00:00
Paolo Cignoni e8c7472dca Corrected name of template type S in UndistortedToDistorted() to avoid the shadowing between S as type and S as variable name. 2008-09-09 17:41:33 +00:00
matteodelle c94dbdfdaf 2008-09-09 09:22:55 +00:00
matteodelle 0c2491e1b4 new functions to handle distortion: should not affect previous stuff. tested but still error prone... 2008-09-09 09:20:48 +00:00
Federico Ponchio 12d5a0e322 Removed compile warning by initializing imax to 0 in Decompose(). 2008-08-27 14:33:20 +00:00
Paolo Cignoni 7c66288207 changed a RotateRad to the new SetRotateRad 2008-08-14 10:02:07 +00:00
ganovelli 3462f6a8c2 changed from Rotate (in degrees) to SetRotateRad and SetRotateDeg (the same as in Matrix44.h)
Added return type to the functions SetXXX
2008-08-12 17:31:11 +00:00
Paolo Cignoni 9e214da6ff Re-inserted the return statement in the Invert() function that was erroneously removed with the previous commit. 2008-08-11 12:56:37 +00:00
Paolo Cignoni 65320e40a7 Added a clarifying comment on the Invert versus Inverse issue 2008-08-11 08:04:19 +00:00
ganovelli 1e94f7cf46 Add covariance matrix of a set of points 2008-08-07 18:33:23 +00:00
Paolo Cignoni dde42be7ea Added new line at the end of file 2008-08-04 15:55:53 +00:00
Paolo Cignoni e4e5507757 Added missing includes 2008-08-04 15:38:10 +00:00
Paolo Cignoni c46f5f2435 removed a version of the ComputeRigidMatchMatrix that take in input a weight vector. User should use ComputeWeightRigidMatchMatrix directly 2008-07-23 22:50:15 +00:00
Paolo Cignoni f61a69c94f in "ComputeRigidMatchMatrix(std::vector<ScalarType> weights,Matrix44x &res,std::vector<Point3x> &Pfix,std::vector<Point3x> &Pmov)" I changed:
Quaterniond qtmp;  ----->to------>	Quaternionx qtmp;
Point3d tr;	   ----->to------>	Point3x tr;
2008-07-23 17:30:30 +00:00
Paolo Cignoni 6a4631b94b 1) in "ComputeWeightedRigidMatchMatrix" I changed:
std::vector<double> weights       ----->to------>     std::vector<ScalarType> weights
tmp.Trasp();		          ----->to------>     tmp.Transpose();
QQ.Zero();		          ----->to------>     QQ.SetZero();
RM.Zero();		          ----->to------>     RM.SetZero();
ccm.Trasp();		          ----->to------>     ccm.Transpose();
QQ.Jacobi(d,v,nrot);	          ----->to------>     Jacobi(QQ,d,v,nrot);
q.RotMatrix(Rot);	          ----->to------>     q.ToMatrix(Rot);
tr= (bfix - Rot.Apply(bmov));     ----->to------>     tr= (bfix - Rot *bmov);		
Trn.Translate(tr);	          ----->to------>     Trn.SetTranslate(tr);	


2) in "ComputeRigidMatchMatrix" I changed:
return ComputeRigidMatchMatrix(res,Pfix,Pmov,qtmp,tr); 	----->to------>	 return ComputeWeightedRigidMatchMatrix(res,Pfix,Pmov,weights,qtmp,tr);
2008-07-23 17:19:51 +00:00
Federico Ponchio 825483d177 Rationalized ToMatrix and FromMatrix (and improved algorithm). 2008-07-21 13:38:55 +00:00
Federico Ponchio 89973a1a14 Extrinsics in Shot use Matrix44 not Quaternion. therefore ToMatrix was correct.
Rolling back.... sigh.
2008-07-14 13:42:22 +00:00
Federico Ponchio 844be84004 GetCol3 -> GetColumn3 (this part needs to be tested!) 2008-07-14 13:28:27 +00:00
Paolo Cignoni a20902efd8 VERY IMPORTANT CHANGE - Could break the compilation of a lot of code around.
SetRotate of matrix44 has gone. Now only the explicit version SetRotateDeg and SetRotateRad are available. It was too error prone having something with the OpenGL syntax but using radiant instead the OpenGL degrees
2008-07-13 05:37:00 +00:00
ganovelli 3d21fcba1d removed dependency on qt 2008-06-23 14:20:52 +00:00
Paolo Cignoni 8a6dbded39 Corrected wrong license information in the header 2008-05-28 23:29:23 +00:00
Paolo Cignoni 45ed8cb000 Capital f in Factorial 2008-05-28 08:59:40 +00:00
Paolo Cignoni a152d0e208 First release 2008-05-28 08:55:04 +00:00
Paolo Cignoni 0a0436a13c Removed $Log$ macro 2008-05-28 08:54:33 +00:00
Paolo Cignoni 4ee18ed103 First release 2008-05-28 08:53:30 +00:00
Paolo Cignoni 2caf6034f3 Added SQRT_TWO 2008-05-28 08:51:32 +00:00
Paolo Cignoni 399277570b First release 2008-05-16 10:36:35 +00:00
Federico Ponchio 9cb9c1dace Fixed Axis. Due to quaternion changes. 2008-04-11 12:22:32 +00:00
ganovelli b457b0c978 removed printf 2008-03-17 11:36:37 +00:00
Paolo Cignoni 04d00284a5 added missing include limits 2008-03-06 10:45:39 +00:00
Paolo Cignoni 051c612aba Heavily refactored the whole structure.
Some interfaces have been changed. Be careful.
2008-03-05 11:21:49 +00:00
Paolo Cignoni d14283e619 added maxcount 2008-02-29 12:15:06 +00:00
Federico Ponchio 82635287c7 Returrned to s*r*t decomposition. 2008-02-24 18:03:03 +00:00
Federico Ponchio 6b3726ef90 Removed a Transpose due to change in quaternions.h ToMatrix 2008-02-22 18:10:39 +00:00