]> SALOME platform Git repositories - modules/geom.git/commitdiff
Salome HOME
PAL10015. Add optional arg theAppend to constructor
authoreap <eap@opencascade.com>
Fri, 14 Oct 2005 13:32:41 +0000 (13:32 +0000)
committereap <eap@opencascade.com>
Fri, 14 Oct 2005 13:32:41 +0000 (13:32 +0000)
src/GEOM/GEOM_PythonDump.cxx
src/GEOM/GEOM_PythonDump.hxx

index ee18fca2a4b4b2ba0eeb2a8e3954a5ed829d320d..86c576c643e8349d9776498b51122467207b55fc 100644 (file)
@@ -25,16 +25,21 @@ namespace GEOM
 {
   size_t TPythonDump::myCounter = 0;
 
-  TPythonDump::TPythonDump (Handle(GEOM_Function)& theFunction)
+  TPythonDump::TPythonDump (Handle(GEOM_Function)& theFunction, bool theAppend)
   {
     myFunction = theFunction;
     myCounter++;
+    myAppend = theAppend;
   }
 
   TPythonDump::~TPythonDump()
   {
     if (--myCounter == 0) {
-      myFunction->SetDescription((char *)myStream.str().c_str());
+      TCollection_AsciiString aDescr;
+      if ( myAppend )
+        aDescr = myFunction->GetDescription() + "\n\t";
+      aDescr += (char *)myStream.str().c_str();
+      myFunction->SetDescription( aDescr );
     }
   }
 
index 2bac138ab4ef525ec1b5383c0b8d93fa4649d2b3..0288f4b1a16e6cf423e6c43b9c6cc124c3ac607a 100644 (file)
@@ -32,12 +32,13 @@ namespace GEOM
   class TPythonDump
   {
     std::ostringstream myStream;
-    static size_t myCounter;
+    static size_t      myCounter;
+    bool               myAppend;
 
     Handle(GEOM_Function) myFunction;
 
   public:
-    Standard_EXPORT TPythonDump (Handle(GEOM_Function)& theFunction);
+    Standard_EXPORT TPythonDump (Handle(GEOM_Function)& theFunction, bool theAppend=false);
     Standard_EXPORT virtual ~TPythonDump();
 
 //    operator TCollection_AsciiString () const;