+void ModelAPI_Result::initAttributes()
+{
+ // append the color attribute. It is empty, the attribute will be filled by a request
+ DataPtr aData = data();
+ aData->addAttribute(COLOR_ID(), ModelAPI_AttributeIntArray::typeId())->setIsArgument(false);
+ aData->addAttribute(DEFLECTION_ID(), ModelAPI_AttributeDouble::typeId())->setIsArgument(false);
+ aData->addAttribute(TRANSPARENCY_ID(), ModelAPI_AttributeDouble::typeId())->setIsArgument(false);
+ aData->addAttribute(ISO_LINES_ID(), ModelAPI_AttributeIntArray::typeId())->setIsArgument(false);
+ aData->addAttribute(SHOW_ISO_LINES_ID(), ModelAPI_AttributeBoolean::typeId())->setIsArgument(false);
+ aData->addAttribute(SHOW_EDGES_DIRECTION_ID(), ModelAPI_AttributeBoolean::typeId())->setIsArgument(false);
+ // Add the "Bring To Front" attribute to the Result base class, as we may support it in the future
+ // for all type of results. Actually, only ResultGroups are supported.
+ aData->addAttribute(BRING_TO_FRONT_ID(), ModelAPI_AttributeBoolean::typeId())->setIsArgument(false);
+}
+
+bool ModelAPI_Result::setDisabled(std::shared_ptr<ModelAPI_Result> theThis, const bool theFlag)
+{
+ if (myIsDisabled != theFlag) {
+ myIsDisabled = theFlag;
+ if (data()->isValid())
+ data()->setIsDeleted(theFlag); // store it in data model (to get back on undo/redo, etc)
+ // this must be before "updated" message send to have history updated for OB update
+ document()->updateHistory(groupName()); // to update the history cash data in the document
+ // generate related events
+ static Events_Loop* aLoop = Events_Loop::loop();
+ static const ModelAPI_EventCreator* aECreator = ModelAPI_EventCreator::get();
+ if (myIsDisabled) { // disabled result looks like removed
+ aECreator->sendDeleted(document(), groupName());
+ } else { // un-disabled equals to created
+ static Events_ID anEvent = Events_Loop::eventByName(EVENT_OBJECT_CREATED);
+ aECreator->sendUpdated(theThis, anEvent /*, false*/); // flush is in setCurrentFeature
+ }
+ static Events_ID EVENT_DISP = aLoop->eventByName(EVENT_OBJECT_TO_REDISPLAY);
+ aECreator->sendUpdated(theThis, EVENT_DISP/*, false*/); // flush is in setCurrentFeature
+ return true;
+ }
+ return false;
+}
+
+bool ModelAPI_Result::isDisabled()
+{
+ if (data()->isValid() && myIsDisabled != data()->isDeleted())
+ setDisabled(std::dynamic_pointer_cast<ModelAPI_Result>(
+ data()->owner()), data()->isDeleted()); // restore from the data model the correct value
+ return myIsDisabled;
+}
+
+bool ModelAPI_Result::isConcealed()
+{