From 45bd3891076a582455f6e6027e47e4b117fe5912 Mon Sep 17 00:00:00 2001 From: ganovelli Date: Fri, 4 May 2007 16:34:31 +0000 Subject: [PATCH] changes to comply "plus" types --- vcg/complex/trimesh/closest.h | 5 ++++- vcg/complex/trimesh/update/color.h | 7 +++++-- vcg/complex/trimesh/update/edges.h | 33 ++++++++++++++++-------------- 3 files changed, 27 insertions(+), 18 deletions(-) diff --git a/vcg/complex/trimesh/closest.h b/vcg/complex/trimesh/closest.h index a611fccd..4fb0d729 100644 --- a/vcg/complex/trimesh/closest.h +++ b/vcg/complex/trimesh/closest.h @@ -24,6 +24,9 @@ History $Log: not supported by cvs2svn $ +Revision 1.27 2006/12/06 12:59:13 pietroni +added max distance to rayIterator + Revision 1.26 2006/11/21 16:06:54 ponchio passing VDistFunct() to functions wanting a reference, not a value (why a reference btw?) @@ -194,7 +197,7 @@ namespace vcg { // f=bestf; typename MESH::ScalarType alfa, beta, gamma; //calcolo normale con interpolazione trilineare - bestf->InterpolationParameters(_closestPt, alfa, beta, gamma); + InterpolationParameters(*bestf,_closestPt, alfa, beta, gamma); _normf = (bestf->V(0)->cN())*alfa+ (bestf->V(1)->cN())*beta+ (bestf->V(2)->cN())*gamma ; diff --git a/vcg/complex/trimesh/update/color.h b/vcg/complex/trimesh/update/color.h index ec74ecc3..db441715 100644 --- a/vcg/complex/trimesh/update/color.h +++ b/vcg/complex/trimesh/update/color.h @@ -24,6 +24,9 @@ History $Log: not supported by cvs2svn $ +Revision 1.10 2006/05/21 07:00:01 cignoni +Removed not working Equalized color (use funcs in stat.h) + Revision 1.9 2006/03/01 10:29:55 ponchio HACK: MaxVal(0.0f) not defined in vcg/math/base.h as it should be, changing it to 1e36 (pretty close :P) @@ -263,8 +266,8 @@ static void VertexQuality(UpdateMeshType &m) for(vi=m.vert.begin();vi!=m.vert.end();++vi) if(!(*vi).IsD()) { - minq=vcg::math::Min(minq,(*vi).Q()); - maxq=vcg::math::Max(maxq,(*vi).Q()); + minq=vcg::math::Min(minq,(*vi).Q()); + maxq=vcg::math::Max(maxq,(*vi).Q()); } VertexQuality(m,minq,maxq); } diff --git a/vcg/complex/trimesh/update/edges.h b/vcg/complex/trimesh/update/edges.h index ab335bce..95c9d72a 100644 --- a/vcg/complex/trimesh/update/edges.h +++ b/vcg/complex/trimesh/update/edges.h @@ -24,6 +24,9 @@ History $Log: not supported by cvs2svn $ +Revision 1.4 2006/05/16 21:36:54 cignoni +Removed unused box function and rewrote initial comment. + Revision 1.3 2006/05/15 13:12:36 pietroni Updating of edge values id divided into 2 functions ( the first one update only a face...) added also resetting of edges flags.. (see first line of Set function) @@ -65,26 +68,26 @@ namespace tri { f.Flags() = f.Flags() & (~(FaceType::NORMX|FaceType::NORMY|FaceType::NORMZ)); // Primo calcolo degli edges - f.edge[0] = f.V(1)->P(); f.edge[0] -= f.V(0)->P(); - f.edge[1] = f.V(2)->P(); f.edge[1] -= f.V(1)->P(); - f.edge[2] = f.V(0)->P(); f.edge[2] -= f.V(2)->P(); + f.Edge(0) = f.V(1)->P(); f.Edge(0) -= f.V(0)->P(); + f.Edge(1) = f.V(2)->P(); f.Edge(1) -= f.V(1)->P(); + f.Edge(2) = f.V(0)->P(); f.Edge(2) -= f.V(2)->P(); // Calcolo di plane - f.plane.SetDirection(f.edge[0]^f.edge[1]); - f.plane.SetOffset(f.plane.Direction() * f.V(0)->P()); - f.plane.Normalize(); + f.Plane().SetDirection(f.Edge(0)^f.Edge(1)); + f.Plane().SetOffset(f.Plane().Direction() * f.V(0)->P()); + f.Plane().Normalize(); // Calcolo migliore proiezione - ScalarType nx = math::Abs(f.plane.Direction()[0]); - ScalarType ny = math::Abs(f.plane.Direction()[1]); - ScalarType nz = math::Abs(f.plane.Direction()[2]); + ScalarType nx = math::Abs(f.Plane().Direction()[0]); + ScalarType ny = math::Abs(f.Plane().Direction()[1]); + ScalarType nz = math::Abs(f.Plane().Direction()[2]); ScalarType d; - if(nx>ny && nx>nz) { f.Flags() |= FaceType::NORMX; d = 1/f.plane.Direction()[0]; } - else if(ny>nz) { f.Flags() |= FaceType::NORMY; d = 1/f.plane.Direction()[1]; } - else { f.Flags() |= FaceType::NORMZ; d = 1/f.plane.Direction()[2]; } + if(nx>ny && nx>nz) { f.Flags() |= FaceType::NORMX; d = 1/f.Plane().Direction()[0]; } + else if(ny>nz) { f.Flags() |= FaceType::NORMY; d = 1/f.Plane().Direction()[1]; } + else { f.Flags() |= FaceType::NORMZ; d = 1/f.Plane().Direction()[2]; } // Scalatura spigoli - f.edge[0] *= d; - f.edge[1] *= d; - f.edge[2] *= d; + f.Edge(0)*=d; + f.Edge(1)*=d; + f.Edge(2)*=d; } static void Set(ComputeMeshType &m)