]> SALOME platform Git repositories - modules/smesh.git/commitdiff
Salome HOME
PythonDump for SMESH Controls / Filter
authorapo <apo@opencascade.com>
Wed, 30 Mar 2005 06:58:37 +0000 (06:58 +0000)
committerapo <apo@opencascade.com>
Wed, 30 Mar 2005 06:58:37 +0000 (06:58 +0000)
src/SMESH_I/SMESH_DumpPython.cxx
src/SMESH_I/SMESH_Filter_i.cxx
src/SMESH_I/SMESH_Gen_i.hxx
src/SMESH_I/SMESH_PythonDump.hxx

index 5a5d3c25a0bebc8fcf44d02904c85ca0e281d168..d6700df0caf9dcd7bbb1210454f28ccab55cd460 100644 (file)
@@ -9,46 +9,77 @@
 #include "SMESH_Filter_i.hxx"
 
 #include <TColStd_HSequenceOfInteger.hxx>
+#include <TCollection_AsciiString.hxx>
 
 namespace SMESH
 {
-  TCollection_AsciiString& 
-  operator<<(TCollection_AsciiString& theString, const char* theArg){
-    theString += Standard_CString(theArg);
-    return theString;
-  }
 
-  TCollection_AsciiString& 
-  operator<<(TCollection_AsciiString& theString, int theArg){
-    theString += TCollection_AsciiString(theArg);
-    return theString;
+  size_t TPythonDump::myCounter = 0;
+
+  TPythonDump::
+  TPythonDump()
+  {
+    ++myCounter;
+  }
+  TPythonDump::
+  ~TPythonDump()
+  {
+    if(--myCounter == 0){
+      SMESH_Gen_i* aSMESHGen = SMESH_Gen_i::GetSMESHGen();
+      SALOMEDS::Study_ptr aStudy = aSMESHGen->GetCurrentStudy();
+      if(!aStudy->_is_nil()){
+       std::string aString = myStream.str();
+       TCollection_AsciiString aCollection(Standard_CString(aString.c_str()));
+       aSMESHGen->AddToPythonScript(aStudy->StudyId(),aCollection);
+      }
+    }
   }
 
-  TCollection_AsciiString& 
-  operator<<(TCollection_AsciiString& theString, float theArg){
-    theString += TCollection_AsciiString(theArg);
-    return theString;
+  TPythonDump& 
+  TPythonDump::
+  operator<<(const SMESH::ElementType& theArg)
+  {
+    myStream<<"SMESH.";
+    switch(theArg){
+    case ALL: 
+      myStream<<"ALL"; 
+      break;
+    case NODE: 
+      myStream<<"NODE"; 
+      break;
+    case EDGE: 
+      myStream<<"EDGE"; 
+      break;
+    case FACE: 
+      myStream<<"FACE"; 
+      break;
+    case VOLUME: 
+      myStream<<"VOLUME"; 
+      break;
+    }
+    return *this;
   }
 
-  TCollection_AsciiString& 
-  operator<<(TCollection_AsciiString& theString, 
-            const SMESH::long_array& theArg)
+
+  TPythonDump& 
+  TPythonDump::
+  operator<<(const SMESH::long_array& theArg)
   {
-    theString<<"[ ";
+    myStream<<"[ ";
     CORBA::Long i = 1, iEnd = theArg.length();
     for(; i <= iEnd; i++) {
-      theString<<int(theArg[i-1]);
+      myStream<<theArg[i-1];
       if(i < iEnd)
-       theString<< ", ";
+       myStream<< ", ";
     }
-    theString<<" ]";
-    return theString;
+    myStream<<" ]";
+    return *this;
   }
 
 
-  TCollection_AsciiString
-  operator<<(TCollection_AsciiString& theString, 
-            CORBA::Object_ptr theArg)
+  TPythonDump
+  TPythonDump::
+  operator<<(CORBA::Object_ptr theArg)
   {
     CORBA::String_var aString("None");
     SMESH_Gen_i* aSMESHGen = SMESH_Gen_i::GetSMESHGen();
@@ -59,144 +90,121 @@ namespace SMESH
     }else if(!CORBA::is_nil(theArg)){
       aString = SMESH_Gen_i::GetORB()->object_to_string(theArg);
     }
-    theString<<aString.in();
-    return theString;
+    myStream<<aString.in();
+    return *this;
   }
 
-  TCollection_AsciiString
-  operator<<(TCollection_AsciiString& theString, 
-            SMESH::FilterLibrary_i* theArg)
+  TPythonDump
+  TPythonDump::
+  operator<<(SMESH::FilterLibrary_i* theArg)
   {
-    theString += TCollection_AsciiString("aFilterLibrary_");
-    theString += TCollection_AsciiString(int(theArg));
-    return theString;
+    myStream<<"aFilterLibrary"<<theArg;
+    return *this;
   }
 
-  TCollection_AsciiString
-  operator<<(TCollection_AsciiString& theString, 
-            SMESH::FilterManager_i* theArg)
+  TPythonDump
+  TPythonDump::
+  operator<<(SMESH::FilterManager_i* theArg)
   {
-    theString += TCollection_AsciiString("aFilterManager_");
-    theString += TCollection_AsciiString(int(theArg));
-    return theString;
+    myStream<<"aFilterManager"<<theArg;
+    return *this;
   }
 
-  TCollection_AsciiString
-  operator<<(TCollection_AsciiString& theString, 
-            SMESH::Filter_i* theArg)
+  TPythonDump
+  TPythonDump::
+  operator<<(SMESH::Filter_i* theArg)
   {
-    theString += TCollection_AsciiString("aFilter_");
-    theString += TCollection_AsciiString(int(theArg));
-    return theString;
+    myStream<<"aFilter"<<theArg;
+    return *this;
   }
 
-  TCollection_AsciiString
-  operator<<(TCollection_AsciiString& theString, 
-            SMESH::Functor_i* theArg)
+  TPythonDump
+  TPythonDump::
+  operator<<(SMESH::Functor_i* theArg)
   {
     FunctorType aFunctorType = theArg->GetFunctorType();
     switch(aFunctorType){
     case FT_AspectRatio:
-      theString += TCollection_AsciiString("anAspectRatio");
+      myStream<<"anAspectRatio";
       break;
     case FT_AspectRatio3D:
-      theString += TCollection_AsciiString("anAspectRatio3D");
+      myStream<<"anAspectRatio3D";
       break;
     case FT_Warping:
-      theString += TCollection_AsciiString("aWarping");
+      myStream<<"aWarping";
       break;
     case FT_MinimumAngle:
-      theString += TCollection_AsciiString("aMinimumAngle");
+      myStream<<"aMinimumAngle";
       break;
     case FT_Taper:
-      theString += TCollection_AsciiString("aTaper");
+      myStream<<"aTaper";
       break;
     case FT_Skew:
-      theString += TCollection_AsciiString("aSkew");
+      myStream<<"aSkew";
       break;
     case FT_Area:
-      theString += TCollection_AsciiString("aArea");
+      myStream<<"aArea";
       break;
     case FT_FreeBorders:
-      theString += TCollection_AsciiString("aFreeBorders");
+      myStream<<"aFreeBorders";
       break;
     case FT_FreeEdges:
-      theString += TCollection_AsciiString("aFreeEdges");
+      myStream<<"aFreeEdges";
       break;
     case FT_MultiConnection:
-      theString += TCollection_AsciiString("aMultiConnection");
+      myStream<<"aMultiConnection";
       break;
     case FT_MultiConnection2D:
-      theString += TCollection_AsciiString("aMultiConnection2D");
+      myStream<<"aMultiConnection2D";
       break;
     case FT_Length:
-      theString += TCollection_AsciiString("aLength");
+      myStream<<"aLength";
       break;
     case FT_Length2D:
-      theString += TCollection_AsciiString("aLength");
+      myStream<<"aLength";
       break;
     case FT_BelongToGeom:
-      theString += TCollection_AsciiString("aBelongToGeom");
+      myStream<<"aBelongToGeom";
       break;
     case FT_BelongToPlane:
-      theString += TCollection_AsciiString("aBelongToPlane");
+      myStream<<"aBelongToPlane";
       break;
     case FT_BelongToCylinder:
-      theString += TCollection_AsciiString("aBelongToCylinder");
+      myStream<<"aBelongToCylinder";
       break;
     case FT_LyingOnGeom:
-      theString += TCollection_AsciiString("aLyingOnGeom");
+      myStream<<"aLyingOnGeom";
       break;
     case FT_RangeOfIds:
-      theString += TCollection_AsciiString("aRangeOfIds");
+      myStream<<"aRangeOfIds";
       break;
     case FT_BadOrientedVolume:
-      theString += TCollection_AsciiString("aBadOrientedVolume");
+      myStream<<"aBadOrientedVolume";
       break;
     case FT_LessThan:
-      theString += TCollection_AsciiString("aLessThan");
+      myStream<<"aLessThan";
       break;
     case FT_MoreThan:
-      theString += TCollection_AsciiString("aMoreThan");
+      myStream<<"aMoreThan";
       break;
     case FT_EqualTo:
-      theString += TCollection_AsciiString("anEqualTo");
+      myStream<<"anEqualTo";
       break;
     case FT_LogicalNOT:
-      theString += TCollection_AsciiString("aLogicalNOT");
+      myStream<<"aLogicalNOT";
       break;
     case FT_LogicalAND:
-      theString += TCollection_AsciiString("aLogicalAND");
+      myStream<<"aLogicalAND";
       break;
     case FT_LogicalOR:
-      theString += TCollection_AsciiString("aLogicalOR");
+      myStream<<"aLogicalOR";
       break;
     case FT_Undefined:
-      theString += TCollection_AsciiString("anUndefined");
+      myStream<<"anUndefined";
       break;
     }
-    theString += Standard_CString("_");
-    theString += TCollection_AsciiString(int(theArg));
-    return theString;
-  }
-
-  size_t TPythonDump::myCounter = 0;
-
-  TPythonDump::
-  TPythonDump()
-  {
-    ++myCounter;
-  }
-  TPythonDump::
-  ~TPythonDump()
-  {
-    if(--myCounter == 0){
-      SMESH_Gen_i* aSMESHGen = SMESH_Gen_i::GetSMESHGen();
-      SALOMEDS::Study_ptr aStudy = aSMESHGen->GetCurrentStudy();
-      if(!aStudy->_is_nil()){
-       aSMESHGen->AddToPythonScript(aStudy->StudyId(),myString);
-      }
-    }
+    myStream<<theArg;
+    return *this;
   }
 }
 
index c62a96a1b1cb64fbb1efbbd15553f7bc0c22d1d6..9374d8d338fdd4122b3753679bcb4332c5eb5648 100644 (file)
@@ -70,8 +70,7 @@ namespace SMESH
   Predicate_i* 
   GetPredicate( Predicate_ptr thePredicate )
   {
-    PortableServer::ServantBase_var aServant = SMESH_Gen_i::GetServant( thePredicate );
-    return dynamic_cast<Predicate_i*>(aServant.in());
+    return DownCast<Predicate_i*>(thePredicate);
   }
 }
 
