mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-24 13:50:49 +03:00
0031452: Impossible to get Backup of the attribute and status that attribute was modified before commit transaction
Method TObj_Object::HasModifications() was added to get flag that object or it's children was modified in the current open transaction
This commit is contained in:
@@ -447,6 +447,28 @@ static Standard_Integer getChild (Draw_Interpretor& di, Standard_Integer argc, c
|
||||
return 0;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : hasModifications
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
static Standard_Integer hasModifications(Draw_Interpretor& di, Standard_Integer argc, const char** argv)
|
||||
{
|
||||
if (argc < 3)
|
||||
{
|
||||
di << "Use " << argv[0] << "DocName ObjName\n";
|
||||
return 1;
|
||||
}
|
||||
|
||||
Handle(TObjDRAW_Object) tObj = getObjByName(argv[1], argv[2]);
|
||||
if (tObj.IsNull())
|
||||
{
|
||||
di << "Error: Object " << argv[2] << " not found\n";
|
||||
return 1;
|
||||
}
|
||||
di << "Status modifications : " << (tObj->HasModifications() ? 1 : 0) << "\n";
|
||||
|
||||
return 0;
|
||||
}
|
||||
//=======================================================================
|
||||
//function : Init
|
||||
//purpose :
|
||||
@@ -500,6 +522,8 @@ void TObjDRAW::Init(Draw_Interpretor& di)
|
||||
di.Add ("TObjGetChildren","DocName ObjName \t: Returns list of children objects",
|
||||
__FILE__, getChild, g);
|
||||
|
||||
di.Add("TObjHasModifications", "DocName ObjName \t: Returns status of modification of the object (if object has been modified 1, otherwise 0)", __FILE__, hasModifications, g);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user