Bug 0020065: EDF 876 GEOM : Deleting an object leads to unusable dump.

This commit is contained in:
jfa 2008-12-23 12:04:23 +00:00
parent 2589b34626
commit 9fb1bbc452

View File

@ -97,7 +97,6 @@ Handle(TColStd_HSequenceOfInteger) FindEntries(TCollection_AsciiString& theStrin
//=============================================================================
GEOM_Engine* GEOM_Engine::GetEngine() { return TheEngine; }
//=============================================================================
/*!
* SetEngine
@ -437,7 +436,7 @@ TCollection_AsciiString GEOM_Engine::DumpPython(int theDocID,
aScript += "def RebuildData(theStudy):";
aScript += "\n\tgeompy.init_geom(theStudy)";
Standard_Integer posToInertGlobalVars = aScript.Length() + 1;
Standard_Integer posToInsertGlobalVars = aScript.Length() + 1;
Handle(TDataStd_TreeNode) aNode, aRoot;
Handle(GEOM_Function) aFunction;
@ -635,7 +634,7 @@ TCollection_AsciiString GEOM_Engine::DumpPython(int theDocID,
}
if ( !globalVars.IsEmpty() ) {
globalVars.Insert( 1, "\n\tglobal " );
anUpdatedScript.Insert( posToInertGlobalVars, globalVars );
anUpdatedScript.Insert( posToInsertGlobalVars, globalVars );
}
return anUpdatedScript;
@ -685,26 +684,41 @@ void ProcessFunction(Handle(GEOM_Function)& theFunction,
TDF_LabelSequence aSeq;
theFunction->GetDependency(aSeq);
Standard_Integer aLen = aSeq.Length();
for(Standard_Integer i = 1; i<= aLen; i++) {
for(Standard_Integer i = 1; i <= aLen; i++) {
Handle(GEOM_Function) aFunction = GEOM_Function::GetFunction(aSeq.Value(i));
if(aFunction.IsNull()) continue;
ProcessFunction(aFunction, theScript, theProcessed);
}
*/
// pass functions, that depends on nonexisting ones
//jfa:test//bool doComment = false;
TDF_LabelSequence aSeq;
theFunction->GetDependency(aSeq);
Standard_Integer aLen = aSeq.Length();
//jfa:test//for (Standard_Integer i = 1; i <= aLen && !doComment; i++) {
for (Standard_Integer i = 1; i <= aLen; i++) {
Handle(GEOM_Function) aFunction = GEOM_Function::GetFunction(aSeq.Value(i));
//jfa:test//if (aFunction.IsNull()) doComment = true;
//jfa:test//else if (!theProcessed.Contains(aFunction)) doComment = true;
if (aFunction.IsNull()) return;
if (!theProcessed.Contains(aFunction)) return;
}
TCollection_AsciiString aDescr = theFunction->GetDescription();
if(aDescr.Length() == 0) {
//cout << "Warning: the function has no description" << endl;
return;
}
//Check if its internal function which doesn't requires dumping
if(aDescr == "None") return;
theScript += "\n\t";
//jfa:test//if (doComment) theScript += "#";
theScript += aDescr;
theProcessed.Add(theFunction);
return;
}
//=============================================================================