]> Creatis software - creaVtk.git/blobdiff - bbtk_creaVtk_PKG/src/bbcreaVtkMeshDeformation.cxx
#3507 Undo and Redo Meshes
[creaVtk.git] / bbtk_creaVtk_PKG / src / bbcreaVtkMeshDeformation.cxx
index e65b411e9d30111d1b698b17329d7223dbf09639..b229f5376b80e58779594b9261da40cd833aa27e 100644 (file)
@@ -13,7 +13,6 @@ BBTK_BLACK_BOX_IMPLEMENTATION(MeshDeformation,bbtk::AtomicBlackBox);
 //===== 
 void MeshDeformation::Process()
 {
-
 // THE MAIN PROCESSING METHOD BODY
 //   Here we simply set the input 'In' value to the output 'Out'
 //   And print out the output value
@@ -28,9 +27,7 @@ void MeshDeformation::Process()
 //    bbSetOutputOut( bbGetInputIn() );
 //    std::cout << "Output value = " <<bbGetOutputOut() << std::endl;
 
-
     std::vector<double> lstCenter = bbGetInputCenter();
-
     double  s   = bbGetInputS();
     bool    ok  = false;
     if (bbGetInputTypeIn()==0) // direction
@@ -48,9 +45,6 @@ void MeshDeformation::Process()
 
     if ( (bbGetInputIn()!=NULL) && (ok==true) && (bbGetInputEdgeId()>=0) && (bbGetInputActive()==true) )
     {
-
-        printf(" EED MeshDeformation::Process   %ld   %ld  -   %f %f %f \n", EdgeIdBack, bbGetInputEdgeId() , lstCenter[0],lstCenter[1],lstCenter[2] );
-
         vtkPoints* points=bbGetInputIn()->GetPoints();
         long    i,size=points->GetNumberOfPoints();
         double  p[3];  // point
@@ -71,6 +65,9 @@ void MeshDeformation::Process()
             displcement_y = bbGetInputDirection()[1];
             displcement_z = bbGetInputDirection()[2];
         } // if TypeIn 0 Direction
+               
+               printf(" EED MeshDeformation::Process   %ld   %ld  -   %f %f %f \n", EdgeIdBack, bbGetInputEdgeId() , lstCenter[0],lstCenter[1],lstCenter[2] );
+               
         if (bbGetInputTypeIn()==1) // Center
         {
             if (EdgeIdBack==bbGetInputEdgeId() )
@@ -87,9 +84,6 @@ void MeshDeformation::Process()
         if (EdgeIdBack!=bbGetInputEdgeId() )
         {
             EdgeIdBack = bbGetInputEdgeId();
-            displcement_x = 0;
-            displcement_y = 0;
-            displcement_z = 0;
             voiIdPoints.clear();
             for ( i=0 ; i<size ; i++)
             {
@@ -101,7 +95,10 @@ void MeshDeformation::Process()
                     voiIdPoints.push_back( i );
                 } // if
             } // for i
-        } // back
+                       backLstCenter[0] = lstCenter[0];
+                       backLstCenter[1] = lstCenter[1];
+                       backLstCenter[2] = lstCenter[2];
+        } // if EdgeIdBack
 
         if ( !((displcement_x==0) &&(displcement_y==0) && (displcement_z==0)) )
         {
@@ -129,7 +126,7 @@ void MeshDeformation::Process()
             points->Modified();
             bbGetInputIn()->Modified();
         } // if distance_x y z  != 0
-    } // In != NULL    ok    active
+    } // 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)