- DataPtr aData = myFeature->data();
- std::string aType = aData->attribute(attributeID())->attributeType();
- if (aType == ModelAPI_AttributeReference::typeId()) {
- AttributeReferencePtr aRef = aData->reference(attributeID());
- ObjectPtr aObject = aRef->value();
- if (!(aObject && aObject->isSame(theSelectedObject))) {
- aRef->setValue(theSelectedObject);
- }
- } else if (aType == ModelAPI_AttributeRefAttr::typeId()) {
- AttributeRefAttrPtr aRefAttr = aData->refattr(attributeID());
-
- AttributePtr anAttribute = myWorkshop->module()->findAttribute(theSelectedObject, theShape);
- if (anAttribute.get())
- aRefAttr->setAttr(anAttribute);
- else {
- ObjectPtr aObject = aRefAttr->object();
- if (!(aObject && aObject->isSame(theSelectedObject))) {
- aRefAttr->setObject(theSelectedObject);
- }
- }
- } else if (aType == ModelAPI_AttributeSelection::typeId()) {
- AttributeSelectionPtr aSelectAttr = aData->selection(attributeID());
- ResultPtr aResult = std::dynamic_pointer_cast<ModelAPI_Result>(theSelectedObject);
- if (aSelectAttr.get() != NULL) {
- aSelectAttr->setValue(aResult, theShape);
- }
+ if (theValues.empty()) {
+ // In order to make reselection possible, set empty object and shape should be done
+ setSelectionCustom(std::shared_ptr<ModuleBase_ViewerPrs>(new ModuleBase_ViewerPrs(
+ ObjectPtr(), GeomShapePtr(), NULL)));
+ return false;
+ }
+ // it removes the processed value from the parameters list
+ ModuleBase_ViewerPrsPtr aValue = theValues.takeFirst();
+ bool isDone = false;
+
+ if (!theToValidate || isValidInFilters(aValue)) {
+ isDone = setSelectionCustom(aValue);
+ // updateObject - to update/redisplay feature
+ // it is commented in order to perfom it outside the method
+ //updateObject(myFeature);
+ // to storeValue()
+ //emit valuesChanged();