From: eap Date: Fri, 14 Oct 2005 13:32:41 +0000 (+0000) Subject: PAL10015. Add optional arg theAppend to constructor X-Git-Tag: ForTest_3_1_0a2~1 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=7a7b104ba643ba417559c77e0f0f37c2caf5950a;p=modules%2Fgeom.git PAL10015. Add optional arg theAppend to constructor --- diff --git a/src/GEOM/GEOM_PythonDump.cxx b/src/GEOM/GEOM_PythonDump.cxx index ee18fca2a..86c576c64 100644 --- a/src/GEOM/GEOM_PythonDump.cxx +++ b/src/GEOM/GEOM_PythonDump.cxx @@ -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 ); } } diff --git a/src/GEOM/GEOM_PythonDump.hxx b/src/GEOM/GEOM_PythonDump.hxx index 2bac138ab..0288f4b1a 100644 --- a/src/GEOM/GEOM_PythonDump.hxx +++ b/src/GEOM/GEOM_PythonDump.hxx @@ -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;