1 // Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
2 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
4 // This library is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU Lesser General Public
6 // License as published by the Free Software Foundation; either
7 // version 2.1 of the License.
9 // This library is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 // Lesser General Public License for more details.
14 // You should have received a copy of the GNU Lesser General Public
15 // License along with this library; if not, write to the Free Software
16 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 // See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
20 #include "GEOM_PythonDump.hxx"
22 #include <TDF_Tool.hxx>
26 size_t TPythonDump::myCounter = 0;
28 TPythonDump::TPythonDump (Handle(GEOM_Function)& theFunction)
30 myFunction = theFunction;
34 TPythonDump::~TPythonDump()
36 if (--myCounter == 0) {
37 myFunction->SetDescription((char *)myStream.str().c_str());
41 // TPythonDump::operator TCollection_AsciiString () const
43 // if (myCounter == 1) {
44 // return TCollection_AsciiString ((char *)myStream.str().c_str());
46 // return TCollection_AsciiString ();
49 TPythonDump& TPythonDump::operator<< (long int theArg)
55 TPythonDump& TPythonDump::operator<< (int theArg)
61 TPythonDump& TPythonDump::operator<< (double theArg)
63 myStream.precision(16);
68 TPythonDump& TPythonDump::operator<< (float theArg)
70 myStream.precision(8);
75 TPythonDump& TPythonDump::operator<< (const void* theArg)
81 TPythonDump& TPythonDump::operator<< (const char* theArg)
87 TPythonDump& TPythonDump::operator<< (const Handle(GEOM_Object)& theObject)
89 TCollection_AsciiString anEntry;
90 TDF_Tool::Entry(theObject->GetEntry(), anEntry);
91 myStream << anEntry.ToCString();