@@ -322,8 +321,7 @@ inline
 const SMDS_Mesh* 
 MeshPtr2SMDSMesh( SMESH_Mesh_ptr theMesh )
 {
-  SMESH_Mesh_i* anImplPtr = 
-    dynamic_cast<SMESH_Mesh_i*>( SMESH_Gen_i::GetServant( theMesh ).in() );
+  SMESH_Mesh_i* anImplPtr = DownCast<SMESH_Mesh_i*>(theMesh);
   return anImplPtr ? anImplPtr->GetImpl().GetMeshDS() : 0;
 }
 
@@ -437,6 +435,7 @@ CORBA::Double NumericalFunctor_i::GetValue( CORBA::Long theId )
 void NumericalFunctor_i::SetPrecision( CORBA::Long thePrecision )
 {
   myNumericalFunctorPtr->SetPrecision( thePrecision );
+  TPythonDump()<<this<<".SetPrecision("<<thePrecision<<")";
 }
 
 CORBA::Long NumericalFunctor_i::GetPrecision()
@@ -731,6 +730,7 @@ void BelongToGeom_i::SetGeom( GEOM::GEOM_Object_ptr theGeom )
   GEOM::GEOM_Gen_var aGEOMGen = SMESH_Gen_i::GetGeomEngine();
   TopoDS_Shape aLocShape = aSMESHGen->GetShapeReader()->GetShape( aGEOMGen, theGeom );
   myBelongToGeomPtr->SetGeom( aLocShape );
