#include "HYDROData_Entity.h"
#include "HYDROData_Iterator.h"
+#include "HYDROData_Tool.h"
#include <TDataStd_Name.hxx>
#include <TDataStd_ByteArray.hxx>
void HYDROData_Entity::Update()
{
+ SetToUpdate( false );
}
QVariant HYDROData_Entity::GetDataVariant()
return QVariant();
}
-void HYDROData_Entity::SetToUpdate(bool theFlag)
+void HYDROData_Entity::SetToUpdate( bool theFlag )
{
+ if ( IsMustBeUpdated() == theFlag )
+ return;
+
if ( theFlag )
{
TDataStd_UAttribute::Set( myLab, GUID_MUST_BE_UPDATED );
+
+ Handle(HYDROData_Document) aDocument = HYDROData_Document::Document( myLab );
+ if ( !aDocument.IsNull() )
+ {
+ // Change the states of this and all depended objects
+ HYDROData_Tool::SetMustBeUpdatedObjects( aDocument );
+ }
}
else
{
return myLab.IsAttribute( GUID_MUST_BE_UPDATED );
}
+bool HYDROData_Entity::CanBeUpdated() const
+{
+ return true;
+}
+
bool HYDROData_Entity::IsRemoved() const
{
return !myLab.HasAttribute();