X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=blobdiff_plain;f=src%2FSMESH_I%2FSMESH_PythonDump.cxx;h=6b90f80f5fe3a82ee9e6ba451b3310d5e3ae8d2b;hp=93559ab3643b1e61b90ed4eced321dcfb5ec6102;hb=6472eab132825fec572beda8276947593f85ffa1;hpb=5166ed186fc81c24941592bb1a1db244b5d0f6c2;ds=inline diff --git a/src/SMESH_I/SMESH_PythonDump.cxx b/src/SMESH_I/SMESH_PythonDump.cxx index 93559ab36..6b90f80f5 100644 --- a/src/SMESH_I/SMESH_PythonDump.cxx +++ b/src/SMESH_I/SMESH_PythonDump.cxx @@ -668,7 +668,7 @@ namespace SMESH void printException( const char* text ) { #ifdef _DEBUG_ - cout << "Exception in SMESH_Gen_i::DumpPython(): " << text << endl; + std::cout << "Exception in SMESH_Gen_i::DumpPython(): " << text << std::endl; #endif } @@ -696,7 +696,7 @@ namespace SMESH //function : DumpPython //purpose : //======================================================================= -Engines::TMPFile* SMESH_Gen_i::DumpPython (CORBA::Boolean isPublished, +Engines::TMPFile* SMESH_Gen_i::DumpPython( CORBA::Boolean isPublished, CORBA::Boolean isMultiFile, CORBA::Boolean& isValidScript) { @@ -1061,12 +1061,15 @@ TCollection_AsciiString SMESH_Gen_i::DumpPython_impl isHistoricalDump ); bool importGeom = false; - GEOM::GEOM_Gen_ptr geom = GetGeomEngine(); + GEOM::GEOM_Gen_ptr geom[2]; + for ( int isShaper = 0; isShaper < 2; ++isShaper ) { + geom[ isShaper ] = GetGeomEngine( isShaper ); + if ( CORBA::is_nil( geom[ isShaper ])) + continue; // Add names of GEOM objects to theObjectNames to exclude same names of SMESH objects - GEOM::string_array_var aGeomNames = geom->GetAllDumpNames(); - int ign = 0, nbgn = aGeomNames->length(); - for (; ign < nbgn; ign++) { + GEOM::string_array_var aGeomNames = geom[ isShaper ]->GetAllDumpNames(); + for ( CORBA::ULong ign = 0; ign < aGeomNames->length(); ign++) { TCollection_AsciiString aName = aGeomNames[ign].in(); theObjectNames.Bind(aName, "1"); } @@ -1100,7 +1103,11 @@ TCollection_AsciiString SMESH_Gen_i::DumpPython_impl anUpdatedScript += aLine.SubString( aStart, aSeq->Value(i) - 1 ); // line part before i-th entry anEntry = aLine.SubString( aSeq->Value(i), aSeq->Value(i + 1) ); // is a GEOM object? - CORBA::String_var geomName = geom->GetDumpName( anEntry.ToCString() ); + CORBA::String_var geomName; + if ( !CORBA::is_nil( geom[0] )) + geomName = geom[0]->GetDumpName( anEntry.ToCString() ); + if (( !geomName.in() || !geomName.in()[0] ) && !CORBA::is_nil( geom[1] )) + geomName = geom[1]->GetDumpName( anEntry.ToCString() ); if ( !geomName.in() || !geomName.in()[0] ) { // is a SMESH object if ( theObjectNames.IsBound( anEntry )) {