Salome HOME
Copyright update 2021
[modules/geom.git] / src / GenerationGUI / GenerationGUI_PrismDlg.cxx
index c86cdf5922fe235d3cd2dc9b48e93a18e40b1fcf..9e81339332c0f2e64967e78ada7cb8ce5be90c34 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2013  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2021  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
@@ -6,7 +6,7 @@
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 // License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
 //
 // This library is distributed in the hope that it will be useful,
 // but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -446,7 +446,7 @@ void GenerationGUI_PrismDlg::SetEditCurrentArgument()
     myEditCurrentArgument = GroupVecH->LineEdit2;
     GroupVecH->PushButton1->setDown(false);
     GroupVecH->LineEdit1->setEnabled(false);
-    localSelection(GEOM::GEOM_Object::_nil(), TopAbs_EDGE);
+    localSelection(TopAbs_EDGE);
   }
   else if (send == Group2Points->PushButton1) {
     myEditCurrentArgument = Group2Points->LineEdit1;
@@ -461,7 +461,7 @@ void GenerationGUI_PrismDlg::SetEditCurrentArgument()
     Group2Points->PushButton3->setDown(false);
     Group2Points->LineEdit1->setEnabled(false);
     Group2Points->LineEdit3->setEnabled(false);
-    localSelection(GEOM::GEOM_Object::_nil(), TopAbs_VERTEX);
+    localSelection(TopAbs_VERTEX);
   }
   else if (send == Group2Points->PushButton3) {
     myEditCurrentArgument = Group2Points->LineEdit3;
@@ -469,7 +469,7 @@ void GenerationGUI_PrismDlg::SetEditCurrentArgument()
     Group2Points->PushButton2->setDown(false);
     Group2Points->LineEdit1->setEnabled(false);
     Group2Points->LineEdit2->setEnabled(false);
-    localSelection(GEOM::GEOM_Object::_nil(), TopAbs_VERTEX);
+    localSelection(TopAbs_VERTEX);
   }
   else   if (send == GroupDXDYDZ->PushButton1) {
     myEditCurrentArgument = GroupDXDYDZ->LineEdit1;
@@ -526,7 +526,7 @@ void GenerationGUI_PrismDlg::ValueChangedInSpinBox()
 //=================================================================================
 GEOM::GEOM_IOperations_ptr GenerationGUI_PrismDlg::createOperation()
 {
-  return getGeomEngine()->GetI3DPrimOperations(getStudyId());
+  return getGeomEngine()->GetI3DPrimOperations();
 }
 
 //=================================================================================
@@ -641,7 +641,7 @@ void GenerationGUI_PrismDlg::onAddThickening(bool isChecked)
 // function : onChangeDirection(bool)
 // purpose  :
 //=================================================================================
-void GenerationGUI_PrismDlg::onChangeDirection(bool isChecked)
+void GenerationGUI_PrismDlg::onChangeDirection(bool /*isChecked*/)
 {
   processPreview();
 }
@@ -676,7 +676,7 @@ bool GenerationGUI_PrismDlg::execute (ObjectList& objects)
 
       if (!anObj->_is_nil() && !IsPreview()) {
         aParameters << GroupVecH->SpinBox_DX->text();
-        anObj->SetParameters(aParameters.join(":").toLatin1().constData());
+        anObj->SetParameters(aParameters.join(":").toUtf8().constData());
       }
       break;
     case 1:
@@ -709,7 +709,7 @@ bool GenerationGUI_PrismDlg::execute (ObjectList& objects)
         aParameters << GroupDXDYDZ->SpinBox_DX->text();
         aParameters << GroupDXDYDZ->SpinBox_DY->text();
         aParameters << GroupDXDYDZ->SpinBox_DZ->text();
-        anObj->SetParameters(aParameters.join(":").toLatin1().constData());
+        anObj->SetParameters(aParameters.join(":").toUtf8().constData());
       }
       break;
     }
@@ -717,12 +717,15 @@ bool GenerationGUI_PrismDlg::execute (ObjectList& objects)
     if(GroupThickening->checkButton1->isChecked())
     { 
       double aThickness = GroupThickening->SpinBox_DX->value();
-      if (GroupThickening->checkButton2->isChecked())
-      {
-        aThickness = -aThickness;  
-      }
-      
-      anObj = anotherOper->MakeThickening(anObj, aThickness, /*copy=*/false);    
+      bool isInside = GroupThickening->checkButton2->isChecked();
+
+      GEOM::ListOfLong_var anArray = new GEOM::ListOfLong;
+
+      anObj = anotherOper->MakeThickening
+        (anObj, anArray, aThickness, /*copy=*/false, isInside);
+
+      if (!anObj->_is_nil() && !IsPreview())
+        anObj->SetParameters(GroupThickening->SpinBox_DX->text().toUtf8().constData());
     }
     
     if (!anObj->_is_nil())
@@ -759,3 +762,14 @@ bool GenerationGUI_PrismDlg::extractPrefix() const
 {
   return myBaseObjects.count() > 1;
 }
+
+//=================================================================================
+// function : getSourceObjects
+// purpose  : virtual method to get source objects
+//=================================================================================
+QList<GEOM::GeomObjPtr> GenerationGUI_PrismDlg::getSourceObjects()
+{
+  QList<GEOM::GeomObjPtr> res(myBaseObjects);
+  res << myVec << myPoint1 << myPoint2 ;
+  return res;
+}