+
+bool ModelAPI_Feature::isMacro() const
+{
+ return false;
+}
+
+bool ModelAPI_Feature::setDisabled(const bool theFlag)
+{
+ if (myIsDisabled != theFlag) {
+ myIsDisabled = theFlag;
+ if (myIsDisabled) {
+ removeResults(0, false, false); // flush will be in setCurrentFeature
+ } else {
+ // enable all disabled previously results
+ std::list<std::shared_ptr<ModelAPI_Result> >::iterator aResIter = myResults.begin();
+ for(; aResIter != myResults.end(); aResIter++) {
+ (*aResIter)->setDisabled(*aResIter, false);
+ }
+ // update selection for the case something was updated higher in the history
+ // while this feature was disabled, but avoid flushing it immediately and
+ // wait while all the previous features update myIsDisabled flag
+ // (flush will be called by the document)
+ static Events_Loop* aLoop = Events_Loop::loop();
+ static Events_ID kUpdatedSel = aLoop->eventByName(EVENT_UPDATE_SELECTION);
+ static const ModelAPI_EventCreator* aECreator = ModelAPI_EventCreator::get();
+ aECreator->sendUpdated(data()->owner(), kUpdatedSel, true);
+ }
+ return true;
+ }
+ return false;
+}
+
+bool ModelAPI_Feature::isDisabled()
+{
+ return myIsDisabled;
+}
+
+// LCOV_EXCL_START
+bool ModelAPI_Feature::setStable(const bool theFlag)
+{
+ if (myIsStable != theFlag) {
+ myIsStable = theFlag;
+ // send an event about the stability change (editing is started/finished)
+ static Events_Loop* aLoop = Events_Loop::loop();
+ static Events_ID EVENT_STAB = aLoop->eventByName(EVENT_STABILITY_CHANGED);
+ std::shared_ptr<Events_Message> aMessage(new Events_Message(EVENT_STAB, this));
+ aLoop->send(aMessage, false);
+ return true;
+ }
+ return false;
+}
+// LCOV_EXCL_STOP
+
+bool ModelAPI_Feature::isStable()
+{
+ return myIsStable;
+}
+
+bool ModelAPI_Feature::customAction(const std::string& /*theActionId*/)
+{
+ return false;
+}
+
+bool ModelAPI_Feature::isPreviewNeeded() const
+{
+ return true;
+}
+
+void ModelAPI_Feature::init()
+{
+ myIsDisabled = false;
+ myIsStable = true;
+}