#include <TColStd_HSequenceOfInteger.hxx>
#include <TCollection_AsciiString.hxx>
+#include <Resource_DataMapIteratorOfDataMapOfAsciiStringAsciiString.hxx>
#ifdef _DEBUG_
aScript += DumpPython_impl(aStudy->StudyId(), aMap, aMapNames,
isPublished, isValidScript, aSavedTrace);
+ //inserting export for Object Names
+ TCollection_AsciiString def = "def RebuildData(theStudy):\n";
+ int pos = aScript.Search( def );
+ if ( pos != -1 )
+ {
+ //insert global definition
+ TCollection_AsciiString glob;
+ for( Resource_DataMapIteratorOfDataMapOfAsciiStringAsciiString It(aMap);
+ It.More(); It.Next() )
+ {
+ TCollection_AsciiString name = It.Value();
+ //check valid name
+ if ( !name.IsEmpty() && name.Search(' ') == -1 && name.Search( ':' ) == -1
+ && !name.IsIntegerValue() && !name.IsEqual("Hypotheses") && !name.IsEqual("Algorithms") )
+ {
+ if ( glob.Length() > 0 )
+ glob += ',';
+ glob += name;
+ }
+ }
+ if ( glob.Length() > 0 )
+ {
+ glob.Prepend( "\tglobal " );
+ glob += '\n';
+ }
+
+ aScript.Insert( pos + def.Length(), glob );
+ }
+
int aLen = aScript.Length();
unsigned char* aBuffer = new unsigned char[aLen+1];
strcpy((char*)aBuffer, aScript.ToCString());