]> 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 c089676c87390307eaadedb0acd7185219a57577..e1fc4ed5d161c846dd6e3b6dc92c651a86e0ff5c 100644 (file)
@@ -32,13 +32,19 @@ void MeshManager_tool::Process()
         if (bbGetInputTool()==10) // Undo
         {
                bbGetInputMeshManagerModel()->Undo();
-               bbSetOutputOut(bbGetInputMeshManagerModel()->GetReferencePoint());
+               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();
-               bbSetOutputOut(bbGetInputMeshManagerModel()->GetReferencePoint());
+               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
@@ -58,9 +64,11 @@ void MeshManager_tool::Process()
         } // if Tool 35 Set memory mode
                if(bbGetInputTool() == 37) // Save State Memory Mode
         {
-               if(bbGetInputDoubleParams().size() == 5){       
+               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();
                }
         }