Salome HOME
updated copyright message
[modules/geom.git] / src / TransformationGUI / TransformationGUI_RotationDlg.cxx
index e88ba0ab6ddd23b71db39346070d0dd04e5084be..7bf0479f5ce1a241c043482cafac53082fc66c9d 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2023  CEA, EDF, OPEN CASCADE
 //
 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
@@ -361,9 +361,9 @@ void TransformationGUI_RotationDlg::SetEditCurrentArgument()
     GroupPoints->LineEdit5->setEnabled(false);
 
     if (getConstructorId() == 0)
-      localSelection(GEOM::GEOM_Object::_nil(), TopAbs_EDGE);
+      localSelection(TopAbs_EDGE);
     else
-      localSelection(GEOM::GEOM_Object::_nil(), TopAbs_VERTEX);
+      localSelection(TopAbs_VERTEX);
   }
   else if (send == GroupPoints->PushButton4) {
     myEditCurrentArgument = GroupPoints->LineEdit4;
@@ -375,7 +375,7 @@ void TransformationGUI_RotationDlg::SetEditCurrentArgument()
     GroupPoints->LineEdit2->setEnabled(false);
     GroupPoints->LineEdit5->setEnabled(false);
 
-    localSelection(GEOM::GEOM_Object::_nil(), TopAbs_VERTEX);
+    localSelection(TopAbs_VERTEX);
   }
   else if (send == GroupPoints->PushButton5) {
     myEditCurrentArgument = GroupPoints->LineEdit5;
@@ -387,7 +387,7 @@ void TransformationGUI_RotationDlg::SetEditCurrentArgument()
     GroupPoints->LineEdit2->setEnabled(false);
     GroupPoints->LineEdit4->setEnabled(false);
 
-    localSelection(GEOM::GEOM_Object::_nil(), TopAbs_VERTEX);
+    localSelection(TopAbs_VERTEX);
   }
   connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()),
           this, SLOT(SelectionIntoArgument()));
@@ -450,7 +450,7 @@ void TransformationGUI_RotationDlg::ValueChangedInSpinBox()
 //=================================================================================
 GEOM::GEOM_IOperations_ptr TransformationGUI_RotationDlg::createOperation()
 {
-  return getGeomEngine()->GetITransformOperations(getStudyId());
+  return getGeomEngine()->GetITransformOperations();
 }
 
 //=================================================================================
@@ -497,7 +497,7 @@ bool TransformationGUI_RotationDlg::execute (ObjectList& objects)
           anObj = anOper->RotateCopy(myObjects[i].get(), myAxis.get(), GetAngle() * M_PI / 180.);
           if (!anObj->_is_nil()) {
             if(!IsPreview()) {
-              anObj->SetParameters(aParameters.join(":").toLatin1().constData());
+              anObj->SetParameters(aParameters.join(":").toUtf8().constData());
             }
             objects.push_back(anObj._retn());
           }
@@ -509,7 +509,7 @@ bool TransformationGUI_RotationDlg::execute (ObjectList& objects)
           anObj = anOper->Rotate(myObjects[i].get(), myAxis.get(), GetAngle() * M_PI / 180.);
           if (!anObj->_is_nil()) {
             if(!IsPreview()) {
-              anObj->SetParameters(aParameters.join(":").toLatin1().constData());
+              anObj->SetParameters(aParameters.join(":").toUtf8().constData());
               updateAttributes(anObj, aParameters);
             }
             objects.push_back(anObj._retn());
@@ -549,8 +549,7 @@ bool TransformationGUI_RotationDlg::execute (ObjectList& objects)
 // function : restoreSubShapes
 // purpose  :
 //=================================================================================
-void TransformationGUI_RotationDlg::restoreSubShapes (SALOMEDS::Study_ptr   theStudy,
-                                                      SALOMEDS::SObject_ptr theSObject)
+void TransformationGUI_RotationDlg::restoreSubShapes (SALOMEDS::SObject_ptr theSObject)
 {
   if (mainFrame()->CheckBoxRestoreSS->isChecked()) {
     // we pass here the first operation argument (object) through the list of arguments
@@ -559,7 +558,7 @@ void TransformationGUI_RotationDlg::restoreSubShapes (SALOMEDS::Study_ptr   theS
     GEOM::ListOfGO_var anArgs = new GEOM::ListOfGO;
     anArgs->length(1);
     anArgs[0] = myCurrObject.copy();
-    getGeomEngine()->RestoreSubShapesSO(theStudy, theSObject, anArgs,
+    getGeomEngine()->RestoreSubShapesSO(theSObject, anArgs,
                                         /*theFindMethod=*/GEOM::FSM_Transformed,
                                         /*theInheritFirstArg=*/true,
                                         mainFrame()->CheckBoxAddPrefix->isChecked());
@@ -616,3 +615,17 @@ void TransformationGUI_RotationDlg::addSubshapesToStudy()
     }
   }
 }
+
+//=================================================================================
+// function : getSourceObjects
+// purpose  : virtual method to get source objects
+//=================================================================================
+QList<GEOM::GeomObjPtr> TransformationGUI_RotationDlg::getSourceObjects()
+{
+  QList<GEOM::GeomObjPtr> res;
+  if ( GroupPoints->CheckButton1->isChecked() ) {
+    res.append(myObjects);
+    res << myAxis << myCentPoint << myPoint1 << myPoint2;
+  }
+  return res;
+}