1 // Copyright (C) 2014-2019 CEA/DEN, EDF R&D
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 #include "PartSet_WidgetSketchCreator.h"
21 #include "PartSet_Module.h"
22 #include "PartSet_WidgetSketchLabel.h"
23 #include "PartSet_PreviewPlanes.h"
25 #include <Config_Keywords.h>
27 #include <XGUI_ModuleConnector.h>
28 #include <XGUI_Workshop.h>
29 #include <XGUI_Displayer.h>
30 #include <XGUI_SelectionMgr.h>
31 #include <XGUI_OperationMgr.h>
32 #include <XGUI_PropertyPanel.h>
33 #include <XGUI_Tools.h>
34 #include <XGUI_ViewerProxy.h>
36 #include <GeomAPI_Face.h>
38 #include <Events_InfoMessage.h>
40 #include <ModelAPI_Session.h>
41 #include <ModelAPI_ResultBody.h>
42 #include <ModelAPI_AttributeSelection.h>
43 #include <ModelAPI_AttributeSelectionList.h>
44 #include <ModelAPI_Validator.h>
45 #include <ModelAPI_Events.h>
46 #include <ModelAPI_ResultConstruction.h>
48 #include <SketchPlugin_SketchEntity.h>
49 #include <FeaturesPlugin_CompositeBoolean.h>
51 #include <ModuleBase_Tools.h>
52 #include <ModuleBase_Operation.h>
53 #include <ModuleBase_IPropertyPanel.h>
54 #include <ModuleBase_OperationFeature.h>
55 #include <ModuleBase_ViewerPrs.h>
56 #include <ModuleBase_ChoiceCtrl.h>
57 #include <ModuleBase_IWorkshop.h>
58 #include <ModuleBase_ISelectionActivate.h>
60 #include <Config_WidgetAPI.h>
62 #include <Events_Loop.h>
66 #include <QDoubleValidator>
67 //#include <QFormLayout>
68 #include <QVBoxLayout>
69 #include <QMessageBox>
70 #include <QMainWindow>
72 #define DEBUG_UNDO_INVALID_SKETCH
76 QStringList getIconsList(const QStringList& theNames)
79 foreach(QString aName, theNames) {
80 QString aUName = aName.toUpper();
81 if ((aUName == "VERTICES") || (aUName == "VERTEX"))
82 aIcons << ":pictures/vertex32.png";
83 else if ((aUName == "EDGES") || (aUName == "EDGE"))
84 aIcons << ":pictures/edge32.png";
85 else if ((aUName == "FACES") || (aUName == "FACE"))
86 aIcons << ":pictures/face32.png";
93 PartSet_WidgetSketchCreator::PartSet_WidgetSketchCreator(QWidget* theParent,
94 PartSet_Module* theModule,
95 const Config_WidgetAPI* theData)
96 : ModuleBase_WidgetSelector(theParent, theModule->workshop(), theData),
97 myModule(theModule), myIsCustomAttribute(false)
99 myAttributeListID = theData->getProperty("attribute_list_id");
101 //QFormLayout* aLayout = new QFormLayout(this);
102 QVBoxLayout* aLayout = new QVBoxLayout(this);
103 ModuleBase_Tools::zeroMargins(aLayout);
105 ModuleBase_Tools::adjustMargins(aLayout);
107 QString aLabelText = translate(theData->widgetLabel());
108 QString aLabelIcon = QString::fromStdString(theData->widgetIcon());
110 // Size of the View control
111 mySizeOfViewWidget = new QWidget(this);
112 QHBoxLayout* aSizeLayout = new QHBoxLayout(mySizeOfViewWidget);
113 aSizeLayout->addWidget(new QLabel(tr("Size of the view"), mySizeOfViewWidget));
114 mySizeOfView = new QLineEdit(mySizeOfViewWidget);
116 QDoubleValidator* aValidator = new QDoubleValidator(0, DBL_MAX, 12, mySizeOfView);
117 aValidator->setLocale(ModuleBase_Tools::doubleLocale());
118 aValidator->setNotation(QDoubleValidator::StandardNotation);
119 mySizeOfView->setValidator(aValidator);
120 aSizeLayout->addWidget(mySizeOfView);
122 myLabel = new QLabel(aLabelText, this);
123 myLabel->setWordWrap(true);
125 aLayout->addWidget(mySizeOfViewWidget);
126 aLayout->addWidget(myLabel);
128 std::string aTypes = theData->getProperty("shape_types");
129 myShapeTypes = QString(aTypes.c_str()).split(' ', QString::SkipEmptyParts);
130 myIsUseChoice = theData->getBooleanAttribute("use_choice", false);
131 QStringList aIconsList = getIconsList(myShapeTypes);
132 myTypeCtrl = new ModuleBase_ChoiceCtrl(this, myShapeTypes, aIconsList);
133 myTypeCtrl->setLabel(tr("Type"));
134 if (!myShapeTypes.empty()) {
135 std::string aDefType = theData->getProperty("default_type");
136 if (aDefType.size() > 0) {
138 int aId = QString(aDefType.c_str()).toInt(&aOk);
140 myTypeCtrl->setValue(aId);
141 myDefMode = myShapeTypes.at(aId).toStdString();
144 if (myDefMode.size() == 0) {
145 myTypeCtrl->setValue(0);
146 myDefMode = myShapeTypes.first().toStdString();
149 aLayout->addWidget(myTypeCtrl);
150 // There is no sense to parameterize list of types while we can not parameterize selection mode
151 // if the xml definition contains one type, the controls to select a type should not be shown
152 if (myShapeTypes.size() <= 1 || !myIsUseChoice) {
153 myTypeCtrl->setVisible(false);
155 connect(myTypeCtrl, SIGNAL(valueChanged(int)), this, SLOT(onSelectionTypeChanged()));
157 aLayout->addStretch(1);
158 myPreviewPlanes = new PartSet_PreviewPlanes();
161 PartSet_WidgetSketchCreator::~PartSet_WidgetSketchCreator()
163 // we need to deactivate here in order to hide preview planes if the selection mode is
168 QList<QWidget*> PartSet_WidgetSketchCreator::getControls() const
170 QList<QWidget*> aControls;
171 aControls.append(myLabel);
175 bool PartSet_WidgetSketchCreator::restoreValueCustom()
180 bool PartSet_WidgetSketchCreator::storeValueCustom()
185 AttributePtr PartSet_WidgetSketchCreator::attribute() const
187 AttributePtr anAttribute;
188 if (myIsCustomAttribute)
189 anAttribute = myFeature->attribute(myAttributeListID);
191 anAttribute = ModuleBase_WidgetSelector::attribute();
196 //********************************************************************
197 void PartSet_WidgetSketchCreator::openExtrusionTransaction()
199 SessionPtr aMgr = ModelAPI_Session::get();
200 bool aIsOp = aMgr->isOperation();
202 const static std::string aNestedOpID("Parameters modification");
203 aMgr->startOperation(aNestedOpID, true);
207 //********************************************************************
208 bool PartSet_WidgetSketchCreator::isValidSelection(const ModuleBase_ViewerPrsPtr& theValue)
211 if (myIsCustomAttribute) {
212 // check only suiting of the value to custom attribute (myAttributeListID)
213 // do not cash of validation to avoid using states, stored for XML attribute
214 // there is an alternative is to call clearValidatedCash() in setSelection()
215 aValid = isValidSelectionForAttribute(theValue, attribute());
217 else { /// if the validated attribute is already custom
218 if (getValidState(theValue, aValid)) {
221 aValid = isValidSelectionCustom(theValue);
223 // check selection to create new sketh (XML current attribute)
224 aValid = isValidSelectionForAttribute(theValue, attribute());
226 // check selection to fill list attribute (myAttributeListID)
227 bool isCustomAttribute = myIsCustomAttribute;
228 myIsCustomAttribute = true;
229 aValid = isValidSelectionForAttribute(theValue, attribute());
230 myIsCustomAttribute = isCustomAttribute;
233 storeValidState(theValue, aValid);
237 //********************************************************************
238 bool PartSet_WidgetSketchCreator::isValidSelectionCustom(const ModuleBase_ViewerPrsPtr& theValue)
240 return PartSet_WidgetSketchLabel::canFillSketch(theValue);
243 void PartSet_WidgetSketchCreator::activateSelectionControl()
245 // reset previously set size of view needed on restart extrusion after Sketch
246 if (myModule->sketchMgr()->previewSketchPlane()->isUseSizeOfView())
247 myModule->sketchMgr()->previewSketchPlane()->setSizeOfView(0, false);
249 // we need to call activate here as the widget has no focus accepted controls
250 // if these controls are added here, activate will happens automatically after focusIn()
251 XGUI_Workshop* aWorkshop = XGUI_Tools::workshop(myModule->workshop());
252 XGUI_PropertyPanel* aPanel = aWorkshop->propertyPanel();
253 aPanel->activateWidget(this, false);
256 void PartSet_WidgetSketchCreator::setVisibleSelectionControl(const bool theSelectionControl)
258 // hide current widget, activate the next widget
259 XGUI_Workshop* aWorkshop = XGUI_Tools::workshop(myModule->workshop());
260 XGUI_PropertyPanel* aPanel = aWorkshop->propertyPanel();
261 const QList<ModuleBase_ModelWidget*>& aWidgets = aPanel->modelWidgets();
262 foreach(ModuleBase_ModelWidget* aWidget, aWidgets) {
263 if (theSelectionControl) { // hide other controls
265 aWidget->setVisible(false);
267 else { // hide current control
269 aWidget->setVisible(false);
271 aWidget->setVisible(true);
272 if (aWidget->attributeID() == myAttributeListID)
273 setEnabledModelWidget(aWidget, !hasSubObjects());
278 if (theSelectionControl) {
279 bool aBodyIsVisualized = myPreviewPlanes->hasVisualizedBodies(myWorkshop);
280 bool aSketchIsVisualized = myPreviewPlanes->hasVisualizedSketch(myWorkshop);
281 if (!aBodyIsVisualized && !aSketchIsVisualized) {
282 // We have to select a plane before any operation
283 myPreviewPlanes->showPreviewPlanes(myWorkshop);
284 mySizeOfViewWidget->setVisible(true);
287 mySizeOfViewWidget->setVisible(false);
291 bool aHidePreview = myPreviewPlanes->isPreviewDisplayed();
292 myPreviewPlanes->erasePreviewPlanes(myWorkshop);
294 aWorkshop->viewer()->update();
298 QIntList PartSet_WidgetSketchCreator::shapeTypes() const
300 QIntList aShapeTypes;
301 if (myShapeTypes.length() > 1 && myIsUseChoice) {
302 aShapeTypes.append(ModuleBase_Tools::shapeType(myTypeCtrl->textValue()));
305 foreach(QString aType, myShapeTypes) {
306 aShapeTypes.append(ModuleBase_Tools::shapeType(aType));
312 void PartSet_WidgetSketchCreator::setEditingMode(bool isEditing)
314 ModuleBase_ModelWidget::setEditingMode(isEditing);
316 setVisibleSelectionControl(false);
318 ModuleBase_ModelWidget* anAttributeListWidget = 0;
319 XGUI_Workshop* aWorkshop = XGUI_Tools::workshop(myModule->workshop());
320 XGUI_PropertyPanel* aPanel = aWorkshop->propertyPanel();
321 const QList<ModuleBase_ModelWidget*>& aWidgets = aPanel->modelWidgets();
322 foreach(ModuleBase_ModelWidget* aWidget, aWidgets) {
323 if (aWidget->attributeID() == myAttributeListID) {
324 anAttributeListWidget = aWidget;
328 if (anAttributeListWidget)
329 setEnabledModelWidget(anAttributeListWidget, !hasSubObjects());
333 bool PartSet_WidgetSketchCreator::isSelectionMode() const
335 AttributeSelectionListPtr anAttrList = myFeature->data()->selectionList(myAttributeListID);
336 bool aHasValueInList = anAttrList.get() && anAttrList->size() > 0;
338 return !aHasValueInList;
341 bool PartSet_WidgetSketchCreator::hasSubObjects() const
343 bool aHasSubObjects = false;
345 bool aCanSetFocus = true;
346 CompositeFeaturePtr aComposite = std::dynamic_pointer_cast<ModelAPI_CompositeFeature>(myFeature);
347 if (aComposite.get())
348 aHasSubObjects = aComposite->numberOfSubs() > 0;
349 return aHasSubObjects;
352 bool PartSet_WidgetSketchCreator::setSelection(QList<ModuleBase_ViewerPrsPtr>& theValues,
353 const bool theToValidate)
356 if (!startSketchOperation(theValues)) {
357 myIsCustomAttribute = true;
358 QList<ModuleBase_ViewerPrsPtr>::const_iterator
359 anIt = theValues.begin(), aLast = theValues.end();
360 bool aProcessed = false;
361 for (; anIt != aLast; anIt++) {
362 ModuleBase_ViewerPrsPtr aValue = *anIt;
363 if (!theToValidate || isValidInFilters(aValue))
364 aProcessed = setSelectionCustom(aValue) || aProcessed;
366 myIsCustomAttribute = false;
369 emit valuesChanged();
370 updateObject(myFeature);
371 setVisibleSelectionControl(false);
372 // manually deactivation because the widget was
373 // not activated as has no focus acceptin controls
375 emit focusOutWidget(this);
381 //********************************************************************
382 bool PartSet_WidgetSketchCreator::processSelection()
384 QList<ModuleBase_ViewerPrsPtr> aSelected = getFilteredSelected();
385 bool isDone = setSelection(aSelected, true/*false*/);
390 //********************************************************************
391 void PartSet_WidgetSketchCreator::updateOnSelectionChanged(const bool theDone)
395 bool PartSet_WidgetSketchCreator::startSketchOperation(
396 const QList<ModuleBase_ViewerPrsPtr>& theValues)
398 bool aSketchStarted = false;
400 if (theValues.size() != 1)
401 return aSketchStarted;
403 ModuleBase_ViewerPrsPtr aValue = theValues.front();
404 if (!aValue.get() || !PartSet_WidgetSketchLabel::canFillSketch(aValue))
405 return aSketchStarted;
407 ResultPtr aResult = std::dynamic_pointer_cast<ModelAPI_Result>(aValue->object());
408 /// sketch should not started by object(face) selected as global. If Local face is selected,
409 /// sketch is started
410 if (aResult.get() && aValue->shape().get() && aResult->shape()->isEqual(aValue->shape())) {
411 ResultConstructionPtr aConstruction =
412 std::dynamic_pointer_cast<ModelAPI_ResultConstruction>(aResult);
413 if (!aConstruction.get() || !aConstruction->isInfinite())
414 return aSketchStarted;
416 aSketchStarted = true;
417 // Set View size if a plane is selected
418 if (myPreviewPlanes->isPreviewDisplayed() &&
419 myPreviewPlanes->isPreviewShape(aValue->shape())) {
420 // set default plane size
421 bool isSetSizeOfView = false;
422 double aSizeOfView = 0;
423 QString aSizeOfViewStr = mySizeOfView->text();
424 if (!aSizeOfViewStr.isEmpty()) {
425 aSizeOfView = aSizeOfViewStr.toDouble(&isSetSizeOfView);
426 if (isSetSizeOfView && aSizeOfView <= 0) {
427 isSetSizeOfView = false;
431 myModule->sketchMgr()->previewSketchPlane()->setSizeOfView(aSizeOfView, true);
433 // manually deactivation because the widget was not activated as has no focus acceptin controls
435 bool aHidePreview = myPreviewPlanes->isPreviewDisplayed();
436 myPreviewPlanes->erasePreviewPlanes(myWorkshop);
438 // start edit operation for the sketch
439 ModuleBase_OperationFeature* aFOperation = dynamic_cast<ModuleBase_OperationFeature*>
440 (myModule->createOperation("Sketch"));
441 QList<ModuleBase_ViewerPrsPtr> aValues;
442 aValues.push_back(aValue);
443 aFOperation->setPreselection(aValues);
445 myWorkshop->processLaunchOperation(aFOperation);
447 return aSketchStarted;
450 bool PartSet_WidgetSketchCreator::focusTo()
452 // this method is called only in creation mode. In Edition mode this widget is hidden
453 if (isSelectionMode() && !hasSubObjects()) {
454 setVisibleSelectionControl(true);
455 activateSelectionControl();
456 openExtrusionTransaction();
460 connect(myModule, SIGNAL(resumed(ModuleBase_Operation*)),
461 SLOT(onResumed(ModuleBase_Operation*)));
466 void PartSet_WidgetSketchCreator::deactivate()
468 ModuleBase_WidgetSelector::deactivate();
470 bool aHidePreview = myPreviewPlanes->isPreviewDisplayed();
471 myPreviewPlanes->erasePreviewPlanes(myWorkshop);
473 XGUI_Tools::workshop(myWorkshop)->viewer()->update();
477 void PartSet_WidgetSketchCreator::onResumed(ModuleBase_Operation* theOp)
479 SessionPtr aMgr = ModelAPI_Session::get();
480 bool aIsOp = aMgr->isOperation();
482 // in current implementation, all transactions are closed when resume happens
483 // so, this is a wrong case, which is not checked.
484 // To provide it, make correction in later rows about abort/undo transactions
487 // Set visible only selection control
488 setVisibleSelectionControl(true);
490 // Validate the created sketch. If it is valid, it is set into the composite feature selection
491 // list, otherwise it is removed
492 CompositeFeaturePtr aCompFeature =
493 std::dynamic_pointer_cast<ModelAPI_CompositeFeature>(myFeature);
494 AttributeSelectionListPtr anAttrList = myFeature->data()->selectionList(myAttributeListID);
495 if (aCompFeature->numberOfSubs() > 0) {
496 // set the sub feature to attribute selection list and check whether sketch is valid
497 SessionPtr aMgr = ModelAPI_Session::get();
498 const static std::string aNestedOpID("Set Sketch result into Selection list");
499 aMgr->startOperation(aNestedOpID, false); // false to not attach to Extrusion operation
500 setSketchObjectToList(aCompFeature, anAttrList);
501 aMgr->finishOperation();
503 if (!validateSelectionList()) {
504 #ifdef DEBUG_UNDO_INVALID_SKETCH
505 aMgr->undo(); // Extrusion modification parameters: setSketchObjectToList()
506 aMgr->undo(); /// Sketch creation
508 aMgr->startOperation("Delete invalid Sketch feature", false);
510 // delete invalid sketch
511 CompositeFeaturePtr aSketchFeature =
512 std::dynamic_pointer_cast<ModelAPI_CompositeFeature>(aCompFeature->subFeature(0));
513 QObjectPtrList anObjects;
514 anObjects.append(aSketchFeature);
516 XGUI_Workshop* aWorkshop = XGUI_Tools::workshop(myModule->workshop());
517 aWorkshop->deleteFeatures(anObjects);
519 aMgr->finishOperation();
523 openExtrusionTransaction();
525 if (aCompFeature->numberOfSubs() == 0) {
526 // call activateWidget() of the parent to connect to the viewer seleciton
527 activateSelectionControl();
530 // check if the created sketch is valid. If it is invalid, it will be deleted with warning else
531 /// the attribute selection list will be filled by result of this sketch.
532 setVisibleSelectionControl(false);
534 // Update value in attribute selection list
535 XGUI_Workshop* aWorkshop = XGUI_Tools::workshop(myModule->workshop());
536 XGUI_PropertyPanel* aPropertyPanel = aWorkshop->propertyPanel();
537 const QList<ModuleBase_ModelWidget*>& aWidgets = aPropertyPanel->modelWidgets();
538 ModuleBase_ModelWidget* aListWidget = 0;
539 foreach(ModuleBase_ModelWidget* aWidget, aWidgets) {
540 if (aWidget->attributeID() == myAttributeListID) {
541 aListWidget = aWidget;
546 aListWidget->restoreValue();
547 aPropertyPanel->activateNextWidget(aListWidget);
550 // Hide sketcher result
551 CompositeFeaturePtr aSketchFeature =
552 std::dynamic_pointer_cast<ModelAPI_CompositeFeature>(aCompFeature->subFeature(0));
553 std::list<ResultPtr> aResults = aSketchFeature->results();
554 std::list<ResultPtr>::const_iterator aIt;
555 for (aIt = aResults.begin(); aIt != aResults.end(); ++aIt) {
556 (*aIt)->setDisplayed(false);
558 aSketchFeature->setDisplayed(false);
559 static Events_Loop* aLoop = Events_Loop::loop();
560 aLoop->flush(aLoop->eventByName(EVENT_OBJECT_TO_REDISPLAY));
562 // Add Selected body were created the sketcher to list of selected objects
563 std::string anObjectsAttribute = FeaturesPlugin_CompositeBoolean::OBJECTS_ID();
564 AttributeSelectionListPtr aSelList = aCompFeature->data()->selectionList(anObjectsAttribute);
565 if (aSelList.get()) {
566 DataPtr aData = aSketchFeature->data();
567 AttributeSelectionPtr aSelAttr = std::dynamic_pointer_cast<ModelAPI_AttributeSelection>
568 (aData->attribute(SketchPlugin_SketchEntity::EXTERNAL_ID()));
569 ResultPtr aRes = aSelAttr.get() ? aSelAttr->context() : ResultPtr();
571 SessionPtr aMgr = ModelAPI_Session::get();
572 ModelAPI_ValidatorsFactory* aFactory = aMgr->validators();
573 AttributePtr anAttribute = myFeature->attribute(anObjectsAttribute);
574 std::string aValidatorID;
575 Events_InfoMessage anError;
576 aSelList->append(aRes, GeomShapePtr());
577 if (aFactory->validate(anAttribute, aValidatorID, anError))
578 updateObject(aCompFeature);
587 bool PartSet_WidgetSketchCreator::validateSelectionList() const
589 AttributeSelectionListPtr anAttrList = myFeature->data()->selectionList(myAttributeListID);
591 SessionPtr aMgr = ModelAPI_Session::get();
592 ModelAPI_ValidatorsFactory* aFactory = aMgr->validators();
593 std::string aValidatorID;
594 Events_InfoMessage anError;
595 bool isValidPComposite = aFactory->validate(anAttrList, aValidatorID, anError);
596 if (!isValidPComposite) {
597 XGUI_Workshop* aWorkshop = XGUI_Tools::workshop(myModule->workshop());
598 // TODO(spo): translate
599 QMessageBox::question(aWorkshop->desktop(), tr("Apply current feature"),
600 tr("Sketch is invalid and will be deleted.\nError: %1")
601 .arg(anError.messageString().c_str()),
604 return isValidPComposite;
607 void PartSet_WidgetSketchCreator::setSketchObjectToList(
608 const CompositeFeaturePtr& theCompositeFeature,
609 const AttributePtr& theAttribute)
611 if (!theCompositeFeature.get() || theCompositeFeature->numberOfSubs() != 1)
614 AttributeSelectionListPtr aBaseObjectsSelectionList =
615 std::dynamic_pointer_cast<ModelAPI_AttributeSelectionList>(theAttribute);
616 if(!aBaseObjectsSelectionList.get() || aBaseObjectsSelectionList->isInitialized()) {
620 FeaturePtr aSketchFeature = theCompositeFeature->subFeature(0);
621 if(!aSketchFeature.get() || aSketchFeature->results().empty()) {
625 ResultPtr aSketchRes = aSketchFeature->results().front();
626 ResultConstructionPtr aConstruction =
627 std::dynamic_pointer_cast<ModelAPI_ResultConstruction>(aSketchRes);
628 if(!aConstruction.get()) {
632 if(aBaseObjectsSelectionList->size() == 0) {
633 aBaseObjectsSelectionList->append(aSketchRes, GeomShapePtr());
637 void PartSet_WidgetSketchCreator::setEnabledModelWidget(ModuleBase_ModelWidget* theModelWidget,
638 const bool theEnabled)
640 QList<QWidget*> aMyControls = theModelWidget->getControls();
641 foreach(QWidget* eachControl, aMyControls) {
642 eachControl->setEnabled(theEnabled);
646 void PartSet_WidgetSketchCreator::onSelectionTypeChanged()
648 // Clear current selection in order to avoid updating of object browser with obsolete indexes
649 // which can appear because of results deletetion after changing a type of selection
650 QString aSelectionType = myTypeCtrl->textValue();
651 QList<ModuleBase_ViewerPrsPtr> aEmptyList;
652 myWorkshop->setSelected(aEmptyList);
654 updateSelectionModesAndFilters(true);
655 myWorkshop->selectionActivate()->updateSelectionModes();
660 if (aSelectionType != "Faces") {
661 setVisibleSelectionControl(false);
662 myWorkshop->propertyPanel()->activateNextWidget();
665 /// store the selected type
666 AttributeSelectionListPtr anAttrList = myFeature->data()->selectionList(myAttributeListID);
667 anAttrList->setSelectionType(aSelectionType.toStdString());
670 // update object is necessary to flush update signal. It leads to objects references map update
671 // and the operation presentation will not contain deleted items visualized as parameters of
673 updateObject(myFeature);
674 myWorkshop->propertyPanel()->activeWidget()->restoreValue();
675 myWorkshop->setSelected(getAttributeSelection());
676 // may be the feature's result is not displayed, but attributes should be
677 // hope that something is redisplayed by object updated
678 myWorkshop->module()->customizeFeature(myFeature, ModuleBase_IModule::CustomizeArguments, true);