From eae78a02515e7f79dacde93e4d4d8911f3573170 Mon Sep 17 00:00:00 2001 From: cignoni Date: Thu, 25 Jun 2009 06:19:00 +0000 Subject: [PATCH] completed the correct working of temporary data inside the refinement functions --- vcg/complex/trimesh/create/platonic.h | 2 +- vcg/complex/trimesh/refine.h | 3 +++ vcg/simplex/face/component_ocf.h | 6 +++++- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/vcg/complex/trimesh/create/platonic.h b/vcg/complex/trimesh/create/platonic.h index b26a2ee3..90c555f1 100644 --- a/vcg/complex/trimesh/create/platonic.h +++ b/vcg/complex/trimesh/create/platonic.h @@ -440,7 +440,7 @@ void Sphere(MeshType &in, const int subdiv = 3 ) size_t lastsize = 0; for(int i = 0 ; i < subdiv; ++i) { - Refine< MeshType, MidPoint >(in, MidPoint(), 0); + Refine< MeshType, MidPoint >(in, MidPoint(&in), 0); for(vi = in.vert.begin() + lastsize; vi != in.vert.end(); ++vi) vi->P().Normalize(); diff --git a/vcg/complex/trimesh/refine.h b/vcg/complex/trimesh/refine.h index 1c508843..49ee79e3 100644 --- a/vcg/complex/trimesh/refine.h +++ b/vcg/complex/trimesh/refine.h @@ -440,8 +440,11 @@ bool RefineE(MESH_TYPE &m, MIDPOINT mid, EDGEPRED ep,bool RefineSelected=false, for(i=1;iC()=(*fi).cC(); } + if(tri::HasPerWedgeTexCoord(m)) for(i=0;i<3;++i) { wtt[i]=(*fi).WT(i); diff --git a/vcg/simplex/face/component_ocf.h b/vcg/simplex/face/component_ocf.h index b452f6dc..e7a18e8e 100644 --- a/vcg/simplex/face/component_ocf.h +++ b/vcg/simplex/face/component_ocf.h @@ -538,7 +538,11 @@ public: assert((*this).Base().ColorEnabled); return (*this).Base().CV[(*this).Index()]; } - const ColorType C() const { + const ColorType C() const { + assert((*this).Base().ColorEnabled); + return (*this).Base().CV[(*this).Index()]; + } + const ColorType cC() const { assert((*this).Base().ColorEnabled); return (*this).Base().CV[(*this).Index()]; }