-// 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
{
GeomShapePtr aShape = myWorkshop->selection()->getShape(thePrs);
ResultPtr aResult = myWorkshop->selection()->getResult(thePrs);
- bool aValid = acceptSubShape(aShape, aResult);
+ bool aValid = aResult.get();
+ if (!isWholeResultAllowed())
+ aValid = acceptSubShape(aShape, aResult);
if (aValid) {
// In order to avoid selection of the same object
- ResultPtr aResult = myWorkshop->selection()->getResult(thePrs);
+ aResult = myWorkshop->selection()->getResult(thePrs);
FeaturePtr aSelectedFeature = ModelAPI_Feature::feature(aResult);
aValid = aSelectedFeature != myFeature;
}
aSelectAttr->removeTemporaryValues();
}
}
+
+//********************************************************************
+bool ModuleBase_WidgetSelector::isWholeResultAllowed() const
+{
+ AttributePtr anAttribute = attribute();
+ if (anAttribute.get()) {
+ AttributeSelectionListPtr aSelAttr =
+ std::dynamic_pointer_cast<ModelAPI_AttributeSelectionList>(anAttribute);
+ if (aSelAttr.get())
+ return aSelAttr->isWholeResultAllowed();
+ }
+ return false;
+}