Salome HOME
TC 5.1.5: SIGSEGV on closing study
[modules/geom.git] / src / TransformationGUI / TransformationGUI_MultiRotationDlg.cxx
index 643c5c8d84f322f36a213d2e11c32a06cf64a60a..aebe44d8263eac9c331907aa82a957eb605486bf 100644 (file)
@@ -153,6 +153,8 @@ void TransformationGUI_MultiRotationDlg::Init()
 
   myBase = myVector = GEOM::GEOM_Object::_nil();
 
+  mainFrame()->GroupBoxPublish->show();
+
   // signals and slots connections
   connect(buttonOk(),    SIGNAL(clicked()), this, SLOT(ClickOnOk()));
   connect(buttonApply(), SIGNAL(clicked()), this, SLOT(ClickOnApply()));
@@ -332,7 +334,7 @@ void TransformationGUI_MultiRotationDlg::SelectionIntoArgument()
         //Find SubShape Object in Father
         GEOM::GEOM_Object_var aFindedObject = findObjectInFather(aSelectedObject, aName);
 
-        if (aFindedObject == GEOM::GEOM_Object::_nil()) { // Object not found in study
+        if (aFindedObject->_is_nil()) { // Object not found in study
           GEOM::GEOM_IShapesOperations_var aShapesOp =
             getGeomEngine()->GetIShapesOperations(getStudyId());
           myVector = aShapesOp->GetSubShape(aSelectedObject, anIndex);
@@ -620,3 +622,24 @@ void TransformationGUI_MultiRotationDlg::addSubshapesToStudy()
   }
   addSubshapesToFather(objMap);
 }
+
+//=================================================================================
+// function : restoreSubShapes
+// purpose  :
+//=================================================================================
+void TransformationGUI_MultiRotationDlg::restoreSubShapes (SALOMEDS::Study_ptr   theStudy,
+                                                           SALOMEDS::SObject_ptr theSObject)
+{
+  if (mainFrame()->CheckBoxRestoreSS->isChecked()) {
+    // we pass here the first operation argument (object) through the list of arguments
+    // because the rotation operation place its arguments in the data structure in another order,
+    // and we need to point the first argument directly
+    GEOM::ListOfGO_var anArgs = new GEOM::ListOfGO;
+    anArgs->length(1);
+    anArgs[0] = myBase;
+    getGeomEngine()->RestoreSubShapesSO(theStudy, theSObject, anArgs,
+                                        /*theFindMethod=*/GEOM::FSM_Transformed,
+                                        /*theInheritFirstArg=*/true,
+                                        mainFrame()->CheckBoxAddPrefix->isChecked());
+  }
+}