+  TPythonDump()<<this<<".SetGeom("<<theGeom<<")";
 }
 
 void BelongToGeom_i::SetGeom( const TopoDS_Shape& theShape )
@@ -740,6 +740,7 @@ void BelongToGeom_i::SetGeom( const TopoDS_Shape& theShape )
 
 void BelongToGeom_i::SetElementType(ElementType theType){
   myBelongToGeomPtr->SetType(SMDSAbs_ElementType(theType));
+  TPythonDump()<<this<<".SetElementType("<<theType<<")";
 }
 
 FunctorType BelongToGeom_i::GetFunctorType()
@@ -752,6 +753,7 @@ void BelongToGeom_i::SetShapeName( const char* theName )
   delete myShapeName;
   myShapeName = strdup( theName );
   myBelongToGeomPtr->SetGeom( getShapeByName( myShapeName ) );
+  TPythonDump()<<this<<".SetShapeName('"<<theName<<"')";
 }
 
 char* BelongToGeom_i::GetShapeName()
@@ -795,6 +797,7 @@ void BelongToSurface_i::SetSurface( GEOM::GEOM_Object_ptr theGeom, ElementType t
   }
 
   myElementsOnSurfacePtr->SetSurface( TopoDS_Shape(), (SMDSAbs_ElementType)theType );
