X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=bbtk_creaVtk_PKG%2Fsrc%2FbbcreaVtkMeshDeformation.cxx;h=47bf806d454819ddf306ee3a5264ffe72a0d9fcb;hb=3f7942238283deeee804cc405c22c64d8a785300;hp=9223d520135f4ac9d37dee006a2617c2f8a69721;hpb=51f20c2ae79090ebe8c95ed7194daeee2fe9c215;p=creaVtk.git diff --git a/bbtk_creaVtk_PKG/src/bbcreaVtkMeshDeformation.cxx b/bbtk_creaVtk_PKG/src/bbcreaVtkMeshDeformation.cxx index 9223d52..47bf806 100644 --- a/bbtk_creaVtk_PKG/src/bbcreaVtkMeshDeformation.cxx +++ b/bbtk_creaVtk_PKG/src/bbcreaVtkMeshDeformation.cxx @@ -30,13 +30,13 @@ void MeshDeformation::Process() std::vector lstCenter = bbGetInputCenter(); - double s = bbGetInputS(); - bool ok=false; + double s = bbGetInputS(); + bool ok = false; if (bbGetInputTypeIn()==0) // direction { if (bbGetInputDirection().size()==3) { - ok = !( (bbGetInputDirection()[0]==0) && (bbGetInputDirection()[1]==0) && (bbGetInputDirection()[2]==0) ); + ok = !( (bbGetInputDirection()[0]==0) && (bbGetInputDirection()[1]==0) && (bbGetInputDirection()[2]==0) ); } } // if TypeIn 0 @@ -67,37 +67,37 @@ void MeshDeformation::Process() displcement_y = bbGetInputDirection()[1]; displcement_z = bbGetInputDirection()[2]; } // if TypeIn 0 Direction - if (bbGetInputTypeIn()==1) // Center { if (EdgeIdBack==bbGetInputEdgeId() ) { - displcement_x = (lstCenter[0]-backLstCenter[0])/1.0; - displcement_y = (lstCenter[1]-backLstCenter[1])/1.0; - displcement_z = (lstCenter[2]-backLstCenter[2])/1.0; + displcement_x = (lstCenter[0]-backLstCenter[0])/1.0; + displcement_y = (lstCenter[1]-backLstCenter[1])/1.0; + displcement_z = (lstCenter[2]-backLstCenter[2])/1.0; } // if EdgeIdBack!=bbGetInputEdgeId() - backLstCenter[0]= lstCenter[0]; - backLstCenter[1]= lstCenter[1]; - backLstCenter[2]= lstCenter[2]; + backLstCenter[0] = lstCenter[0]; + backLstCenter[1] = lstCenter[1]; + backLstCenter[2] = lstCenter[2]; } // if TypeIn 1 Center - - - points->GetPoint( bbGetInputEdgeId() , pb ); - if (EdgeIdBack!=bbGetInputEdgeId() ) + points->GetPoint( bbGetInputEdgeId() , pb ); + if (EdgeIdBack!=bbGetInputEdgeId() ) + { + EdgeIdBack = bbGetInputEdgeId(); + displcement_x = 0; + displcement_y = 0; + displcement_z = 0; + voiIdPoints.clear(); + for ( i=0 ; iGetPoint(i,p); + if ( (p[0]>(pb[0]-sx)) && (p[0]<(pb[0]+sx)) && + (p[1]>(pb[1]-sy)) && (p[1]<(pb[1]+sy)) && + (p[2]>(pb[2]-sz)) && (p[2]<(pb[2]+sz)) ) { - points->GetPoint(i,p); - if ( (p[0]>(pb[0]-sx)) && (p[0]<(pb[0]+sx)) && - (p[1]>(pb[1]-sy)) && (p[1]<(pb[1]+sy)) && - (p[2]>(pb[2]-sz)) && (p[2]<(pb[2]+sz)) ) - { - voiIdPoints.push_back( i ); - } // if - } // for i - } // back + voiIdPoints.push_back( i ); + } // if + } // for i + } // back if ( !((displcement_x==0) &&(displcement_y==0) && (displcement_z==0)) ) { @@ -125,7 +125,7 @@ void MeshDeformation::Process() points->Modified(); bbGetInputIn()->Modified(); } // if distance_x y z != 0 - } // In != NULL + } // In != NULL ok active } //===== // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)