]> Creatis software - creaVtk.git/blobdiff - bbtk_creaVtk_PKG/src/bbcreaVtkMeshManager_tool.cxx
#3517 Adjustments Undo - Redo for deformation
[creaVtk.git] / bbtk_creaVtk_PKG / src / bbcreaVtkMeshManager_tool.cxx
index 546ba7470e3cb129335ecac2011f162cc663e125..e1fc4ed5d161c846dd6e3b6dc92c651a86e0ff5c 100644 (file)
@@ -32,13 +32,19 @@ void MeshManager_tool::Process()
         if (bbGetInputTool()==10) // Undo
         {
                bbGetInputMeshManagerModel()->Undo();
-            //printf("EED Warning!   MeshManager_tool Undo   Not implemented.\n");
+               std::vector<double> outData = bbGetInputMeshManagerModel()->GetReferencePoint();
+               std::vector<double> refNormal = bbGetInputMeshManagerModel()->GetReferenceNormal();
+               outData.insert(outData.end(), refNormal.begin(), refNormal.end());
+               bbSetOutputOut(outData);
         } // if Tool 10 Undo
         
         if (bbGetInputTool()==20) // Redo
         {
                bbGetInputMeshManagerModel()->Redo();
-            //printf("EED Warning!   MeshManager_tool Redo   Not implemented.\n");
+               std::vector<double> outData = bbGetInputMeshManagerModel()->GetReferencePoint();
+               std::vector<double> refNormal = bbGetInputMeshManagerModel()->GetReferenceNormal();
+               outData.insert(outData.end(), refNormal.begin(), refNormal.end());
+               bbSetOutputOut(outData);
         } // if Tool 20 Redo
 
         if (bbGetInputTool()==30)  // Set
@@ -51,23 +57,21 @@ void MeshManager_tool::Process()
                 } // if points!=NULL
             } // Mesh!=NULL
         } // if Tool 30 Set
-        
-        if (bbGetInputTool()==31)  // Set/Update PolyData Reference
-        {
-            if (bbGetInputMesh()!=NULL){
-                vtkPoints   *points = bbGetInputMesh()->GetPoints();
-                if (points!=NULL)
-                {
-                    bbGetInputMeshManagerModel()->UpdateMeshReference( bbGetInputMesh() );
-                } // if points!=NULL
-            } // Mesh!=NULL
-        } // if Tool 30 Set
 
         if (bbGetInputTool()==35)  // Set memory mode
         {
                 bbGetInputMeshManagerModel()->SetMeshMemoryMode( bbGetInputMesh() );
         } // if Tool 35 Set memory mode
-
+               if(bbGetInputTool() == 37) // Save State Memory Mode
+        {
+               if(bbGetInputDoubleParams().size() == 8){       
+                               std::vector<double> point = {bbGetInputDoubleParams()[0], bbGetInputDoubleParams()[1], bbGetInputDoubleParams()[2]};
+                               bbGetInputMeshManagerModel()->SetReferencePoint(point);
+                               std::vector<double> normVect = {bbGetInputDoubleParams()[3], bbGetInputDoubleParams()[4], bbGetInputDoubleParams()[5]};
+                               bbGetInputMeshManagerModel()->SetReferenceNormal(normVect);
+                       bbGetInputMeshManagerModel()->SaveMemoryMode();
+               }
+        }
         if (bbGetInputTool()==32)  // Copy and Set
         {
                 bbGetInputMeshManagerModel()->CopySetMeshBase( bbGetInputMesh() );