(at the moment implemeted only in GEOM and SMESH modules).
*/
//============================================================================
- virtual bool modifySO_Notification(const SALOMEDSImpl_SObject& theSObject)
+ virtual bool modifySO_Notification(const SALOMEDSImpl_SObject& theSObject, int reason)
{
for (ObsListIter it (myObservers.begin()); it != myObservers.end(); ++it)
{
{
std::string anID=theSObject.GetID();
const char* cID=anID.c_str();
- it->first->notifyObserverID(cID,0);
+ it->first->notifyObserverID(cID,reason);
}
}
return true; // NGE return always true but can be modified if needed
//add IOR entry in study
SALOMEDSImpl_Study::IORUpdated(this);
+
+ //Reason = 5 means that IOR attribute updated
+ //Used in the gui module to detect that IOR attribure was assigned to the object
+ SetModifyFlag(5);
}
//=======================================================================
public:
virtual bool addSO_Notification(const SALOMEDSImpl_SObject& theSObject){return false;};
virtual bool removeSO_Notification(const SALOMEDSImpl_SObject& theSObject){return false;};
- virtual bool modifySO_Notification(const SALOMEDSImpl_SObject& theSObject){return false;};
+ virtual bool modifySO_Notification(const SALOMEDSImpl_SObject& theSObject, int reason ){return false;};
};
#endif
return SALOMEDSImpl_Study::SObject(aLabel);
}
-void SALOMEDSImpl_GenericAttribute::SetModifyFlag()
+/*!
+ * Set modification flag of the Attribute.
+ * param reason reason of the modification (by default equal to 0)
+ */
+void SALOMEDSImpl_GenericAttribute::SetModifyFlag(int reason)
{
DF_Label aLabel = Label();
if(aLabel.IsNull()) return;
SALOMEDSImpl_Study* aStudy = SALOMEDSImpl_Study::GetStudy(aLabel);
- if(aStudy) aStudy->modifySO_Notification(GetSObject());
+ if(aStudy) aStudy->modifySO_Notification(GetSObject(), reason);
if(aStudy) aStudy->Modify();
}
-
virtual void CheckLocked();
std::string GetClassType() { return _type; }
SALOMEDSImpl_SObject GetSObject();
- void SetModifyFlag();
+ void SetModifyFlag(int reason = 0);
static std::string Impl_GetType(DF_Attribute* theAttr);
static std::string Impl_GetClassType(DF_Attribute* theAttr);
//============================================================================
/*! Function : modifySO_Notification
- * Purpose : This function tells all the observers that a SO has been modified
+ * Purpose : This function tells all the observers that a SO has been modified and
+ pass the mofification reason
*/
//============================================================================
-bool SALOMEDSImpl_Study::modifySO_Notification (const SALOMEDSImpl_SObject& theSObject)
+bool SALOMEDSImpl_Study::modifySO_Notification (const SALOMEDSImpl_SObject& theSObject, int reason)
{
if(_notifier)
- return _notifier->modifySO_Notification(theSObject);
+ return _notifier->modifySO_Notification(theSObject, reason);
else
return false;
}
// Notification mechanism
virtual bool addSO_Notification(const SALOMEDSImpl_SObject& theSObject);
virtual bool removeSO_Notification(const SALOMEDSImpl_SObject& theSObject);
- virtual bool modifySO_Notification(const SALOMEDSImpl_SObject& theSObject);
+ virtual bool modifySO_Notification(const SALOMEDSImpl_SObject& theSObject, int reason);
virtual void setNotifier(SALOMEDSImpl_AbstractCallback* notifier);
Lab.ForgetAttribute (SALOMEDSImpl_SObject::GetGUID(aTypeOfAttribute));
_doc->SetModified(true);
- _study->modifySO_Notification(anObject);
+ _study->modifySO_Notification(anObject,0);
return true;
}