]> Creatis software - creaVtk.git/blobdiff - bbtk_creaVtk_PKG/src/bbcreaVtkMeshManager_tool.cxx
#3507 Undo and Redo Meshes
[creaVtk.git] / bbtk_creaVtk_PKG / src / bbcreaVtkMeshManager_tool.cxx
index bda31e1b44a90818c75af3cb1514f33a543bbc5e..cf99baf507ec3ec1682307e9b77f521f25c262c8 100644 (file)
@@ -26,22 +26,23 @@ void MeshManager_tool::Process()
 //      (the one provided in the attribute 'type' of the tag 'input')
 //    bbSetOutputOut( bbGetInputIn() );
 //    std::cout << "Output value = " <<bbGetOutputOut() << std::endl;
-
+    
     if (bbGetInputMeshManagerModel()!=NULL)
     {
         if (bbGetInputTool()==10) // Undo
         {
-            printf("EED Warning!   MeshManager_tool Undo   Not implemented.\n");
+               bbGetInputMeshManagerModel()->Undo();
+            //printf("EED Warning!   MeshManager_tool Undo   Not implemented.\n");
         } // if Tool 10 Undo
         
         if (bbGetInputTool()==20) // Redo
         {
-            printf("EED Warning!   MeshManager_tool Redo   Not implemented.\n");
+               bbGetInputMeshManagerModel()->Redo();
+            //printf("EED Warning!   MeshManager_tool Redo   Not implemented.\n");
         } // if Tool 20 Redo
 
         if (bbGetInputTool()==30)  // Set
         {
-            printf("EED    MeshManager_tool::Process Set\n");
             if (bbGetInputMesh()!=NULL){
                 vtkPoints   *points = bbGetInputMesh()->GetPoints();
                 if (points!=NULL)
@@ -51,10 +52,40 @@ void MeshManager_tool::Process()
             } // Mesh!=NULL
         } // if Tool 30 Set
 
-        if (bbGetInputTool()==40) // Reset
+        if (bbGetInputTool()==35)  // Set memory mode
+        {
+                bbGetInputMeshManagerModel()->SetMeshMemoryMode( bbGetInputMesh() );
+        } // if Tool 35 Set memory mode
+
+        if (bbGetInputTool()==32)  // Copy and Set
+        {
+                bbGetInputMeshManagerModel()->CopySetMeshBase( bbGetInputMesh() );
+        } // if Tool 35 Set memory mode
+
+        
+        if (bbGetInputTool()==40) // ResetMeshTemp
         {
-            printf("EED Warning!   MeshManager_tool Reset   Not implemented.\n");
+            bbGetInputMeshManagerModel()->ResetMeshTemp();
         } // if Tool 40 Reset
+        
+        if(bbGetInputTool() == 50) // Set Array of Meshes
+        {
+               if(bbGetInputMeshes().size() > 1)
+               {
+                       bbGetInputMeshManagerModel()->ReplaceMesh(bbGetInputMeshes());
+                   }
+        }
+        if(bbGetInputTool() == 60) // Select Mesh by Name
+        {
+               if(!bbGetInputStringParam().empty())
+               {
+                       bbGetInputMeshManagerModel()->SelectMeshByName(bbGetInputStringParam());
+                   }
+        }
+        if(bbGetInputTool() == 70) // Delete Current Mesh
+        {
+                   bbGetInputMeshManagerModel()->DeleteCurrentMesh();
+        }
     } else {
         printf("EED Warning! MeshManager_tool : MeshManagerModel not defined. \n");
     }// if MeshManagerModel != NULL