Salome HOME
0020746: EDF 1274 SMESH : MergeAllNodesButNodesFromGroup feature
authoreap <eap@opencascade.com>
Wed, 15 Sep 2010 11:50:48 +0000 (11:50 +0000)
committereap <eap@opencascade.com>
Wed, 15 Sep 2010 11:50:48 +0000 (11:50 +0000)
+    TPythonDump&
+    operator<<(const SMESH::ListOfIDSources& theList);
+

src/SMESH_I/SMESH_DumpPython.cxx
src/SMESH_I/SMESH_PythonDump.hxx

index c50fa07edb871fdfe5210bda4120eedf89a99bdf..91aaa656e9414d0034d367c3678243ad5a3e9879 100644 (file)
@@ -152,7 +152,7 @@ namespace SMESH
   }
 
   template<class TArray>
-  void DumpArray(const TArray& theArray, std::ostringstream & theStream)
+  void DumpArray(const TArray& theArray, TPythonDump & theStream)
   {
     theStream << "[ ";
     for (int i = 1; i <= theArray.length(); i++) {
@@ -166,14 +166,14 @@ namespace SMESH
   TPythonDump& 
   TPythonDump::operator<<(const SMESH::long_array& theArg)
   {
-    DumpArray( theArg, myStream );
+    DumpArray( theArg, *this );
     return *this;
   }
 
   TPythonDump& 
   TPythonDump::operator<<(const SMESH::double_array& theArg)
   {
-    DumpArray( theArg, myStream );
+    DumpArray( theArg, *this );
     return *this;
   }
 
@@ -356,21 +356,12 @@ namespace SMESH
 
   TPythonDump& TPythonDump::operator<<(const SMESH::ListOfGroups& theList)
   {
-    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()) {
-        CORBA::String_var entry = aSObject->GetID();
-        myStream << entry;
-        if ( i < (aListLen - 1) )
-          myStream<<", ";
-      }
-    }
-    myStream<<"]";
+    DumpArray( theList, *this );
+    return *this;
+  }
+  TPythonDump& TPythonDump::operator<<(const SMESH::ListOfIDSources& theList)
+  {
+    DumpArray( theList, *this );
     return *this;
   }
 
index f8567b41d5c2e2997f122d35e463277c3a7f2592..031b3c4156b789ff0e5ddf2fc8c17076b5722e8c 100644 (file)
@@ -163,6 +163,9 @@ namespace SMESH
     TPythonDump&
     operator<<(const SMESH::ListOfGroups& theList);
 
+    TPythonDump&
+    operator<<(const SMESH::ListOfIDSources& theList);
+
     static const char* SMESHGenName() { return "smeshgen"; }
     static const char* MeshEditorName() { return "mesh_editor"; }