{
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
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;
+}
/// a shape. If the attribute do not uses the shape, it is empty
virtual QList<std::shared_ptr<ModuleBase_ViewerPrs>> getAttributeSelection() const;
+ virtual bool isWholeResultAllowed() const;
+
protected:
/// Returns true if envent is processed. The default implementation is empty, returns false.
virtual bool processSelection();