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.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 #ifndef _SMESH_PYTHONDUMP_HXX_
21 #define _SMESH_PYTHONDUMP_HXX_
25 #include <SALOMEconfig.h>
26 #include CORBA_SERVER_HEADER(SMESH_Mesh)
27 #include CORBA_SERVER_HEADER(SALOMEDS)
32 class SMESH_MeshEditor_i;
33 class TCollection_AsciiString;
37 class FilterLibrary_i;
38 class FilterManager_i;
42 class SMESH_I_EXPORT TPythonDump
44 std::ostringstream myStream;
45 static size_t myCounter;
48 virtual ~TPythonDump();
51 operator<<(long int theArg);
54 operator<<(int theArg);
57 operator<<(double theArg);
60 operator<<(float theArg);
63 operator<<(const void* theArg);
66 operator<<(const char* theArg);
69 operator<<(const SMESH::ElementType& theArg);
72 operator<<(const SMESH::long_array& theArg);
75 operator<<(const SMESH::double_array& theArg);
78 operator<<(SALOMEDS::SObject_ptr theArg);
81 operator<<(CORBA::Object_ptr theArg);
84 operator<<(SMESH::FilterLibrary_i* theArg);
87 operator<<(SMESH::FilterManager_i* theArg);
90 operator<<(SMESH::Filter_i* theArg);
93 operator<<(SMESH::Functor_i* theArg);
96 operator<<(SMESH_Gen_i* theArg);
99 operator<<(SMESH_MeshEditor_i* theArg);
102 operator<<(SMESH::MED_VERSION theArg);
105 operator<<(const SMESH::AxisStruct & theAxis);
108 operator<<(const SMESH::DirStruct & theDir);
111 operator<<(const TCollection_AsciiString & theArg);
113 static char* SMESHGenName() { return "smeshgen"; }
114 static char* MeshEditorName() { return "mesh_editor"; }
117 * \brief Return marker of long string literal beginning
118 * \param type - a name of functionality producing the string literal
119 * \retval TCollection_AsciiString - the marker string to be written into
120 * a raw python script
122 static TCollection_AsciiString LongStringStart(const char* type);
124 * \brief Return marker of long string literal end
125 * \retval TCollection_AsciiString - the marker string to be written into
126 * a raw python script
128 static TCollection_AsciiString LongStringEnd();
130 * \brief Cut out a long string literal from a string
131 * \param theText - text possibly containing string literals
132 * \param theFrom - position in the text to search from
133 * \param theLongString - the retrieved literal
134 * \param theStringType - a name of functionality produced the literal
135 * \retval bool - true if a string literal found
137 * The literal is removed from theText; theFrom points position right after
138 * the removed literal
140 static bool CutoutLongString( TCollection_AsciiString & theText,
142 TCollection_AsciiString & theLongString,
143 TCollection_AsciiString & theStringType);