+  TPythonDump()<<this<<".SetSurface("<<theGeom<<",'"<<theType<<"')";
 }
 
 void BelongToSurface_i::SetShapeName( const char* theName, ElementType theType )
@@ -802,6 +805,7 @@ void BelongToSurface_i::SetShapeName( const char* theName, ElementType theType )
   delete myShapeName;
   myShapeName = strdup( theName );
   myElementsOnSurfacePtr->SetSurface( getShapeByName( myShapeName ), (SMDSAbs_ElementType)theType );
+  TPythonDump()<<this<<".SetShapeName('"<<theName<<"',"<<theType<<")";
 }
 
 char* BelongToSurface_i::GetShapeName()
@@ -812,6 +816,7 @@ char* BelongToSurface_i::GetShapeName()
 void BelongToSurface_i::SetTolerance( CORBA::Double theToler )
 {
   myElementsOnSurfacePtr->SetTolerance( theToler );
+  TPythonDump()<<this<<".SetTolerance("<<theToler<<")";
 }
 
 CORBA::Double BelongToSurface_i::GetTolerance()
@@ -832,6 +837,7 @@ BelongToPlane_i::BelongToPlane_i()
 void BelongToPlane_i::SetPlane( GEOM::GEOM_Object_ptr theGeom, ElementType theType )
 {
   BelongToSurface_i::SetSurface( theGeom, theType );
+  TPythonDump()<<this<<".SetPlane("<<theGeom<<","<<theType<<")";
 }
 
 FunctorType BelongToPlane_i::GetFunctorType()
@@ -852,6 +858,7 @@ BelongToCylinder_i::BelongToCylinder_i()
 void BelongToCylinder_i::SetCylinder( GEOM::GEOM_Object_ptr theGeom, ElementType theType )
 {
   BelongToSurface_i::SetSurface( theGeom, theType );
+  TPythonDump()<<this<<".SetCylinder("<<theGeom<<","<<theType<<")";
 }
 
 FunctorType BelongToCylinder_i::GetFunctorType()
