X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2FSMESH_I%2FSMESH_DumpPython.cxx;h=629a7d8f1cc13d883d4c1f2318109074939006e4;hb=9e0ab432ccaa69bbbc5e846ef2b68c32782c91ad;hp=5b012b59cfc4cf48b5500a28f2a5c52c416e0431;hpb=2daa321efae3d0c6ce41199fa5a2482630d505d9;p=modules%2Fsmesh.git diff --git a/src/SMESH_I/SMESH_DumpPython.cxx b/src/SMESH_I/SMESH_DumpPython.cxx index 5b012b59c..629a7d8f1 100644 --- a/src/SMESH_I/SMESH_DumpPython.cxx +++ b/src/SMESH_I/SMESH_DumpPython.cxx @@ -208,6 +208,32 @@ namespace SMESH return *this; } + TPythonDump& + TPythonDump:: + operator<<(SMESH::SMESH_Hypothesis_ptr theArg) + { + SALOMEDS::Study_var aStudy = SMESH_Gen_i::GetSMESHGen()->GetCurrentStudy(); + SALOMEDS::SObject_var aSObject = SMESH_Gen_i::ObjectToSObject(aStudy,theArg); + if(aSObject->_is_nil() && !CORBA::is_nil(theArg)) + myStream << "hyp_" << theArg->GetId(); + else + *this << CORBA::Object_ptr( theArg ); + return *this; + } + + TPythonDump& + TPythonDump:: + operator<<(SMESH::SMESH_IDSource_ptr theArg) + { + SMESH_Gen_i* aSMESHGen = SMESH_Gen_i::GetSMESHGen(); + SALOMEDS::Study_var aStudy = aSMESHGen->GetCurrentStudy(); + SALOMEDS::SObject_var aSObject = SMESH_Gen_i::ObjectToSObject(aStudy,theArg); + if(!aSObject->_is_nil() || CORBA::is_nil( theArg )) + return *this << aSObject; + SMESH::long_array_var anElementsId = theArg->GetIDs(); + return *this << anElementsId; + } + TPythonDump& TPythonDump:: operator<<(SMESH::FilterLibrary_i* theArg) @@ -484,9 +510,7 @@ Engines::TMPFile* SMESH_Gen_i::DumpPython (CORBA::Object_ptr theStudy, TCollection_AsciiString aSavedTrace (oldValue); // Add trace of API methods calls and replace study entries by names - TCollection_AsciiString aScript = - "# -*- coding: iso-8859-1 -*-\n" - "### This file is generated by SALOME automatically by dump python functionality of SMESH component\n\n"; + TCollection_AsciiString aScript; aScript += DumpPython_impl(aStudy, aMap, aMapNames, isPublished, isValidScript, aSavedTrace);