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 "ModuleBase_WidgetSelectionFilter.h"
21 #include "ModuleBase_Tools.h"
22 #include "ModuleBase_IWorkshop.h"
23 #include "ModuleBase_ISelectionActivate.h"
24 #include "ModuleBase_IModule.h"
25 #include "ModuleBase_IViewer.h"
26 #include "ModuleBase_IPropertyPanel.h"
27 #include "ModuleBase_PageWidget.h"
28 #include "ModuleBase_WidgetMultiSelector.h"
29 #include "ModuleBase_ResultPrs.h"
30 #include "ModuleBase_WidgetFactory.h"
32 #include <ModelAPI_Session.h>
33 #include <ModelAPI_AttributeSelectionList.h>
34 #include <ModelAPI_Events.h>
35 #include <ModelAPI_FiltersFactory.h>
36 #include <ModelAPI_ResultBody.h>
37 #include <GeomAPI_ShapeExplorer.h>
39 #include <Events_Loop.h>
40 #include <Config_ValidatorReader.h>
42 #include <AIS_InteractiveContext.hxx>
43 #include <StdSelect_BRepOwner.hxx>
44 #include <TopoDS_Compound.hxx>
45 #include <BRep_Builder.hxx>
48 #include <QPushButton>
53 #include <QToolButton>
56 static FeaturePtr SelectorFeature;
57 static std::string AttributeId;
60 GeomAPI_Shape::ShapeType selectionType(const QString& theType)
62 QString aType = theType.toUpper();
63 if ((aType == "VERTEX") || (aType == "VERTICES"))
64 return GeomAPI_Shape::VERTEX;
65 else if ((aType == "EDGE") || (aType == "EDGES"))
66 return GeomAPI_Shape::EDGE;
67 else if ((aType == "WIRE") || (aType == "WIRES"))
68 return GeomAPI_Shape::WIRE;
69 else if ((aType == "FACE") || (aType == "FACES"))
70 return GeomAPI_Shape::FACE;
71 else if ((aType == "SHELL") || (aType == "SHELLS"))
72 return GeomAPI_Shape::SHELL;
73 else if ((aType == "SOLID") || (aType == "SOLIDS"))
74 return GeomAPI_Shape::SOLID;
75 else if ((aType == "COMPSOLID") || (aType == "COMPSOLIDS"))
76 return GeomAPI_Shape::COMPSOLID;
77 else if ((aType == "COMPOUND") || (aType == "COMPOUNDS"))
78 return GeomAPI_Shape::COMPOUND;
80 return GeomAPI_Shape::SHAPE;
84 ModuleBase_FilterStarter::ModuleBase_FilterStarter(const std::string& theFeature,
85 QWidget* theParent, ModuleBase_IWorkshop* theWorkshop)
87 myFeatureName(theFeature),
88 myWorkshop(theWorkshop)
90 QHBoxLayout* aMainLayout = new QHBoxLayout(this);
91 ModuleBase_Tools::adjustMargins(aMainLayout);
93 aMainLayout->addStretch(1);
94 QPushButton* aLaunchBtn = new QPushButton(tr("Selection by filters"), this);
95 connect(aLaunchBtn, SIGNAL(clicked()), SLOT(onFiltersLaunch()));
96 aMainLayout->addWidget(aLaunchBtn);
99 void ModuleBase_FilterStarter::onFiltersLaunch()
101 ModuleBase_Operation* aParentOp = myWorkshop->currentOperation();
102 ModuleBase_OperationFeature* aFeatureOp = dynamic_cast<ModuleBase_OperationFeature*>(aParentOp);
104 // Open transaction on filters operation finish
105 aFeatureOp->openTransactionOnResume();
107 QWidget* aParent = parentWidget();
108 ModuleBase_WidgetMultiSelector* aSelector =
109 dynamic_cast<ModuleBase_WidgetMultiSelector*>(aParent);
111 aParent = aParent->parentWidget();
112 aSelector = dynamic_cast<ModuleBase_WidgetMultiSelector*>(aParent);
116 SelectorFeature = aSelector->feature();
117 AttributeId = aSelector->attributeID();
119 // Launch Filters operation
120 ModuleBase_OperationFeature* aFOperation = dynamic_cast<ModuleBase_OperationFeature*>
121 (myWorkshop->module()->createOperation(myFeatureName));
123 AttributeSelectionListPtr aAttrList = SelectorFeature->selectionList(AttributeId);
124 FiltersFeaturePtr aFilters = aAttrList->filters();
126 aFOperation->setFeature(aFilters);
127 myWorkshop->processLaunchOperation(aFOperation);
130 //*****************************************************************************
131 //*****************************************************************************
132 //*****************************************************************************
133 ModuleBase_FilterItem::ModuleBase_FilterItem(
134 const std::string& theFilter, ModuleBase_WidgetSelectionFilter* theParent)
135 : QWidget(theParent->filtersWidget()), myFilterID(theFilter),
136 mySelection(std::dynamic_pointer_cast<ModelAPI_FiltersFeature>(theParent->feature()))
138 std::string aXmlString = ModelAPI_Session::get()->filters()->filter(theFilter)->xmlRepresentation();
139 if (aXmlString.length() == 0)
142 ModuleBase_WidgetFactory aFactory(aXmlString, theParent->workshop());
143 Config_ValidatorReader aValidatorReader(aXmlString, true);
144 aValidatorReader.setFeatureId(mySelection->getKind());
145 aValidatorReader.readAll();
147 QVBoxLayout* aLayout = new QVBoxLayout(this);
148 ModuleBase_Tools::zeroMargins(aLayout);
150 QWidget* aItemRow = new QWidget(this);
151 addItemRow(aItemRow);
152 aLayout->addWidget(aItemRow);
154 ModuleBase_PageWidget* aParamsWgt = new ModuleBase_PageWidget(this);
155 aParamsWgt->setFrameStyle(QFrame::Box | QFrame::Raised);
156 aFactory.createWidget(aParamsWgt);
157 ModuleBase_Tools::zeroMargins(aParamsWgt->layout());
158 myWidgets = aFactory.getModelWidgets();
159 foreach(ModuleBase_ModelWidget* aWidget, myWidgets) {
160 aWidget->setFeature(theParent->feature());
161 connect(aWidget, SIGNAL(focusInWidget(ModuleBase_ModelWidget*)),
162 theParent, SIGNAL(focusInWidget(ModuleBase_ModelWidget*)));
163 connect(aWidget, SIGNAL(focusOutWidget(ModuleBase_ModelWidget*)),
164 theParent, SIGNAL(focusOutWidget(ModuleBase_ModelWidget*)));
165 connect(aWidget, SIGNAL(objectUpdated()), theParent, SLOT(onObjectUpdated()));
167 aLayout->addWidget(aParamsWgt);
171 void ModuleBase_FilterItem::addItemRow(QWidget* theParent)
173 QHBoxLayout* aLayout = new QHBoxLayout(theParent);
174 ModuleBase_Tools::zeroMargins(aLayout);
176 // Reverse filter button
177 myRevBtn = new QToolButton(theParent);
178 myRevBtn->setCheckable(true);
179 bool isReversed = mySelection->isReversed(myFilterID);
180 myRevBtn->setChecked(isReversed);
181 myRevBtn->setAutoRaise(true);
183 myRevBtn->setIcon(QIcon(":pictures/reverce.png"));
185 myRevBtn->setIcon(QIcon(":pictures/add.png"));
186 myRevBtn->setToolTip(tr("Reverse the filter"));
187 connect(myRevBtn, SIGNAL(toggled(bool)), SLOT(onReverse(bool)));
188 aLayout->addWidget(myRevBtn);
190 const std::string& aFilterName = ModelAPI_Session::get()->filters()->filter(myFilterID)->name();
191 aLayout->addWidget(new QLabel(aFilterName.c_str(), theParent), 1);
193 QToolButton* aDelBtn = new QToolButton(theParent);
194 aDelBtn->setIcon(QIcon(":pictures/delete.png"));
195 aDelBtn->setAutoRaise(true);
196 aDelBtn->setToolTip(tr("Delete the filter"));
197 connect(aDelBtn, SIGNAL(clicked(bool)), SLOT(onDelete()));
198 aLayout->addWidget(aDelBtn);
201 void ModuleBase_FilterItem::onReverse(bool theCheck)
203 mySelection->setReversed(myFilterID, theCheck);
205 myRevBtn->setIcon(QIcon(":pictures/reverce.png"));
207 myRevBtn->setIcon(QIcon(":pictures/add.png"));
208 emit reversedItem(this);
211 void ModuleBase_FilterItem::onDelete()
213 emit deleteItem(this);
216 QList<QWidget*> ModuleBase_FilterItem::getControls() const
218 QList<QWidget*> aWidgetsList;
219 foreach(ModuleBase_ModelWidget* aWgt, myWidgets) {
220 QList<QWidget*> aSubList = aWgt->getControls();
221 foreach(QWidget* aSub, aSubList) {
222 aWidgetsList.append(aSub);
229 //*****************************************************************************
230 //*****************************************************************************
231 //*****************************************************************************
232 ModuleBase_WidgetSelectionFilter::ModuleBase_WidgetSelectionFilter(QWidget* theParent,
233 ModuleBase_IWorkshop* theWorkshop, const Config_WidgetAPI* theData)
234 : ModuleBase_ModelWidget(theParent, theData),
235 myWorkshop(theWorkshop),
236 mySelectorFeature(SelectorFeature),
237 mySelectorAttribute(AttributeId)
239 // Clear Old selection
240 AttributeSelectionListPtr aAttrList = mySelectorFeature->selectionList(mySelectorAttribute);
241 mySelectionType = selectionType(aAttrList->selectionType().c_str());
245 QVBoxLayout* aMainLayout = new QVBoxLayout(this);
246 ModuleBase_Tools::adjustMargins(aMainLayout);
248 QGroupBox* aFiltersGroup = new QGroupBox(tr("Filters"), this);
249 QVBoxLayout* aGroupLayout = new QVBoxLayout(aFiltersGroup);
250 aGroupLayout->setContentsMargins(0, 0, 0, 0);
251 aGroupLayout->setSpacing(0);
253 myFiltersWgt = new QWidget();
254 myFiltersLayout = new QVBoxLayout(myFiltersWgt);
255 myFiltersLayout->setContentsMargins(0, 0, 0, 0);
256 aGroupLayout->addWidget(myFiltersWgt);
258 myFiltersCombo = new QComboBox(aFiltersGroup);
259 myFiltersCombo->addItem(tr("Add new filter..."));
260 SessionPtr aSession = ModelAPI_Session::get();
261 std::list<FilterPtr> allFilters =
262 aSession->filters()->filters((GeomAPI_Shape::ShapeType) mySelectionType);
264 std::list<FilterPtr>::const_iterator aIt;
265 for (aIt = allFilters.cbegin(); aIt != allFilters.cend(); aIt++) {
266 aItems.push_back((*aIt)->name().c_str());
267 myFilters.push_back(aSession->filters()->id(*aIt));
269 myFiltersCombo->addItems(aItems);
270 connect(myFiltersCombo, SIGNAL(currentIndexChanged(int)), SLOT(onAddFilter(int)));
272 aGroupLayout->addWidget(myFiltersCombo);
273 aMainLayout->addWidget(aFiltersGroup);
276 QWidget* aBtnWgt = new QWidget(this);
277 QHBoxLayout* aBtnLayout = new QHBoxLayout(aBtnWgt);
278 ModuleBase_Tools::adjustMargins(aBtnLayout);
280 aBtnLayout->addStretch(1);
282 mySelectBtn = new QPushButton(tr("Select"), aBtnWgt);
283 connect(mySelectBtn, SIGNAL(clicked()), SLOT(onSelect()));
284 aBtnLayout->addWidget(mySelectBtn);
286 aMainLayout->addWidget(aBtnWgt);
289 QWidget* aLblWgt = new QWidget(this);
290 QHBoxLayout* aLblLayout = new QHBoxLayout(aLblWgt);
291 ModuleBase_Tools::zeroMargins(aLblLayout);
293 aLblLayout->addWidget(new QLabel(tr("Number of selected objects:"), aLblWgt));
295 myNbLbl = new QLabel("0", aLblWgt);
296 aLblLayout->addWidget(myNbLbl);
299 myShowBtn = new QCheckBox(tr("Show only"), this);
300 connect(myShowBtn, SIGNAL(toggled(bool)), SLOT(onShowOnly(bool)));
301 aLblLayout->addWidget(myShowBtn);
303 aMainLayout->addWidget(aLblWgt);
305 aMainLayout->addStretch(1);
310 ModuleBase_WidgetSelectionFilter::~ModuleBase_WidgetSelectionFilter()
313 if (!myPreview.IsNull()) {
314 Handle(AIS_InteractiveContext) aCtx = myWorkshop->viewer()->AISContext();
315 aCtx->Remove(myPreview, false);
317 if (myShowBtn->isChecked()) {
318 AIS_ListOfInteractive::const_iterator aIt;
319 Handle(AIS_Shape) aShapeIO;
320 for (aIt = myListIO.cbegin(); aIt != myListIO.cend(); aIt++) {
321 aShapeIO = Handle(AIS_Shape)::DownCast(*aIt);
322 if (!aShapeIO.IsNull()) {
323 aCtx->Display(aShapeIO, false);
327 aCtx->UpdateCurrentViewer();
329 SelectorFeature = FeaturePtr();
333 void ModuleBase_WidgetSelectionFilter::onAddFilter(int theIndex)
338 std::list<std::string>::iterator aIt;
341 for (aIt = myFilters.begin(), i = 0; aIt != myFilters.cend(); i++, aIt++) {
342 if (i == (theIndex - 1)) {
347 onAddFilter(aFilter);
348 FiltersFeaturePtr aFiltersFeature =
349 std::dynamic_pointer_cast<ModelAPI_FiltersFeature>(myFeature);
350 aFiltersFeature->addFilter(aFilter);
352 myFiltersCombo->setCurrentIndex(0);
353 myFiltersCombo->removeItem(theIndex);
354 updateObject(myFeature);
357 void ModuleBase_WidgetSelectionFilter::onAddFilter(const std::string& theFilter)
359 if (theFilter.length() == 0)
361 std::list<std::string>::const_iterator aIt;
362 for (aIt = myUseFilters.cbegin(); aIt != myUseFilters.cend(); aIt++) {
363 if (theFilter == (*aIt))
366 myFilters.remove(theFilter);
367 myUseFilters.push_back(theFilter);
368 ModuleBase_FilterItem* aItem = new ModuleBase_FilterItem(theFilter, this);
369 connect(aItem, SIGNAL(deleteItem(ModuleBase_FilterItem*)),
370 SLOT(onDeleteItem(ModuleBase_FilterItem*)));
371 connect(aItem, SIGNAL(reversedItem(ModuleBase_FilterItem*)),
372 SLOT(onReverseItem(ModuleBase_FilterItem*)));
373 myFiltersLayout->addWidget(aItem);
376 clearCurrentSelection(true);
377 updateNumberSelected();
380 void ModuleBase_WidgetSelectionFilter::onDeleteItem(ModuleBase_FilterItem* theItem)
382 std::string aFilter = theItem->filter();
383 QList<ModuleBase_ModelWidget*> aWidgets = theItem->widgets();
384 foreach(ModuleBase_ModelWidget* aWgt, aWidgets) {
387 myFiltersLayout->removeWidget(theItem);
388 theItem->deleteLater();
390 myUseFilters.remove(aFilter);
391 myFilters.push_back(aFilter);
392 myFiltersCombo->addItem(ModelAPI_Session::get()->filters()->filter(aFilter)->name().c_str());
394 FiltersFeaturePtr aFiltersFeature =
395 std::dynamic_pointer_cast<ModelAPI_FiltersFeature>(myFeature);
396 aFiltersFeature->removeFilter(aFilter);
399 clearCurrentSelection(true);
400 updateNumberSelected();
402 myWorkshop->deactivateCurrentSelector();
403 myWorkshop->selectionActivate()->updateSelectionModes();
404 myWorkshop->selectionActivate()->updateSelectionFilters();
406 myFiltersCombo->setFocus();
407 updateObject(myFeature);
411 void ModuleBase_WidgetSelectionFilter::redisplayFeature()
413 static Events_ID aDispEvent = Events_Loop::loop()->eventByName(EVENT_OBJECT_TO_REDISPLAY);
414 ModelAPI_EventCreator::get()->sendUpdated(myFeature, aDispEvent);
415 Events_Loop::loop()->flush(aDispEvent);
418 void ModuleBase_WidgetSelectionFilter::onReverseItem(ModuleBase_FilterItem* theItem)
421 clearCurrentSelection(true);
422 updateNumberSelected();
425 void ModuleBase_WidgetSelectionFilter::onSelect()
427 if (myUseFilters.size() == 0)
429 Handle(AIS_InteractiveContext) aCtx = myWorkshop->viewer()->AISContext();
433 clearCurrentSelection();
435 BRep_Builder aBuilder;
436 TopoDS_Compound aComp;
437 aBuilder.MakeCompound(aComp);
439 DocumentPtr aDoc = myFeature->document();
440 int aNb = aDoc->size(ModelAPI_ResultBody::group());
444 for (int i = 0; i < aNb; i++) {
445 aObj = aDoc->object(ModelAPI_ResultBody::group(), i);
446 aBody = std::dynamic_pointer_cast<ModelAPI_ResultBody>(aObj);
447 GeomShapePtr aShape = aBody->shape();
448 std::list<GeomShapePtr> aSubShapes =
449 aShape->subShapes((GeomAPI_Shape::ShapeType)mySelectionType);
450 TopTools_MapOfShape alreadyThere;
451 std::list<GeomShapePtr>::const_iterator aShapesIt;
452 for (aShapesIt = aSubShapes.cbegin(); aShapesIt != aSubShapes.cend(); aShapesIt++) {
453 GeomShapePtr aShape = (*aShapesIt);
454 TopoDS_Shape aTShape = aShape->impl<TopoDS_Shape>();
455 if (!alreadyThere.Add(aTShape))
457 static SessionPtr aSession = ModelAPI_Session::get();
458 bool isValid = aSession->filters()->isValid(myFeature, aShape);
460 aBuilder.Add(aComp, aTShape);
461 ModuleBase_ViewerPrsPtr aValue(new ModuleBase_ViewerPrs(aObj, aShape));
462 myValues.append(aValue);
467 if (myValues.size() > 0)
468 updatePreview(aComp);
469 updateNumberSelected();
470 updateObject(myFeature);
473 void ModuleBase_WidgetSelectionFilter::updatePreview(const TopoDS_Shape& theShape)
475 Handle(AIS_InteractiveContext) aCtx = myWorkshop->viewer()->AISContext();
479 if (myPreview.IsNull()) {
480 myPreview = new AIS_Shape(theShape);
481 myPreview->SetDisplayMode(AIS_Shaded);
482 myPreview->SetColor(Quantity_NOC_BLUE1);
483 Handle(Prs3d_Drawer) aDrawer = myPreview->Attributes();
484 if (aDrawer->HasOwnPointAspect()) {
485 aDrawer->PointAspect()->SetTypeOfMarker(Aspect_TOM_O_STAR);
486 aDrawer->PointAspect()->SetColor(Quantity_NOC_BLUE1);
487 aDrawer->PointAspect()->SetScale(2.);
490 aDrawer->SetPointAspect(new Prs3d_PointAspect(Aspect_TOM_O_STAR, Quantity_NOC_BLUE1, 2.));
491 myPreview->SetTransparency();
492 aCtx->Display(myPreview, true);
493 aCtx->Deactivate(myPreview);
496 myPreview->Set(theShape);
497 aCtx->Redisplay(myPreview, true);
502 void ModuleBase_WidgetSelectionFilter::onShowOnly(bool theShow)
504 if (myPreview.IsNull())
506 Handle(AIS_InteractiveContext) aCtx = myWorkshop->viewer()->AISContext();
510 aCtx->DisplayedObjects(AIS_KOI_Shape, -1, myListIO);
511 myListIO.Remove(myPreview);
513 AIS_ListOfInteractive::const_iterator aIt;
514 Handle(AIS_Shape) aShapeIO;
515 for (aIt = myListIO.cbegin(); aIt != myListIO.cend(); aIt++) {
516 aShapeIO = Handle(AIS_Shape)::DownCast(*aIt);
517 if (!aShapeIO.IsNull()) {
519 aCtx->Erase(aShapeIO, false);
521 aCtx->Display(aShapeIO, false);
524 aCtx->UpdateCurrentViewer();
527 void ModuleBase_WidgetSelectionFilter::updateSelectBtn()
529 mySelectBtn->setEnabled(myUseFilters.size() > 0);
532 void ModuleBase_WidgetSelectionFilter::updateNumberSelected()
534 int aNb = myValues.size();
535 myNbLbl->setText(QString::number(aNb));
536 //QString aErr = () ? tr("Selection is empty") : "";
538 myFeature->setError(tr("Selection is empty").toStdString(), false, false);
540 myFeature->setError("", false, false);
541 myFeature->data()->execState(ModelAPI_StateDone);
545 QList<QWidget*> ModuleBase_WidgetSelectionFilter::getControls() const
547 QList<QWidget*> aWidgets;
548 QList<ModuleBase_FilterItem*> aItems = myFiltersWgt->findChildren<ModuleBase_FilterItem*>();
549 foreach(ModuleBase_FilterItem* aItem, aItems) {
550 QList<QWidget*> aSubList = aItem->getControls();
551 foreach(QWidget* aWgt, aSubList) {
552 aWidgets.append(aWgt);
555 aWidgets.append(myFiltersCombo);
559 void ModuleBase_WidgetSelectionFilter::clearCurrentSelection(bool toUpdate)
562 if (!myPreview.IsNull()) {
563 Handle(AIS_InteractiveContext) aCtx = myWorkshop->viewer()->AISContext();
564 aCtx->Remove(myPreview, toUpdate);
569 void ModuleBase_WidgetSelectionFilter::onFeatureAccepted()
571 AttributePtr aAttr = mySelectorFeature->attribute(mySelectorAttribute);
572 AttributeSelectionListPtr aSelListAttr =
573 std::dynamic_pointer_cast<ModelAPI_AttributeSelectionList>(aAttr);
574 aSelListAttr->clear();
575 foreach(ModuleBase_ViewerPrsPtr aPrs, myValues) {
576 aSelListAttr->append(aPrs->object(), aPrs->shape());
580 bool ModuleBase_WidgetSelectionFilter::storeValueCustom()
582 ModuleBase_ModelWidget* aActive = myWorkshop->propertyPanel()->activeWidget();
584 return aActive->storeValue();
585 updateObject(myFeature);
589 bool ModuleBase_WidgetSelectionFilter::restoreValueCustom()
591 ModelAPI_FiltersFactory* aFactory = ModelAPI_Session::get()->filters();
592 FiltersFeaturePtr aFiltersFeature = std::dynamic_pointer_cast<ModelAPI_FiltersFeature>(myFeature);
593 std::list<std::string> aFilters = aFiltersFeature->filters();
594 std::list<std::string>::const_iterator aIt;
595 for (aIt = aFilters.cbegin(); aIt != aFilters.cend(); aIt++) {
596 std::string aStr = (*aIt);
598 FilterPtr aFilterObj = aFactory->filter(aStr);
599 int aId = myFiltersCombo->findText(aFilterObj->name().c_str());
601 myFiltersCombo->removeItem(aId);
603 // Init filters member of the parent attribute
604 AttributeSelectionListPtr aAttrList = mySelectorFeature->selectionList(mySelectorAttribute);
605 if (aAttrList->filters() != aFiltersFeature) {
606 aAttrList->setFilters(aFiltersFeature);
609 QList<QWidget*> aWidgets;
610 QList<ModuleBase_FilterItem*> aItems = myFiltersWgt->findChildren<ModuleBase_FilterItem*>();
611 foreach(ModuleBase_FilterItem* aItem, aItems) {
612 QList<ModuleBase_ModelWidget*> aSubList = aItem->widgets();
613 foreach(ModuleBase_ModelWidget* aWgt, aSubList) {
614 aWgt->restoreValue();
620 QString ModuleBase_WidgetSelectionFilter::getError(const bool theValueStateChecked) const
622 QString aErrorMsg = ModuleBase_ModelWidget::getError(theValueStateChecked);
623 if (aErrorMsg.isEmpty()) {
624 if (myValues.size() == 0)
625 aErrorMsg = tr("Selection is empty");
630 void ModuleBase_WidgetSelectionFilter::onObjectUpdated()
632 clearCurrentSelection(true);
633 updateNumberSelected();
634 updateObject(myFeature);