DumpArray( theList, *this );
return *this;
}
+ TPythonDump& TPythonDump::operator<<(const SMESH::submesh_array& theList)
+ {
+ DumpArray( theList, *this );
+ return *this;
+ }
+ TPythonDump& TPythonDump::operator<<(const SMESH::ListOfHypothesis& theList)
+ {
+ DumpArray( theList, *this );
+ return *this;
+ }
TPythonDump& TPythonDump::operator<<(const SMESH::CoincidentFreeBorders& theCFB)
{
// dump CoincidentFreeBorders as a list of lists, each enclosed list
cout << "Exception in SMESH_Gen_i::DumpPython(): " << text << endl;
#endif
}
-}
//=======================================================================
//function : RemoveTabulation
//purpose :
//=======================================================================
-void RemoveTabulation( TCollection_AsciiString& theScript )
-{
- std::string aString( theScript.ToCString() );
- std::string::size_type aPos = 0;
- while( aPos < aString.length() )
+ void RemoveTabulation( TCollection_AsciiString& theScript )
{
- aPos = aString.find( "\n\t", aPos );
- if( aPos == std::string::npos )
- break;
- aString.replace( aPos, 2, "\n" );
- aPos++;
+ std::string aString( theScript.ToCString() );
+ std::string::size_type aPos = 0;
+ while( aPos < aString.length() )
+ {
+ aPos = aString.find( "\n\t", aPos );
+ if( aPos == std::string::npos )
+ break;
+ aString.replace( aPos, 2, "\n" );
+ aPos++;
+ }
+ theScript = aString.c_str();
}
- theScript = aString.c_str();
}
//=======================================================================
//function : DumpPython
//purpose :
//=======================================================================
-Engines::TMPFile* SMESH_Gen_i::DumpPython (CORBA::Boolean isPublished,
- CORBA::Boolean isMultiFile,
+Engines::TMPFile* SMESH_Gen_i::DumpPython (CORBA::Boolean isPublished,
+ CORBA::Boolean isMultiFile,
CORBA::Boolean& isValidScript)
{
SALOMEDS::Study_var aStudy = getStudyServant();
std::list< TCollection_AsciiString > lines; // lines of a script
std::list< TCollection_AsciiString >::iterator linesIt;
- if ( isPublished )
- lines.push_back( aSMESHGen + " = smeshBuilder.New()" );
- else
- lines.push_back( aSMESHGen + " = smeshBuilder.New(False)" );
+ lines.push_back( aSMESHGen + " = smeshBuilder.New()" );
+ if ( !isPublished )
+ lines.push_back( aSMESHGen + ".SetEnablePublish( False )" );
lines.push_back( helper + "aFilterManager = " + aSMESHGen + ".CreateFilterManager()" );
lines.push_back( helper + "aMeasurements = " + aSMESHGen + ".CreateMeasurements()" );
}
// import python files corresponding to plugins if they are used in anUpdatedScript
{
- TCollection_AsciiString importStr;
+ //TCollection_AsciiString importStr;
std::vector<std::string> pluginNames = getPluginNames();
for ( size_t i = 0; i < pluginNames.size(); ++i )
{
// Convert access to plugin members:
- // e.g. StdMeshers.QUAD_REDUCED -> StdMeshersBuilder.QUAD_REDUCED
+ // e.g. StdMeshers.QUAD_REDUCED -> smeshBuilder.QUAD_REDUCED
TCollection_AsciiString pluginAccess = (pluginNames[i] + ".").c_str() ;
int iFrom = 1, iPos;
while (( iPos = anUpdatedScript.Location( pluginAccess, iFrom, anUpdatedScript.Length() )))
{
- anUpdatedScript.Insert( iPos + pluginNames[i].size(), "Builder" );
- iFrom = iPos + pluginNames[i].size() + 8;
+ //anUpdatedScript.Insert( iPos + pluginNames[i].size(), "Builder" );
+ anUpdatedScript.Remove( iPos, pluginNames[i].size() );
+ anUpdatedScript.Insert( iPos, "smeshBuilder" );
+ iFrom = iPos - pluginNames[i].size() + 12;
}
// if any plugin member is used, import the plugin
- if ( iFrom > 1 )
- importStr += ( helper + "\n" "from salome." + pluginNames[i].c_str() +
- " import " + pluginNames[i].c_str() +"Builder" );
+ // if ( iFrom > 1 )
+ // importStr += ( helper + "\n" "from salome." + pluginNames[i].c_str() +
+ // " import " + pluginNames[i].c_str() +"Builder" );
}
- if ( !importStr.IsEmpty() )
- initPart += importStr + "\n";
+ // if ( !importStr.IsEmpty() )
+ // initPart += importStr + "\n";
}
if ( isMultiFile )