X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSMESH_I%2FSMESH_PythonDump.cxx;h=e1033e3bd87875bb3d9a294bec6407f0a1c3ed87;hb=refs%2Fheads%2Feap%2Fedf_improvements_2019;hp=76a23315af3c47681c3df076966e431d69faab9a;hpb=6df8817c1a9827149025cc942249d7083f504d3d;p=modules%2Fsmesh.git diff --git a/src/SMESH_I/SMESH_PythonDump.cxx b/src/SMESH_I/SMESH_PythonDump.cxx index 76a23315a..e1033e3bd 100644 --- a/src/SMESH_I/SMESH_PythonDump.cxx +++ b/src/SMESH_I/SMESH_PythonDump.cxx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2019 CEA/DEN, EDF R&D, OPEN CASCADE // // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS @@ -244,25 +244,6 @@ namespace SMESH return *this; } - template - void DumpArray(const TArray& theArray, TPythonDump & theStream) - { - if ( theArray.length() == 0 ) - { - theStream << "[]"; - } - else - { - theStream << "[ "; - for (CORBA::ULong i = 1; i <= theArray.length(); i++) { - theStream << theArray[i-1]; - if ( i < theArray.length() ) - theStream << ", "; - } - theStream << " ]"; - } - } - TPythonDump& TPythonDump::operator<<(const SMESH::long_array& theArg) { @@ -426,6 +407,7 @@ namespace SMESH case FT_MultiConnection2D: myStream<< "aMultiConnection2D"; break; case FT_Length: myStream<< "aLength"; break; case FT_Length2D: myStream<< "aLength2D"; break; + case FT_Length3D: myStream<< "aLength3D"; break; case FT_Deflection2D: myStream<< "aDeflection2D"; break; case FT_NodeConnectivityNumber:myStream<< "aNodeConnectivityNumber";break; case FT_BelongToMeshGroup: myStream<< "aBelongToMeshGroup"; break; @@ -972,7 +954,7 @@ namespace { //================================================================================ /*! - * \brief Createa a Dump Python script + * \brief Creates a Dump Python script * \param [in,out] theObjectNames - map of an entry to a study and python name * \param [in] theNames - - map of an entry to a study name * \param [in] isPublished - \c true if dump of object publication in study is needed @@ -1001,13 +983,16 @@ TCollection_AsciiString SMESH_Gen_i::DumpPython_impl const TCollection_AsciiString anOldGen ( SMESH::TPythonDump::SMESHGenName() ); const TCollection_AsciiString helper; // to comfortably append C strings to TCollection_AsciiString const TCollection_AsciiString tab( isMultiFile ? "\t" : "" ), nt = helper + "\n" + tab; - + TCollection_AsciiString optionalComment; + std::list< TCollection_AsciiString > lines; // lines of a script std::list< TCollection_AsciiString >::iterator linesIt; lines.push_back( aSMESHGen + " = smeshBuilder.New()" ); - if ( !isPublished ) - lines.push_back( aSMESHGen + ".SetEnablePublish( False )" ); + if ( isPublished ) + optionalComment = "#"; + lines.push_back( optionalComment + aSMESHGen + ".SetEnablePublish( False ) # Set to False to avoid publish in study if not needed or in some particular situations:" ); + lines.push_back( " # multiples meshes built in parallel, complex and numerous mesh edition (performance)\n" ); lines.push_back( helper + "aFilterManager = " + aSMESHGen + ".CreateFilterManager()" ); lines.push_back( helper + "aMeasurements = " + aSMESHGen + ".CreateMeasurements()" );