From: Pablo Garzon Date: Tue, 13 Jun 2023 13:46:49 +0000 (+0200) Subject: Clean Code X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=95472e2daa7a1b6710d35ca27bccee21fa668843;p=creaMaracasVisu.git Clean Code --- diff --git a/bbtk/src/bbcreaMaracasVisuShowNPoints_Tools.cxx b/bbtk/src/bbcreaMaracasVisuShowNPoints_Tools.cxx index 2d650d6..1d8215e 100644 --- a/bbtk/src/bbcreaMaracasVisuShowNPoints_Tools.cxx +++ b/bbtk/src/bbcreaMaracasVisuShowNPoints_Tools.cxx @@ -737,7 +737,6 @@ void ShowNPoints_Tools::MovePointInNormal() spc[1] = bbGetInputSpacing()[1]; spc[2] = bbGetInputSpacing()[2]; - vtkPoints *points = bbGetInputMesh()->GetPoints(); vtkStaticPointLocator *pointLocator = vtkStaticPointLocator::New(); pointLocator->SetDataSet( bbGetInputMesh() ); pointLocator->BuildLocator(); @@ -745,15 +744,15 @@ void ShowNPoints_Tools::MovePointInNormal() int idControlPoint = wsp->GetModelShowNPoints()->GetNearestPoint(); if(idControlPoint >= 0){ wsp->GetModelShowNPoints()->GetIdPoint(idControlPoint, &x, &y, &z); - p[0] = x; - p[1] = y; - p[2] = z; + p[0] = x * spc[0]; + p[1] = y * spc[1]; + p[2] = z * spc[2]; int idMeshPoint = pointLocator->FindClosestPoint(p); bbGetInputMesh()->GetPointData()->GetNormals()->GetTuple(idMeshPoint, normal); int direction = bbGetInputParams()[0]; - pN[0] = p[0] + direction*normal[0]; - pN[1] = p[1] + direction*normal[1]; - pN[2] = p[2] + direction*normal[2]; + pN[0] = p[0] / spc[0] + direction*normal[0]; + pN[1] = p[1] / spc[1] + direction*normal[1]; + pN[2] = p[2] / spc[2] + direction*normal[2]; wsp->GetModelShowNPoints()->SetPointById(idControlPoint, pN); wsp->GetViewShowNPoints()->RefreshPoint(idControlPoint);