@@ -883,6 +890,7 @@ void LyingOnGeom_i::SetGeom( GEOM::GEOM_Object_ptr theGeom )
   GEOM::GEOM_Gen_var aGEOMGen = SMESH_Gen_i::GetGeomEngine();
   TopoDS_Shape aLocShape = aSMESHGen->GetShapeReader()->GetShape( aGEOMGen, theGeom );
   myLyingOnGeomPtr->SetGeom( aLocShape );
+  TPythonDump()<<this<<".SetGeom("<<theGeom<<")";
 }
 
 void LyingOnGeom_i::SetGeom( const TopoDS_Shape& theShape )
@@ -892,6 +900,7 @@ void LyingOnGeom_i::SetGeom( const TopoDS_Shape& theShape )
 
 void LyingOnGeom_i::SetElementType(ElementType theType){
   myLyingOnGeomPtr->SetType(SMDSAbs_ElementType(theType));
+  TPythonDump()<<this<<".SetElementType("<<theType<<")";
 }
 
 FunctorType LyingOnGeom_i::GetFunctorType()
@@ -904,6 +913,7 @@ void LyingOnGeom_i::SetShapeName( const char* theName )
   delete myShapeName;
   myShapeName = strdup( theName );
   myLyingOnGeomPtr->SetGeom( getShapeByName( myShapeName ) );
+  TPythonDump()<<this<<".SetShapeName('"<<theName<<"')";
 }
 
 char* LyingOnGeom_i::GetShapeName()
@@ -986,10 +996,12 @@ void RangeOfIds_i::SetRange( const SMESH::long_array& theIds )
   CORBA::Long iEnd = theIds.length();
   for ( CORBA::Long i = 0; i < iEnd; i++ )
     myRangeOfIdsPtr->AddToRange( theIds[ i ] );
+  TPythonDump()<<this<<".SetRange("<<theIds<<")";
 }
 
 CORBA::Boolean RangeOfIds_i::SetRangeStr( const char* theRange )
 {
+  TPythonDump()<<this<<".SetRangeStr('"<<theRange<<"')";
   return myRangeOfIdsPtr->SetRangeStr(
     TCollection_AsciiString( (Standard_CString)theRange ) );
 }
@@ -1004,6 +1016,7 @@ char* RangeOfIds_i::GetRangeStr()
 void RangeOfIds_i::SetElementType( ElementType theType )
 {
   myRangeOfIdsPtr->SetType( SMDSAbs_ElementType( theType ) );
+  TPythonDump()<<this<<".SetElementType("<<theType<<")";
 }
 
 FunctorType RangeOfIds_i::GetFunctorType()
@@ -1028,7 +1041,7 @@ Comparator_i::~Comparator_i()
 void Comparator_i::SetMargin( CORBA::Double theValue )
 {
   myComparatorPtr->SetMargin( theValue );
-  TPythonDump()<<this<<".SetMargin("<<float(theValue)<<")";
+  TPythonDump()<<this<<".SetMargin("<<theValue<<")";
 }
 
 CORBA::Double Comparator_i::GetMargin()
@@ -1041,7 +1054,7 @@ void Comparator_i::SetNumFunctor( NumericalFunctor_ptr theFunct )
   if ( myNumericalFunctor )
     myNumericalFunctor->Destroy();
 
