From 26ca7babdf21a11af4a4c88ae32754985e4a84e3 Mon Sep 17 00:00:00 2001 From: eap Date: Fri, 13 Feb 2009 08:59:09 +0000 Subject: [PATCH] 0020159: EDF GEOM: Dump study with exploded geom object is not complete --- src/GEOM/GEOM_Engine.cxx | 43 ++++++++++++++-------------------------- 1 file changed, 15 insertions(+), 28 deletions(-) diff --git a/src/GEOM/GEOM_Engine.cxx b/src/GEOM/GEOM_Engine.cxx index 55219ecfc..101c994ea 100644 --- a/src/GEOM/GEOM_Engine.cxx +++ b/src/GEOM/GEOM_Engine.cxx @@ -443,8 +443,8 @@ TCollection_AsciiString GEOM_Engine::DumpPython(int theDocID, Handle(TDataStd_TreeNode) aNode, aRoot; Handle(GEOM_Function) aFunction; - TDF_LabelMap aFuncMap; - std::set anObjMap; + TDF_LabelMap aCheckedFuncMap; + std::set anIgnoreObjMap; if (aDoc->Main().FindAttribute(GEOM_Function::GetFunctionTreeID(), aRoot)) { TDataStd_ChildNodeIterator Itr(aRoot); @@ -455,7 +455,7 @@ TCollection_AsciiString GEOM_Engine::DumpPython(int theDocID, MESSAGE ( "Null function !!!!" ); continue; } - ProcessFunction(aFunction, aScript, aFuncMap, anObjMap); + ProcessFunction(aFunction, aScript, aCheckedFuncMap, anIgnoreObjMap); } } @@ -582,8 +582,8 @@ TCollection_AsciiString GEOM_Engine::DumpPython(int theDocID, { const TCollection_AsciiString& aEntry = anEntryToNameIt.Key(); const TCollection_AsciiString& aName = anEntryToNameIt.Value(); - if (!anObjMap.count(aEntry.ToCString())) - continue; // was not dumped + if (anIgnoreObjMap.count(aEntry.ToCString())) + continue; // should not be dumped if ( !aEntry2StEntry.IsBound( aEntry )) continue; // was not published TCollection_AsciiString aCommand("\n\tgeompy."), aFatherEntry; @@ -682,21 +682,11 @@ Handle(TColStd_HSequenceOfAsciiString) GEOM_Engine::GetAllDumpNames() const void ProcessFunction(Handle(GEOM_Function)& theFunction, TCollection_AsciiString& theScript, TDF_LabelMap& theProcessed, - std::set& theDumpedObjs) + std::set& theIgnoreObjs) { if (theFunction.IsNull()) return; - if (theProcessed.Contains(theFunction->GetEntry())) return; -/* - TDF_LabelSequence aSeq; - theFunction->GetDependency(aSeq); - Standard_Integer aLen = aSeq.Length(); - 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); - } -*/ + if (theProcessed.Contains(theFunction->GetEntry())) return; // pass functions, that depends on nonexisting ones bool doNotProcess = false; @@ -729,25 +719,22 @@ void ProcessFunction(Handle(GEOM_Function)& theFunction, } } - if (doNotProcess) return; - - TCollection_AsciiString aDescr = theFunction->GetDescription(); - if(aDescr.Length() == 0) { - //cout << "Warning: the function has no description" << endl; + if (doNotProcess) { + TCollection_AsciiString anObjEntry; + TDF_Tool::Entry(theFunction->GetOwnerEntry(), anObjEntry); + theIgnoreObjs.insert(anObjEntry.ToCString()); return; } + theProcessed.Add(theFunction->GetEntry()); + + TCollection_AsciiString aDescr = theFunction->GetDescription(); + if(aDescr.Length() == 0) return; //Check if its internal function which doesn't requires dumping if(aDescr == "None") return; theScript += "\n\t"; theScript += aDescr; - - theProcessed.Add(theFunction->GetEntry()); - - TCollection_AsciiString anObjEntry; - TDF_Tool::Entry(theFunction->GetOwnerEntry(), anObjEntry); - theDumpedObjs.insert(anObjEntry.ToCString()); } //============================================================================= -- 2.39.2