Salome HOME
Merge branch 'CR26451'
[modules/shaper.git] / src / PartSet / PartSet_WidgetSketchCreator.cpp
index 959179cc9d70702c1e60259cbb698bf027084357..14bfd60fa9aae8c043d831a3567219d51f086184 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2021  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
@@ -307,11 +307,17 @@ QIntList PartSet_WidgetSketchCreator::shapeTypes() const
 {
   QIntList aShapeTypes;
   if (myShapeTypes.length() > 1 && myIsUseChoice) {
-    aShapeTypes.append(ModuleBase_Tools::shapeType(myTypeCtrl->textValue()));
+    QStringList aTypes = myTypeCtrl->textValue().split("|", QString::SkipEmptyParts);
+    foreach(QString aType, aTypes) {
+      aShapeTypes.append(ModuleBase_Tools::shapeType(aType));
+    }
   }
   else {
     foreach(QString aType, myShapeTypes) {
-      aShapeTypes.append(ModuleBase_Tools::shapeType(aType));
+      QStringList aSubTypes = aType.split("|", QString::SkipEmptyParts);
+      foreach(QString asubType, aSubTypes) {
+        aShapeTypes.append(ModuleBase_Tools::shapeType(asubType));
+      }
     }
   }
   return aShapeTypes;
@@ -349,8 +355,6 @@ bool PartSet_WidgetSketchCreator::isSelectionMode() const
 bool PartSet_WidgetSketchCreator::hasSubObjects() const
 {
   bool aHasSubObjects = false;
-
-  bool aCanSetFocus = true;
   CompositeFeaturePtr aComposite = std::dynamic_pointer_cast<ModelAPI_CompositeFeature>(myFeature);
   if (aComposite.get())
     aHasSubObjects = aComposite->numberOfSubs() > 0;
@@ -440,7 +444,6 @@ bool PartSet_WidgetSketchCreator::startSketchOperation(
   }
   // manually deactivation because the widget was not activated as has no focus acceptin controls
   deactivate();
-  bool aHidePreview = myPreviewPlanes->isPreviewDisplayed();
   myPreviewPlanes->erasePreviewPlanes(myWorkshop);
 
   // start edit operation for the sketch
@@ -502,7 +505,6 @@ void PartSet_WidgetSketchCreator::onResumed(ModuleBase_Operation* theOp)
   AttributeSelectionListPtr anAttrList = myFeature->data()->selectionList(myAttributeListID);
   if (aCompFeature->numberOfSubs() > 0) {
     // set the sub feature to attribute selection list and check whether sketch is valid
-    SessionPtr aMgr = ModelAPI_Session::get();
     const static std::string aNestedOpID("Set Sketch result into Selection list");
     aMgr->startOperation(aNestedOpID, false); // false to not attach to Extrusion operation
     setSketchObjectToList(aCompFeature, anAttrList);
@@ -576,7 +578,6 @@ void PartSet_WidgetSketchCreator::onResumed(ModuleBase_Operation* theOp)
                                     (aData->attribute(SketchPlugin_SketchEntity::EXTERNAL_ID()));
       ResultPtr aRes = aSelAttr.get() ? aSelAttr->context() : ResultPtr();
       if (aRes.get()) {
-        SessionPtr aMgr = ModelAPI_Session::get();
         ModelAPI_ValidatorsFactory* aFactory = aMgr->validators();
         AttributePtr anAttribute = myFeature->attribute(anObjectsAttribute);
         std::string aValidatorID;