Removed bug in the ImportEdgeAdj, ImportFaceAdj, ImportHEdgeAdj. All of the same kind...

for(unsigned int vi = 0; vi < 2; ++vi)
 {
   size_t i = Index(mr,er.cEEp(vi));
   el.EEp(i) = (i>ml.edge.size())? 0 : &ml.edge[remap.edge[i]];
   el.EEi(i) = er.cEEi(i);
 }

 el.EEp(i)  should be  el.EEp(vi) !!!!
This commit is contained in:
Paolo Cignoni 2011-11-21 09:36:21 +00:00
parent 0e76a8e0ce
commit 5af75e6dac
1 changed files with 78 additions and 76 deletions

View File

@ -91,7 +91,8 @@ public:
}
}
static void ImportEdgeAdj(MeshLeft &ml, MeshRight &mr, EdgeLeft &el, const EdgeRight &er, Remap &remap, bool sel ){
static void ImportEdgeAdj(MeshLeft &ml, MeshRight &mr, EdgeLeft &el, const EdgeRight &er, Remap &remap, bool sel )
{
// Edge to Vertex Adj
if(vcg::tri::HasEVAdjacency(ml) && vcg::tri::HasEVAdjacency(mr)){
@ -104,15 +105,15 @@ public:
if(vcg::tri::HasEEAdjacency(ml) && vcg::tri::HasEEAdjacency(mr))
for(unsigned int vi = 0; vi < 2; ++vi)
{
size_t i = Index(mr,er.cEEp(vi));
el.EEp(i) = (i>ml.edge.size())? 0 : &ml.edge[remap.edge[i]];
el.EEi(i) = er.cEEi(i);
size_t idx = Index(mr,er.cEEp(vi));
el.EEp(vi) = (idx>ml.edge.size())? 0 : &ml.edge[remap.edge[idx]];
el.EEi(vi) = er.cEEi(vi);
}
// Edge to Face Adj
if(vcg::tri::HasEFAdjacency(ml) && vcg::tri::HasEFAdjacency(mr)){
size_t i = Index(mr,er.cEFp());
el.EFp() = (i>ml.face.size())? 0 :&ml.face[remap.face[i]];
size_t idx = Index(mr,er.cEFp());
el.EFp() = (idx>ml.face.size())? 0 :&ml.face[remap.face[idx]];
el.EFi() = er.cEFi();
}
@ -123,7 +124,8 @@ public:
}
static void ImportFaceAdj(MeshLeft &ml, MeshRight &mr, FaceLeft &fl, const FaceRight &fr, Remap &remap, bool sel ){
static void ImportFaceAdj(MeshLeft &ml, MeshRight &mr, FaceLeft &fl, const FaceRight &fr, Remap &remap, bool sel )
{
// Face to Vertex Adj
if(vcg::tri::HasFVAdjacency(ml) && vcg::tri::HasFVAdjacency(mr)){
assert(fl.VN() == fr.VN());
@ -136,8 +138,8 @@ public:
if(vcg::tri::HasFEAdjacency(ml) && vcg::tri::HasFEAdjacency(mr)){
assert(fl.VN() == fr.VN());
for( int vi = 0; vi < fl.VN(); ++vi ){
size_t i = Index(mr,fr.cFEp(vi));
fl.FEp(i) = (i>ml.edge.size())? 0 : &ml.edge[remap.edge[i]];
size_t idx = Index(mr,fr.cFEp(vi));
fl.FEp(vi) = (idx>ml.edge.size())? 0 : &ml.edge[remap.edge[idx]];
}
}
@ -145,8 +147,8 @@ public:
if(vcg::tri::HasFFAdjacency(ml) && vcg::tri::HasFFAdjacency(mr)){
assert(fl.VN() == fr.VN());
for( int vi = 0; vi < fl.VN(); ++vi ){
size_t i = Index(mr,fr.cFFp(vi));
fl.FFp(vi) = (i>ml.face.size()) ? 0 :&ml.face[remap.face[i]];
size_t idx = Index(mr,fr.cFFp(vi));
fl.FFp(vi) = (idx>ml.face.size()) ? 0 :&ml.face[remap.face[idx]];
fl.FFi(vi) = fr.cFFi(vi);
}
}
@ -164,14 +166,14 @@ public:
// HEdge to Edge Adj
if(vcg::tri::HasHEAdjacency(ml) && vcg::tri::HasHEAdjacency(mr)){
size_t i = Index(mr,hr.cHEp()) ;
hl.HEp() = (i>ml.edge.size())? 0 : &ml.edge[remap.edge[i]];
size_t idx = Index(mr,hr.cHEp()) ;
hl.HEp() = (idx>ml.edge.size())? 0 : &ml.edge[remap.edge[idx]];
}
// HEdge to Face Adj
if(vcg::tri::HasHFAdjacency(ml) && vcg::tri::HasHFAdjacency(mr)){
size_t i = Index(mr,hr.cHFp());
hl.HFp() = (i>ml.face.size())? 0 :&ml.face[remap.face[i]];
size_t idx = Index(mr,hr.cHFp());
hl.HFp() = (idx>ml.face.size())? 0 :&ml.face[remap.face[idx]];
}