Salome HOME
projects
/
modules
/
smesh.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
#19765 EDF 21730 - long time to load med file file with huge amount of groups
[modules/smesh.git]
/
src
/
SMESH_I
/
SMESH_PythonDump.cxx
diff --git
a/src/SMESH_I/SMESH_PythonDump.cxx
b/src/SMESH_I/SMESH_PythonDump.cxx
index 5c9163bf42e3d55b2439accd1f2d58e33f2f5636..04a0fc9a88c98000cfb7f422bbc9150e1ade3761 100644
(file)
--- a/
src/SMESH_I/SMESH_PythonDump.cxx
+++ b/
src/SMESH_I/SMESH_PythonDump.cxx
@@
-1,4
+1,4
@@
-// Copyright (C) 2007-20
19
CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-20
20
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
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
@@
-32,6
+32,7
@@
#include "SMESH_Gen_i.hxx"
#include "SMESH_MeshEditor_i.hxx"
#include "SMESH_Gen_i.hxx"
#include "SMESH_MeshEditor_i.hxx"
+#include <Basics_Utils.hxx>
#include <SALOMEDS_wrap.hxx>
#include <LDOMParser.hxx>
#include <SALOMEDS_wrap.hxx>
#include <LDOMParser.hxx>
@@
-244,25
+245,6
@@
namespace SMESH
return *this;
}
return *this;
}
- template<class TArray>
- 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)
{
TPythonDump&
TPythonDump::operator<<(const SMESH::long_array& theArg)
{
@@
-686,7
+668,7
@@
namespace SMESH
void printException( const char* text )
{
#ifdef _DEBUG_
void printException( const char* text )
{
#ifdef _DEBUG_
-
cout << "Exception in SMESH_Gen_i::DumpPython(): " << text <<
endl;
+
std::cout << "Exception in SMESH_Gen_i::DumpPython(): " << text << std::
endl;
#endif
}
#endif
}
@@
-714,10
+696,13
@@
namespace SMESH
//function : DumpPython
//purpose :
//=======================================================================
//function : DumpPython
//purpose :
//=======================================================================
-Engines::TMPFile* SMESH_Gen_i::DumpPython
(
CORBA::Boolean isPublished,
+Engines::TMPFile* SMESH_Gen_i::DumpPython
(
CORBA::Boolean isPublished,
CORBA::Boolean isMultiFile,
CORBA::Boolean& isValidScript)
{
CORBA::Boolean isMultiFile,
CORBA::Boolean& isValidScript)
{
+ // localizing
+ Kernel_Utils::Localizer loc;
+
SALOMEDS::Study_var aStudy = getStudyServant();
if (CORBA::is_nil(aStudy))
return new Engines::TMPFile(0);
SALOMEDS::Study_var aStudy = getStudyServant();
if (CORBA::is_nil(aStudy))
return new Engines::TMPFile(0);
@@
-973,7
+958,7
@@
namespace {
//================================================================================
/*!
//================================================================================
/*!
- * \brief Create
a
a Dump Python script
+ * \brief Create
s
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
* \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
@@
-1076,12
+1061,15
@@
TCollection_AsciiString SMESH_Gen_i::DumpPython_impl
isHistoricalDump );
bool importGeom = false;
isHistoricalDump );
bool importGeom = false;
- GEOM::GEOM_Gen_ptr geom = GetGeomEngine();
+ GEOM::GEOM_Gen_ptr geom[2];
+ for ( int isShaper = 0; isShaper < 2; ++isShaper )
{
{
+ geom[ isShaper ] = GetGeomEngine( isShaper );
+ if ( CORBA::is_nil( geom[ isShaper ]))
+ continue;
// Add names of GEOM objects to theObjectNames to exclude same names of SMESH objects
// Add names of GEOM objects to theObjectNames to exclude same names of SMESH objects
- GEOM::string_array_var aGeomNames = geom->GetAllDumpNames();
- int ign = 0, nbgn = aGeomNames->length();
- for (; ign < nbgn; ign++) {
+ GEOM::string_array_var aGeomNames = geom[ isShaper ]->GetAllDumpNames();
+ for ( CORBA::ULong ign = 0; ign < aGeomNames->length(); ign++) {
TCollection_AsciiString aName = aGeomNames[ign].in();
theObjectNames.Bind(aName, "1");
}
TCollection_AsciiString aName = aGeomNames[ign].in();
theObjectNames.Bind(aName, "1");
}
@@
-1115,7
+1103,11
@@
TCollection_AsciiString SMESH_Gen_i::DumpPython_impl
anUpdatedScript += aLine.SubString( aStart, aSeq->Value(i) - 1 ); // line part before i-th entry
anEntry = aLine.SubString( aSeq->Value(i), aSeq->Value(i + 1) );
// is a GEOM object?
anUpdatedScript += aLine.SubString( aStart, aSeq->Value(i) - 1 ); // line part before i-th entry
anEntry = aLine.SubString( aSeq->Value(i), aSeq->Value(i + 1) );
// is a GEOM object?
- CORBA::String_var geomName = geom->GetDumpName( anEntry.ToCString() );
+ CORBA::String_var geomName;
+ if ( !CORBA::is_nil( geom[0] ))
+ geomName = geom[0]->GetDumpName( anEntry.ToCString() );
+ if (( !geomName.in() || !geomName.in()[0] ) && !CORBA::is_nil( geom[1] ))
+ geomName = geom[1]->GetDumpName( anEntry.ToCString() );
if ( !geomName.in() || !geomName.in()[0] ) {
// is a SMESH object
if ( theObjectNames.IsBound( anEntry )) {
if ( !geomName.in() || !geomName.in()[0] ) {
// is a SMESH object
if ( theObjectNames.IsBound( anEntry )) {