std::string Model_Data::name()
{
Handle(TDataStd_Name) aName;
- if (myLab.FindAttribute(TDataStd_Name::GetID(), aName))
+ if (myLab.FindAttribute(TDataStd_Name::GetID(), aName)) {
+#ifdef DEBUG_NAMES
+ myObject->myName = TCollection_AsciiString(aName->Get()).ToCString();
+#endif
return std::string(TCollection_AsciiString(aName->Get()).ToCString());
+ }
return ""; // not defined
}
std::dynamic_pointer_cast<Model_Document>(myObject->document())->
changeNamingName(anOldName, theName);
}
+#ifdef DEBUG_NAMES
+ myObject->myName = theName;
+#endif
}
AttributePtr Model_Data::addAttribute(const std::string& theID, const std::string theAttrType)
if (myWasChangedButBlocked.empty() || *(myWasChangedButBlocked.rbegin()) != theAttr)
myWasChangedButBlocked.push_back(theAttr);
}
+ } else {
+ // trim: need to redisplay
+ if (myObject) {
+ static const Events_ID anEvent = Events_Loop::eventByName(EVENT_OBJECT_TO_REDISPLAY);
+ ModelAPI_EventCreator::get()->sendUpdated(myObject, anEvent);
+ }
}
}
-void Model_Data::blockSendAttributeUpdated(const bool theBlock, const bool theSendMessage)
+bool Model_Data::blockSendAttributeUpdated(const bool theBlock, const bool theSendMessage)
{
+ bool aWasBlocked = !mySendAttributeUpdated;
if (mySendAttributeUpdated == theBlock) {
mySendAttributeUpdated = !theBlock;
if (mySendAttributeUpdated && !myWasChangedButBlocked.empty()) {
}
}
}
+ return aWasBlocked;
}
void Model_Data::erase()