From: vsv Date: Wed, 23 Sep 2020 15:37:37 +0000 (+0300) Subject: bos #20090: Can't select external wire of a sketch X-Git-Tag: V9_6_0a1~2 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=b4dc47afe796ac81456fbe94f1a541f674a79682;p=modules%2Fshaper.git bos #20090: Can't select external wire of a sketch --- diff --git a/src/FeaturesPlugin/extrusion_widget.xml b/src/FeaturesPlugin/extrusion_widget.xml index 94a9d4bc3..df1631146 100644 --- a/src/FeaturesPlugin/extrusion_widget.xml +++ b/src/FeaturesPlugin/extrusion_widget.xml @@ -5,7 +5,7 @@ 1. Planar face of non-sketch object or a plane. Sketch creation will be started.<br /> 2. An existing sketch face or contour. Extrusion will be filled by it.<br /> 3. An existing result shape of kind: wires/edge/vertices. Extrusion will be filled by it." - shape_types="Vertices Edges Faces" + shape_types="Vertices Edges Faces|Wires" type_icons=":/icons/extrusion_vertex32.png :/icons/extrusion_edge32.png :/icons/extrusion_face32.png" default_type = "2" use_choice="true"> @@ -14,7 +14,7 @@ @@ -16,7 +16,7 @@ label="Select a sketch face" icon="icons/Features/sketch.png" tooltip="Select a sketch face" - shape_types="Vertices Edges Faces" + shape_types="Vertices Edges Faces|Wire" type_icons=":/icons/extrusion_vertex32.png :/icons/extrusion_edge32.png :/icons/extrusion_face32.png" default_type = "2" use_choice="true" diff --git a/src/ModuleBase/ModuleBase_WidgetMultiSelector.cpp b/src/ModuleBase/ModuleBase_WidgetMultiSelector.cpp index 21df54023..bb5c6e39d 100644 --- a/src/ModuleBase/ModuleBase_WidgetMultiSelector.cpp +++ b/src/ModuleBase/ModuleBase_WidgetMultiSelector.cpp @@ -352,7 +352,7 @@ bool ModuleBase_WidgetMultiSelector::restoreValueCustom() if (aSelectionType.empty()) aSelectionListAttr->setSelectionType(myDefMode); else { - setCurrentShapeType(ModuleBase_Tools::shapeType(aSelectionType.c_str())); + setCurrentShapeType(aSelectionType.c_str()); myDefMode = aSelectionType; myIsFirst = false; } @@ -752,23 +752,28 @@ QIntList ModuleBase_WidgetMultiSelector::shapeTypes() const QIntList aShapeTypes; if (myShapeTypes.length() > 1 && myIsUseChoice) { - aShapeTypes.append(ModuleBase_Tools::shapeType(myTypeCtrl->textValue())); + QStringList aTypes = myTypeCtrl->textValue().split("|", QString::SkipEmptyParts); + for(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); + for(QString aSubType: aSubTypes) { + aShapeTypes.append(ModuleBase_Tools::shapeType(aSubType)); + } } } return aShapeTypes; } //******************************************************************** -void ModuleBase_WidgetMultiSelector::setCurrentShapeType(const int theShapeType) +void ModuleBase_WidgetMultiSelector::setCurrentShapeType(const QString& theShapeType) { int idx = 0; foreach (QString aShapeTypeName, myShapeTypes) { - int aRefType = ModuleBase_Tools::shapeType(aShapeTypeName); - if(aRefType == theShapeType && idx != myTypeCtrl->value()) { + if(aShapeTypeName == theShapeType && idx != myTypeCtrl->value()) { updateSelectionModesAndFilters(false); bool isBlocked = myTypeCtrl->blockSignals(true); myTypeCtrl->setValue(idx); diff --git a/src/ModuleBase/ModuleBase_WidgetMultiSelector.h b/src/ModuleBase/ModuleBase_WidgetMultiSelector.h index 8e788d655..946b46d77 100644 --- a/src/ModuleBase/ModuleBase_WidgetMultiSelector.h +++ b/src/ModuleBase/ModuleBase_WidgetMultiSelector.h @@ -182,7 +182,7 @@ protected: virtual QIntList shapeTypes() const; /// Set current shape type for selection - void setCurrentShapeType(const int theShapeType); + void setCurrentShapeType(const QString& theShapeType); /// Return the attribute values wrapped in a list of viewer presentations /// \return a list of viewer presentations, which contains an attribute result and diff --git a/src/PartSet/PartSet_WidgetSketchCreator.cpp b/src/PartSet/PartSet_WidgetSketchCreator.cpp index 3fe190981..6d570d985 100644 --- a/src/PartSet/PartSet_WidgetSketchCreator.cpp +++ b/src/PartSet/PartSet_WidgetSketchCreator.cpp @@ -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;