-  myNumericalFunctor = dynamic_cast<NumericalFunctor_i*>( SMESH_Gen_i::GetServant( theFunct ).in() );
+  myNumericalFunctor = DownCast<NumericalFunctor_i*>(theFunct);
 
   if ( myNumericalFunctor )
   {
@@ -1107,7 +1120,7 @@ EqualTo_i::EqualTo_i()
 void EqualTo_i::SetTolerance( CORBA::Double theToler )
 {
   myEqualToPtr->SetTolerance( theToler );
-  TPythonDump()<<this<<".SetTolerance("<<float(theToler)<<")";
+  TPythonDump()<<this<<".SetTolerance("<<theToler<<")";
 }
 
 CORBA::Double EqualTo_i::GetTolerance()
@@ -1821,6 +1834,10 @@ CORBA::Boolean Filter_i::SetCriteria( const SMESH::Filter::Criteria& theCriteria
     const char* aThresholdStr = theCriteria[ i ].ThresholdStr;
     ElementType aTypeOfElem   = theCriteria[ i ].TypeOfElement;
     long        aPrecision    = theCriteria[ i ].Precision;
+
+    TPythonDump()<<this<<".SetCriteria(SMESH.Filter.Criteria("<<
+      aCriterion<<","<<aCompare<<","<<aThreshold<<","<<aUnary<<","<<aBinary<<","<<
+      aTolerance<<",'"<<aThresholdStr<<"',"<<aTypeOfElem<<","<<aPrecision<<")";
     
     SMESH::Predicate_ptr aPredicate = SMESH::Predicate::_nil();
     SMESH::NumericalFunctor_ptr aFunctor = SMESH::NumericalFunctor::_nil();
@@ -2451,7 +2468,9 @@ Filter_ptr FilterLibrary_i::Copy( const char* theFilterName )
 
   aRes = myFilterMgr->CreateFilter();
   aRes->SetCriteria( aCriteriaVar.inout() );
-
+  
+  TPythonDump()<<this<<".Copy('"<<theFilterName<<"')";
+  
   return aRes;
 }
 
@@ -2463,6 +2482,7 @@ void FilterLibrary_i::SetFileName( const char* theFileName )
 {
   delete myFileName;
   myFileName = strdup( theFileName );
+  TPythonDump()<<this<<".SetFileName('"<<theFileName<<"')";
 }
 
 //=======================================================================
@@ -2499,6 +2519,8 @@ CORBA::Boolean FilterLibrary_i::Add( const char* theFilterName, Filter_ptr theFi
   else
   {
     aSection.appendChild( aFilterItem );
+    if(Filter_i* aFilter = DownCast<Filter_i*>(theFilter))
+      TPythonDump()<<this<<".Add('"<<theFilterName<<"',"<<aFilter<<")";
     return true;
   }
 }
@@ -2527,6 +2549,7 @@ CORBA::Boolean FilterLibrary_i::AddEmpty( const char* theFilterName, ElementType
   else
   {
     aSection.appendChild( aFilterItem );
+    TPythonDump()<<this<<".AddEmpty('"<<theFilterName<<"',"<<theType<<")";
     return true;
   }
 }
@@ -2543,6 +2566,7 @@ CORBA::Boolean FilterLibrary_i::Delete ( const char* theFilterName )
     return false;
 
   aParentNode.removeChild( aFilterNode );
+  TPythonDump()<<this<<".Delete('"<<theFilterName<<"')";
   return true;
 }
 
@@ -2565,6 +2589,8 @@ CORBA::Boolean FilterLibrary_i::Replace( const char* theFilterName,
   else                                                                                          
   {
     aFilterItem.ReplaceElement( aNewItem );
+    if(Filter_i* aFilter = DownCast<Filter_i*>(theFilter))
+      TPythonDump()<<this<<".Replace('"<<theFilterName<<"',"<<theNewName<<"',"<<aFilter<<")";
     return true;
   }
 }
@@ -2587,6 +2613,7 @@ CORBA::Boolean FilterLibrary_i::Save()
   aWriter << myDoc;
   fclose( aOutFile );
 
+  TPythonDump()<<this<<".Save()";
   return true;
 }
 
@@ -2597,6 +2624,7 @@ CORBA::Boolean FilterLibrary_i::Save()
 CORBA::Boolean FilterLibrary_i::SaveAs( const char* aFileName )
 {
   myFileName = strdup ( aFileName );
+  TPythonDump()<<this<<".SaveAs('"<<aFileName<<"')";
   return Save();
 }
 
