From e92adc209512e7671b95a1ab7b133e35cf37e520 Mon Sep 17 00:00:00 2001 From: ganovelli Date: Wed, 16 Jun 2010 16:29:07 +0000 Subject: [PATCH] ImportLocal to ImportData. Adjacencies are no more handle by ImportData, but by speficic functions in append.h (ImportPerxxxAdj(..)) --- vcg/complex/trimesh/bitquad_creation.h | 16 ++++++++-------- vcg/complex/trimesh/update/halfedge_indexed.h | 5 +++-- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/vcg/complex/trimesh/bitquad_creation.h b/vcg/complex/trimesh/bitquad_creation.h index fa6be044..a29b6065 100644 --- a/vcg/complex/trimesh/bitquad_creation.h +++ b/vcg/complex/trimesh/bitquad_creation.h @@ -369,15 +369,15 @@ static void MakePureByRefine(MeshType &m){ assert(nvi!=m.vert.end()); VertexType *nv = &*nvi; nvi++; //*nv = *fi->V0( 0 ); // lazy: copy everything from the old vertex - nv->ImportLocal(*(fi->V0( 0 ))); // lazy: copy everything from the old vertex + nv->ImportData(*(fi->V0( 0 ))); // lazy: copy everything from the old vertex nv->P() = ( fi->V(0)->P() + fi->V(1)->P() + fi->V(2)->P() ) /3.0; FaceType *fa = &*fi; FaceType *fb = &*nfi; nfi++; FaceType *fc = &*nfi; nfi++; - fb->ImportLocal(*fa); CopyTopology(fb,fa); - fc->ImportLocal(*fa); CopyTopology(fc,fa); + fb->ImportData(*fa); CopyTopology(fb,fa); + fc->ImportData(*fa); CopyTopology(fc,fa); fa->V(0) = nv; fb->V(1) = nv; @@ -443,7 +443,7 @@ static void MakePureByRefine(MeshType &m){ assert(nvi!=m.vert.end()); VertexType *nv = &*nvi; nvi++; // *nv = * fa->V0( ea2 ); - nv->ImportLocal(*(fa->V0( ea2 ) )); // lazy: copy everything from the old vertex + nv->ImportData(*(fa->V0( ea2 ) )); // lazy: copy everything from the old vertex //nv->P() = ( fa->V(ea2)->P() + fa->V(ea0)->P() ) /2.0; Interpolator::Apply(*(fa->V(ea2)),*(fa->V(ea0)),0.5,*nv); // split faces: add 2 faces (one per side) @@ -452,8 +452,8 @@ static void MakePureByRefine(MeshType &m){ assert(nfi!=m.face.end()); FaceType *fd = &*nfi; nfi++; - fc->ImportLocal(*fa ); CopyTopology(fc,fa); // lazy: copy everything from the old vertex - fd->ImportLocal(*fb ); CopyTopology(fd,fb);// lazy: copy everything from the old vertex + fc->ImportData(*fa ); CopyTopology(fc,fa); // lazy: copy everything from the old vertex + fd->ImportData(*fb ); CopyTopology(fd,fb);// lazy: copy everything from the old vertex fa->V(ea2) = fc->V(ea0) = fb->V(eb2) = fd->V(eb0) = nv ; @@ -547,13 +547,13 @@ static void MakePureByRefine(MeshType &m){ // create new vert in center of faux edge VertexType *nv = &*nvi; nvi++; //*nv = * fa->V0( ea2 ); - nv->ImportLocal(*(fa->V0( ea2 ) )); // lazy: copy everything from the old vertex + nv->ImportData(*(fa->V0( ea2 ) )); // lazy: copy everything from the old vertex nv->P() = ( fa->V(ea2)->P() + fa->V(ea0)->P() ) /2.0; Interpolator::Apply(*(fa->V(ea2)),*(fa->V(ea0)),0.5,*nv); // split face: add 1 face FaceType *fc = &*nfi; nfi++; - fc->ImportLocal(*fa);CopyTopology(fc,fa); // lazy: copy everything from the old vertex + fc->ImportData(*fa);CopyTopology(fc,fa); // lazy: copy everything from the old vertex fa->V(ea2) = fc->V(ea0) = nv ; diff --git a/vcg/complex/trimesh/update/halfedge_indexed.h b/vcg/complex/trimesh/update/halfedge_indexed.h index f459771b..c5136d62 100644 --- a/vcg/complex/trimesh/update/halfedge_indexed.h +++ b/vcg/complex/trimesh/update/halfedge_indexed.h @@ -202,7 +202,7 @@ namespace vcg { if((*ei).HEp() == NULL) { - (*ei).HEp() = &(*edge_i); + (*ei).HEp() = &(*edge_i); (*ei).HOp()->HEp() = &(*edge_i); (*edge_i).EHp() = &(*ei); @@ -337,7 +337,7 @@ namespace vcg } } - if( HasHEAdjacency(m) ) + if( HasHEAdjacency(m) && (m.en!=0)) { if( ! ep->HEp()) return false; //halfedge must point to an edge @@ -363,6 +363,7 @@ namespace vcg if( ep->HNp()->IsD()) return false; // + if(hasHP) if( ep->HNp()->HPp() != ep) return false; //