]> Creatis software - creaMaracasVisu.git/commitdiff
Clean Code
authorPablo Garzon <gapablo2001@gmail.com>
Tue, 13 Jun 2023 13:46:49 +0000 (15:46 +0200)
committerPablo Garzon <gapablo2001@gmail.com>
Tue, 13 Jun 2023 13:46:49 +0000 (15:46 +0200)
bbtk/src/bbcreaMaracasVisuShowNPoints_Tools.cxx

index 2d650d6c9ad149c40db7b3d57f792ac7d59c5b85..1d8215e56487a30a8800066a6c9a538965b1f515 100644 (file)
@@ -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);