index 7c96b038ca72fe362e0eac78df23f6922ff1d356..7483a6e6acab882f3ae49816785df801f15736c3 100644 (file)
@@ -428,4 +428,16 @@ private:
   std::map < int, Handle(TColStd_HSequenceOfAsciiString) > myPythonScripts;
 };
 
+
+namespace SMESH
+{
+  template<class T>
+  T
+  DownCast(CORBA::Object_ptr theArg)
+  {
+    return dynamic_cast<T>(SMESH_Gen_i::GetServant(theArg).in());
+  }
+}
+
+
 #endif
index 4894c7159f084e9b5102eaf2f121b150599b666d..34545cf65a6bbcc65544e2a6c02fc57b9d49520b 100644 (file)
 #include <SALOMEconfig.h>
 #include CORBA_SERVER_HEADER(SMESH_Mesh)
 
-#include <TCollection_AsciiString.hxx>
+#include <sstream>
 
 namespace SMESH
 {
-  TCollection_AsciiString& 
-  operator<<(TCollection_AsciiString& theString, 
-            const char* theArg);
-
-  TCollection_AsciiString& 
-  operator<<(TCollection_AsciiString& theString, 
-            int theArg);
-
-  TCollection_AsciiString& 
-  operator<<(TCollection_AsciiString& theString, 
-            float theArg);
-
   class FilterLibrary_i;
-  TCollection_AsciiString& 
-  operator<<(TCollection_AsciiString& theString, 
-            SMESH::FilterLibrary_i* theArg);
-
   class FilterManager_i;
-  TCollection_AsciiString& 
-  operator<<(TCollection_AsciiString& theString, 
-            SMESH::FilterManager_i* theArg);
-
   class Filter_i;
-  TCollection_AsciiString& 
-  operator<<(TCollection_AsciiString& theString, 
-            SMESH::Filter_i* theArg);
-
   class Functor_i;
-  TCollection_AsciiString& 
-  operator<<(TCollection_AsciiString& theString, 
-            SMESH::Functor_i* theArg);
-
-  TCollection_AsciiString& 
-  operator<<(TCollection_AsciiString& theString, 
-            CORBA::Object_ptr theArg);
-
-  TCollection_AsciiString& 
-  operator<<(TCollection_AsciiString& theString, 
-            const SMESH::long_array& theArg);
 
   class TPythonDump
   {
-    TCollection_AsciiString myString;
+    std::ostringstream myStream;
     static size_t myCounter;
   public:
     TPythonDump();
     virtual ~TPythonDump();
     
-    template<class T>
-    TCollection_AsciiString& 
-    operator<<(T theArg){
-      return myString<<theArg;
+    TPythonDump& 
+    operator<<(long int theArg){
+      myStream<<theArg;
+      return *this;
+    }
+
+    TPythonDump& 
+    operator<<(int theArg){
+      myStream<<theArg;
+      return *this;
     }
+
+    TPythonDump& 
+    operator<<(double theArg){
+      myStream<<theArg;
+      return *this;
+    }
+
+    TPythonDump& 
+    operator<<(float theArg){
+      myStream<<theArg;
+      return *this;
+    }
+
+    TPythonDump& 
+    operator<<(const void* theArg){
+      myStream<<theArg;
+      return *this;
+    }
+
+    TPythonDump& 
+    operator<<(const char* theArg){
+      myStream<<theArg;
+      return *this;
+    }
+
+    TPythonDump& 
+    operator<<(const SMESH::ElementType& theArg);
+
+    TPythonDump& 
+    operator<<(const SMESH::long_array& theArg);
+
+    TPythonDump& 
+    operator<<(CORBA::Object_ptr theArg);
+
+    TPythonDump& 
+    operator<<(SMESH::FilterLibrary_i* theArg);
+
+    TPythonDump& 
+    operator<<(SMESH::FilterManager_i* theArg);
+
+    TPythonDump& 
+    operator<<(SMESH::Filter_i* theArg);
+
+    TPythonDump& 
+    operator<<(SMESH::Functor_i* theArg);
   };
 }