Commit Graph

512 Commits

Author SHA1 Message Date
Paolo Cignoni 6627c21d43 added a missing dot() product for the conservative people still using deprecated stuff... 2008-10-30 07:39:33 +00:00
Paolo Cignoni 69a82d6174 fix the is "inaccessible" issue with g++-4.0.1 - more fixes ;) 2008-10-29 11:29:57 +00:00
Paolo Cignoni 696f763c3d fix the is "inaccessible" issue with g++-4.0.1 2008-10-29 11:28:51 +00:00
Paolo Cignoni e587581275 add transposeInPlace and duplicate V(int) 2008-10-29 11:17:11 +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 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
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 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
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 57fe4376a2 fix a few warnings 2008-10-24 12:45:02 +00:00
Paolo Cignoni 9fc4f7d36f added a missing const to grid Create 2008-10-07 06:56:26 +00:00
ganovelli 7defccba1b getclosest update for \the new definition of distance functor 2008-09-30 11:01:09 +00:00
ganovelli 41bc27e33e Changed the type of query type. Made it dependend on distance functor 2008-09-24 09:28:53 +00:00
ganovelli 68d900ec7e changes to compile previous commit with gcc 2008-09-24 09:15:38 +00:00
ganovelli 6a649ee257 changes to comply the templatization of distance functor on the query type 2008-09-24 08:45:31 +00:00
ganovelli b2960231ca corrected bug on PointBase class (thanks Oscar Barney) 2008-09-22 13:40:53 +00:00
granzuglia 728a9020c4 The class PointBase has been renamed as Point.
An empty class PointBase has been added for backward compatibility.
Mathematical operation (+,+=,*,etc) in class Point<N,S> has been implemented.
2008-09-10 14:04:09 +00:00
ganovelli 1185e2ab96 minor type changes to compile with gcc 2008-08-19 11:03:39 +00:00
ganovelli 3cb29c805b changed template from vcg::Triangle to generic class to allow to pass a vcg::FaceSimpX (recall: the disambiguation was done in the function name exactly for this reason) 2008-08-19 10:21:01 +00:00
ganovelli 82d9dec26a aadded this-> to + operator to compile with .net 2008-08-07 16:22:27 +00:00
ganovelli d35117d9c2 added precompiler check if FABS macro is already defined 2008-08-04 10:54:34 +00:00
ganovelli 57c0fc8238 added inclusion of point3.h, removed useless namespace in InterpolationParameters 2008-08-04 10:53:08 +00:00
ganovelli 08cdd7b3aa added a version of CreateTight which takes a std::vector 2008-08-04 10:50:53 +00:00
ganovelli 3712ddfd50 - Change to avoid dangerous iterators decrement in RayITerator: reverse iterator used (same as in ClosestIterator)
-removed some old commented code
2008-07-29 16:05:29 +00:00
Paolo Cignoni 2dc0c1e1dc Fixed compilation bug under Visual Studio 2005 2008-07-29 13:01:10 +00:00
Federico Ponchio 75ee76b233 PlaneFitting returns the eigenvalues instead of true now. 2008-07-21 08:34:31 +00:00
Paolo Cignoni 4555f74ee3 added operator + between color with clamped specialization for unsigned chars 2008-07-09 15:18:08 +00:00
Paolo Cignoni 1407af2537 removed harmless warnings 2008-07-09 10:31:55 +00:00
Nico Pietroni 38c1cc7aaf changed epsilon value on InterpolationParameters function 2008-07-03 10:22:37 +00:00
Paolo Cignoni 711c985689 update to the new single template BasicGrid 2008-07-01 12:37:27 +00:00
Paolo Cignoni fa2c3fa060 updated the spatial indexing class to the new basicgrid class that has only one template parameter 2008-07-01 09:33:47 +00:00
Paolo Cignoni 4e227776f3 Removed one useless template parameter from the BasicGrid class and added a couple of useful accessory functions 2008-07-01 09:32:48 +00:00
Paolo Cignoni 616b3fedc5 Added the class oriented bounding box inherited from box3.h 2008-06-23 17:28:30 +00:00
Nico Pietroni 26e1c14de8 correct version of InterpolationParameters 2008-06-20 15:03:27 +00:00
Paolo Cignoni d95f6ee798 Added a constructor from point4 of the same type to allow the use of Point4 operator; e.g. col1 = col2 + col3
Added Clamp operator to get rid of out of 0..1 range values for floats
2008-06-17 23:08:53 +00:00
Paolo Cignoni 8972bf2ea2 added construct from and to float 2008-04-22 20:44:07 +00:00
Nico Pietroni 517108e947 corrected 1 warning in DistancePoint3Box3 function 2008-04-07 10:26:10 +00:00
Nico Pietroni 3edf76179c added default constructor 2008-04-07 10:24:55 +00:00
Nico Pietroni 8feedff976 correct 1 error on DistancePoint3Box3 (if the point is inside the box return distance to the nearest face instead of zero) 2008-03-05 11:48:08 +00:00
Nico Pietroni 94cb8fca1d added DistancePoint2Box2 2008-03-05 11:45:36 +00:00
Paolo Cignoni 66ee02eb49 __int64 is a MS only type. Added portability defines at the beginning. 2008-02-20 11:31:13 +00:00
Marco Callieri 3716a8c6df in BestDim(...) changed int -> _int64 to cope with programs with a very large cell number (like plyMC) 2008-02-19 12:43:01 +00:00
ganovelli 2dea5562fe typo corrected 2008-02-04 19:18:44 +00:00
Paolo Cignoni c6e1940149 Important Change. Now adding a null bbox to a bbox leave it unchanged (instead of trashing it) 2008-02-03 23:50:51 +00:00
Paolo Cignoni 57069766d4 corrected small bug in multitex coord indexing 2008-01-28 08:48:52 +00:00
Paolo Cignoni d87123b841 disambiguated sqrt call 2007-12-02 07:39:19 +00:00
Federico Ponchio 700ab9112d Added Mean Ratio metric for triangle quality. 2007-11-26 14:11:38 +00:00
ganovelli 9ff18f557b missing typename 2007-11-20 09:45:51 +00:00
Federico Ponchio f0d2300c82 QualityRadii values fixed. 2007-11-19 17:04:05 +00:00
Federico Ponchio e2dfebc909 Typo (missing comma). 2007-11-18 19:12:54 +00:00
Federico Ponchio 030feec36a Added qualityRadii: computes inradius /circumradius.
(ok the name is ugly...)
2007-11-16 14:22:35 +00:00
ganovelli c04c5cde70 added draft for sphereofsphres enclosing 2007-11-07 09:37:20 +00:00
Paolo Cignoni d3d7f047e4 added missing typenames 2007-10-16 16:45:49 +00:00
Nico Pietroni 71f3accd9c added Mirror function 2007-10-12 10:02:41 +00:00
Federico Ponchio 6c762759ab Added Circumcenter function. 2007-10-10 15:11:30 +00:00
Federico Ponchio 76721c28d1 Just a clarification comment 2007-09-21 11:34:10 +00:00
ganovelli 1fee504228 added ScalarType to tetra3 2007-07-31 12:35:42 +00:00
Federico Ponchio 68032b71dd Added method Gather:
Using a cubic voxel of side <radius> (see Set with radius)
allows you to process all pairs of objects within radius distance.
Usefull to compute normals, weighted means etc.
Speedup is about 7x.
2007-07-16 16:59:26 +00:00
Paolo Cignoni 8bfd6c40e0 Splitted initialiazation functions of grid to add flexibility in the creation 2007-07-16 15:13:39 +00:00
Paolo Cignoni 854717ecfc added a missing static to the Construct() member 2007-07-12 06:41:24 +00:00
Massimiliano Corsini bfbbe58a2a fix area 2007-07-02 10:01:00 +00:00
Paolo Cignoni 220baf92c7 Corrected gcc compiling issues 2007-07-02 04:25:32 +00:00
Federico Ponchio 54aa4df7c7 Made compatible with ScalarType = double 2007-06-20 09:26:42 +00:00
Paolo Cignoni 2ebecdde24 Added method that computes the minimum distance between a segment and a point 2007-06-12 15:40:41 +00:00
Federico Ponchio d8032a9bc0 *** empty log message *** 2007-06-08 14:57:29 +00:00
Paolo Cignoni 279306b9f7 Corrected error in the comment to method IntersectionSphereTriangle 2007-06-08 07:40:40 +00:00
Paolo Cignoni 9105a551cd Added IntersectionSphereTriangle 2007-06-07 15:16:39 +00:00
Paolo Cignoni ca8780af81 casting (size_t) to (int) to avoid annoying warning 2007-06-06 10:33:36 +00:00
Paolo Cignoni 1e2f4c1a80 Added IntersectionSegmentSphere 2007-05-29 14:33:29 +00:00
Paolo Cignoni 9fee0bfaaa Corrected wrong deallocation when octree was destroyed after being never used. 2007-05-10 10:48:49 +00:00
Paolo Cignoni 01277711b6 Corrected InterpolationParameters invocation 2007-05-10 09:31:15 +00:00
ganovelli b8df8c98db debug: function Offset called without pars 2007-05-08 18:54:20 +00:00
Nico Pietroni de99d5c2d9 corrected error on intersection line-circle 2007-05-08 13:49:08 +00:00
Nico Pietroni 43958eea39 added circle-line intersection 2007-05-08 12:11:58 +00:00
Paolo Cignoni 5dd620e4e4 Added enum Dimension; 2007-05-07 07:47:59 +00:00
ganovelli 339f609ece moved InterpolationParamaters out the class Triangle 2007-05-04 16:33:27 +00:00
ganovelli ec652a6d99 added cast to avoid warning 2007-05-04 16:17:24 +00:00
Paolo Cignoni e5d3f05580 commented out non compiling intersectionSpherePlane 2007-04-16 09:08:15 +00:00
Nico Pietroni 5644153c35 IntersectionPlanePlane first parameter is a const 2007-04-10 22:26:47 +00:00
Nico Pietroni 511f80625d - corrected and renamed distance to point ( function TrianglePointDistance) 2007-04-04 23:23:55 +00:00
Nico Pietroni 99afe015fd setted to const the parameter passed to function Projection 2007-04-04 23:22:29 +00:00
Nico Pietroni 477c03ffd1 - Changed name of intersection function between plane and triangle from Intersection to IntersectionPlaneTriangle.
- Added Intersection_Plane_Sphere function.
2007-04-04 23:19:40 +00:00
Nico Pietroni c466753fe5 corrected test with max distance in ray Iterator 2007-03-26 08:12:30 +00:00
Nico Pietroni 63e2cdd95f *** empty log message *** 2007-03-22 18:12:00 +00:00
Nico Pietroni 0aa99556bf *** empty log message *** 2007-03-22 17:29:16 +00:00
mtarini 8fed8aeed3 removed old "tcoord2". New name is "texcoord2" 2007-03-12 15:28:13 +00:00
mtarini 23a0cb0be4 New name (TCoord -> TexCoord). First commit after name change. 2007-03-12 15:26:56 +00:00
Nico Pietroni 00cc5e3f15 line 375, corrected 1 error concerning intersection with bounding of the grid 2007-03-08 17:05:50 +00:00
Marco Di Benedetto 50ed5305a4 Added const qualifier to bbox parameter in Intersection_Triangle_Box(). 2007-02-21 02:40:52 +00:00
ganovelli 116707257a modif in ClosestIterator to include the last shell Si.siz [X|Y|X]. Tested with minialign and point based animation 2007-02-20 16:22:50 +00:00
Paolo Cignoni c4b0073433 Initial commit. Only the Set and GetInSphere methods of the SpatialIndex interface are implemented. 2007-02-18 22:43:10 +00:00
mtarini c842c83b77 renamed all methods (now uppercase). Also, the Position of a TCoord is now "P()". Old methods name are left, just for now, for back-compatibility. They will be removed soon. 2007-01-30 19:04:50 +00:00
Nico Pietroni 385ee8ba62 - 1 warning corrected in InterpolationParameters function 2007-01-29 00:21:46 +00:00
Nico Pietroni aacbec3178 first working version 2007-01-25 01:11:10 +00:00
Nico Pietroni 9ec0e7b571 added:
- RayLineIntersection
- RaySegmentIntersection
- SegmentSegmentIntersection
2007-01-25 01:04:54 +00:00