Salome HOME
Fix for issue 19964 EDF SMESH 803( Bad dump script of revolutionned mesh with groups).
[modules/smesh.git] / src / SMESH_I / SMESH_DumpPython.cxx
index 4a6f604174a466d2931cb605795e80e843c8a91d..d08e923e031c3633c494c32e8260386967dbd53f 100644 (file)
@@ -296,6 +296,24 @@ namespace SMESH
     return *this;
   }
 
+  TPythonDump& TPythonDump::operator<<(const SMESH::ListOfGroups * theList){
+    if(theList && theList->length() > 0 ) {
+      SMESH_Gen_i* aSMESHGen = SMESH_Gen_i::GetSMESHGen();
+      SALOMEDS::Study_ptr aStudy = aSMESHGen->GetCurrentStudy();
+      myStream << "[";
+      int aListLen = theList->length();
+      for(int i = 0 ; i < aListLen; i++){
+        SALOMEDS::SObject_var aSObject = SMESH_Gen_i::ObjectToSObject(aStudy,(*theList)[i]);
+        if(!aSObject->_is_nil()) {
+          myStream << aSObject->GetID();
+          i < (aListLen - 1) ? myStream<<", " : myStream<<"]";
+        }
+        
+      }
+    }
+    return *this;
+  }
+
   TCollection_AsciiString myLongStringStart( "TPythonDump::LongStringStart" );
   TCollection_AsciiString myLongStringEnd  ( "TPythonDump::LongStringEnd" );