SALOMEDS::SObject_wrap aSO = PublishHypothesis( hyp );
if ( !aSO->_is_nil() ) {
// Update Python script
- TPythonDump() << aSO << " = " << this << ".CreateHypothesis('"
+ TPythonDump(this) << aSO << " = " << this << ".CreateHypothesis('"
<< theHypName << "', '" << theLibName << "')";
}
}
initParams );
SALOMEDS::SObject_wrap so = PublishHypothesis( hyp );
- TPythonDump() << hyp << " = " << this << ".CreateHypothesisByAverageLength( '"
+ TPythonDump(this) << hyp << " = " << this << ".CreateHypothesisByAverageLength( '"
<< theHypType << "', '"
<< theLibName << "', "
<< theAverageLength << ", "
aStudyBuilder->CommitCommand();
if ( !aSO->_is_nil() ) {
// Update Python script
- TPythonDump() << aSO << " = " << this << ".CreateMesh(" << theShapeObject << ")";
+ TPythonDump(this) << aSO << " = " << this << ".CreateMesh(" << theShapeObject << ")";
}
}
aStudyBuilder->CommitCommand();
if ( !aSO->_is_nil() ) {
// Update Python script
- TPythonDump() << aSO << " = " << this << ".CreateEmptyMesh()";
+ TPythonDump(this) << aSO << " = " << this << ".CreateEmptyMesh()";
}
}
aStudyBuilder->CommitCommand();
if ( !aSO->_is_nil() ) {
// Update Python script
- TPythonDump() << aSO << " = " << this << ".CreateMeshesFromUNV(r'" << theFileName << "')";
+ TPythonDump(this) << aSO << " = " << this << ".CreateMeshesFromUNV(r'" << theFileName << "')";
}
}
{ // open a new scope to make aPythonDump die before PythonDump in SMESH_Mesh::GetGroups()
// Python Dump
- TPythonDump aPythonDump;
+ TPythonDump aPythonDump(this);
aPythonDump << "([";
if (theStatus == SMESH::DRS_OK) {
aStudyBuilder->CommitCommand();
if ( !aSO->_is_nil() ) {
// Update Python script
- TPythonDump() << aSO << " = " << this << ".CreateMeshesFromSTL(r'" << theFileName << "')";
+ TPythonDump(this) << aSO << " = " << this << ".CreateMeshesFromSTL(r'" << theFileName << "')";
}
}
{ // open a new scope to make aPythonDump die before PythonDump in SMESH_Mesh::GetGroups()
// Python Dump
- TPythonDump aPythonDump;
+ TPythonDump aPythonDump(this);
aPythonDump << "([";
if (theStatus == SMESH::DRS_OK)
aStudyBuilder->CommitCommand();
if ( !aSO->_is_nil() ) {
// Update Python script
- TPythonDump() << "("<< aSO << ", error) = " << this << ".CreateMeshesFromGMF(r'"
+ TPythonDump(this) << "("<< aSO << ", error) = " << this << ".CreateMeshesFromGMF(r'"
<< theFileName << "', "
<< theMakeRequiredGroups << " )";
}
if ( SMESH_Mesh_i* meshServant = SMESH::DownCast<SMESH_Mesh_i*>( theMesh ))
{
groups = meshServant->MakeGroupsOfBadInputElements( theSubShapeID, theGroupName );
- TPythonDump() << groups << " = " << this
+ TPythonDump(this) << groups << " = " << this
<< ".MakeGroupsOfBadInputElements( "
<< theMesh << ", " << theSubShapeID << ", '" << theGroupName << "' )";
}
SALOME::BAD_PARAM );
// Update Python script
- TPythonDump() << "isDone = " << this << ".Compute( "
+ TPythonDump(this) << "isDone = " << this << ".Compute( "
<< theMesh << ", " << theShapeObject << ")";
try {
nbels[i] = 0;
// Update Python script
- TPythonDump() << "theNbElems = " << this << ".Evaluate( "
+ TPythonDump(this) << "theNbElems = " << this << ".Evaluate( "
<< theMesh << ", " << theShapeObject << ")";
try {
CORBA::Boolean theCommonGroups,
SMESH::SMESH_Mesh_ptr theMeshToAppendTo)
{
- std::unique_ptr< TPythonDump > pPythonDump( new TPythonDump );
+ std::unique_ptr< TPythonDump > pPythonDump( new TPythonDump(this) );
TPythonDump& pythonDump = *pPythonDump; // prevent dump of called methods
// create mesh if theMeshToAppendTo not provided
{
Unexpect aCatch(SALOME_SalomeException);
- TPythonDump* pyDump = new TPythonDump; // prevent dump from CreateMesh()
+ TPythonDump* pyDump = new TPythonDump(this); // prevent dump from CreateMesh()
std::unique_ptr<TPythonDump> pyDumpDeleter( pyDump );
// 1. Get source mesh
bool ok = true;
SMESH_TRY;
- TPythonDump pyDump; // prevent dump from CreateMesh()
+ TPythonDump pyDump(this); // prevent dump from CreateMesh()
theNewMesh = CreateMesh( theNewGeometry );
theNewGroups = new SMESH::ListOfGroups();
SMESH::SMESH_Mesh_var myMesh = SMESH::SMESH_Mesh::_narrow( anObject ) ;
if ( !myMesh->_is_nil() ) {
myMesh->Load(); // load from study file if not yet done
- TPythonDump pd; // not to dump GetGroups()
+ TPythonDump pd(this); // not to dump GetGroups()
SMESH::ListOfGroups_var groups = myMesh->GetGroups();
for ( CORBA::ULong i = 0; i < groups->length(); ++i )
{
return false;
}
- TPythonDump pd; // prevent dump during loading
+ TPythonDump pd(this); // prevent dump during loading
// For PAL13473 ("Repetitive mesh") implementation.
// New dependencies between SMESH objects are established:
THROW_SALOME_CORBA_EXCEPTION(S_ex.what(), SALOME::BAD_PARAM);
}
- TPythonDump() << SMESH::SMESH_Mesh_var(_this()) << ".Clear()";
+ TPythonDump(_gen_i) << SMESH::SMESH_Mesh_var(_this()) << ".Clear()";
SMESH::SMESH_Mesh_var mesh = _this();
_gen_i->UpdateIcons( mesh );
}
_impl->GetMeshDS()->Modified();
- TPythonDump() << SMESH::SMESH_Mesh_var(_this()) << ".ClearSubMesh( " << ShapeID << " )";
+ TPythonDump(_gen_i) << SMESH::SMESH_Mesh_var(_this()) << ".ClearSubMesh( " << ShapeID << " )";
}
//=============================================================================
if(MYDEBUG) MESSAGE( " AddHypothesis(): status = " << status );
// Update Python script
- TPythonDump() << "status = " << mesh << ".AddHypothesis( "
+ TPythonDump(_gen_i) << "status = " << mesh << ".AddHypothesis( "
<< aSubShape << ", " << anHyp << " )";
return ConvertHypothesisStatus(status);
}
// Update Python script
if(_impl->HasShapeToMesh())
- TPythonDump() << "status = " << mesh << ".RemoveHypothesis( "
+ TPythonDump(_gen_i) << "status = " << mesh << ".RemoveHypothesis( "
<< aSubShape << ", " << anHyp << " )";
else
- TPythonDump() << "status = " << mesh << ".RemoveHypothesis( "
+ TPythonDump(_gen_i) << "status = " << mesh << ".RemoveHypothesis( "
<< anHyp << " )";
return ConvertHypothesisStatus(status);
SMESH::submesh_array_var aList = new SMESH::submesh_array();
// Python Dump
- TPythonDump aPythonDump;
+ TPythonDump aPythonDump(_gen_i);
if ( !_mapSubMeshIor.empty() )
aPythonDump << "[ ";
_gen_i->PublishSubMesh( aMesh, subMesh, aSubShape, theName );
if ( !aSO->_is_nil()) {
// Update Python script
- TPythonDump() << aSO << " = " << aMesh << ".GetSubMesh( "
+ TPythonDump(_gen_i) << aSO << " = " << aMesh << ".GetSubMesh( "
<< aSubShape << ", '" << theName << "' )";
}
}
builder->RemoveObjectWithChildren( anSO );
// Update Python script
- TPythonDump() << SMESH::SMESH_Mesh_var( _this() ) << ".RemoveSubMesh( " << anSO << " )";
+ TPythonDump(_gen_i) << SMESH::SMESH_Mesh_var( _this() ) << ".RemoveSubMesh( " << anSO << " )";
}
if ( removeSubMesh( theSubMesh, aSubShape.in() ))
_gen_i->PublishGroup( mesh, aNewGroup, GEOM::GEOM_Object::_nil(), theName);
if ( !aSO->_is_nil())
// Update Python script
- TPythonDump() << aSO << " = " << mesh << ".CreateGroup( "
+ TPythonDump(_gen_i) << aSO << " = " << mesh << ".CreateGroup( "
<< theElemType << ", '" << theName << "' )";
}
return aNewGroup._retn();
SALOMEDS::SObject_wrap aSO =
_gen_i->PublishGroup( mesh, aNewGroup, theGeomObj, theName );
if ( !aSO->_is_nil())
- TPythonDump() << aSO << " = " << mesh << ".CreateGroupFromGEOM( "
+ TPythonDump(_gen_i) << aSO << " = " << mesh << ".CreateGroupFromGEOM( "
<< theElemType << ", '" << theName << "', " << theGeomObj << " )";
}
}
SMESH::SMESH_GroupOnFilter_var aNewGroup = SMESH::SMESH_GroupOnFilter::_narrow
( createGroup( theElemType, theName, /*id=*/-1, TopoDS_Shape(), predicate ));
- TPythonDump pd;
+ TPythonDump pd(_gen_i);
if ( !aNewGroup->_is_nil() )
aNewGroup->SetFilter( theFilter );
if ( !aGroupSO->_is_nil() )
{
// Update Python script
- TPythonDump() << SMESH::SMESH_Mesh_var(_this()) << ".RemoveGroup( " << aGroupSO << " )";
+ TPythonDump(_gen_i) << SMESH::SMESH_Mesh_var(_this()) << ".RemoveGroup( " << aGroupSO << " )";
// Remove group's SObject
- SALOMEDS::StudyBuilder_var builder = SMESH_Gen_i::getStudyServant()->NewBuilder();
+ SALOMEDS::StudyBuilder_var builder = _gen_i->getStudyServant()->NewBuilder();
builder->RemoveObjectWithChildren( aGroupSO );
}
aGroup->Modified(/*removed=*/true); // notify dependent Filter with FT_BelongToMeshGroup criterion
std::vector< const SMDS_MeshElement* > elems( theGroup->Size() );
elems.assign( elemBeg, elemEnd );
- TPythonDump pyDump; // Suppress dump from RemoveGroup()
+ TPythonDump pyDump(_gen_i); // Suppress dump from RemoveGroup()
// Remove group
RemoveGroup( theGroup );
SMESH::ListOfGroups_var aList = new SMESH::ListOfGroups();
// Python Dump
- TPythonDump aPythonDump;
+ TPythonDump aPythonDump(_gen_i);
if ( !_mapGroups.empty() )
{
aPythonDump << "[ ";
if ( theGroup1->GetType() != theGroup2->GetType() )
THROW_SALOME_CORBA_EXCEPTION("UnionGroups(): different group types",
SALOME::BAD_PARAM);
- TPythonDump pyDump;
+ TPythonDump pyDump(_gen_i);
// Create Union
aResGrp = CreateGroup( theGroup1->GetType(), theName );
if ( aType == SMESH::ALL )
return SMESH::SMESH_Group::_nil();
- TPythonDump pyDump;
+ TPythonDump pyDump(_gen_i);
// Create Union
aResGrp = CreateGroup( aType, theName );
if ( theGroup1->GetType() != theGroup2->GetType() )
THROW_SALOME_CORBA_EXCEPTION("IntersectGroups(): different group types",
SALOME::BAD_PARAM);
- TPythonDump pyDump;
+ TPythonDump pyDump(_gen_i);
// Create Intersection
aResGrp = CreateGroup( theGroup1->GetType(), theName );
if ( aType == SMESH::ALL ) // all groups are nil
return SMESH::SMESH_Group::_nil();
- TPythonDump pyDump;
+ TPythonDump pyDump(_gen_i);
// Create a group
aResGrp = CreateGroup( aType, theName );
if ( theGroup1->GetType() != theGroup2->GetType() )
THROW_SALOME_CORBA_EXCEPTION("CutGroups(): different group types",
SALOME::BAD_PARAM);
- TPythonDump pyDump;
+ TPythonDump pyDump(_gen_i);
aResGrp = CreateGroup( theGroup1->GetType(), theName );
if ( aResGrp->_is_nil() )
toolGroupVec.push_back( grpDS );
}
- TPythonDump pyDump;
+ TPythonDump pyDump(_gen_i);
// Create a group
aResGrp = CreateGroup( aType, theName );
// Create a group
- TPythonDump pyDump;
+ TPythonDump pyDump(_gen_i);
aResGrp = CreateGroup( theElemType, theName );
if ( aResGrp->_is_nil() )
SMESH::ListOfGroups_var resultGroups = new SMESH::ListOfGroups;
- TPythonDump pyDump;
+ TPythonDump pyDump(_gen_i);
SMESH_TRY;
if ( _preMeshInfo )
_gen_i->UpdateIcons( SMESH::SMESH_Mesh_var( _this() ));
}
- TPythonDump() << "SHAPERSTUDY.breakLinkForSubElements(salome.ObjectToSObject("
+ TPythonDump(_gen_i) << "SHAPERSTUDY.breakLinkForSubElements(salome.ObjectToSObject("
<< me <<".GetMesh()), " << entry.in() << ")";
- TPythonDump() << me << ".ReplaceShape( " << entry.in() << " )";
+ TPythonDump(_gen_i)<< me << ".ReplaceShape( " << entry.in() << " )";
}
SMESH::SMESH_Mesh_var me = _this();
GEOM::GEOM_Object_var mainGO = GetShapeToMesh();
- TPythonDump dumpNothing; // prevent any dump
+ TPythonDump dumpNothing(_gen_i); // prevent any dump
//bool removedFromClient = false;
SALOMEDS::StudyBuilder_var builder;
SALOMEDS::SObject_wrap aGroupSO;
- SALOMEDS::Study_var aStudy = SMESH_Gen_i::getStudyServant();
+ SALOMEDS::Study_var aStudy = _gen_i->getStudyServant();
if ( !aStudy->_is_nil() ) {
builder = aStudy->NewBuilder();
aGroupSO = _gen_i->ObjectToSObject( theGroup );
builder->RemoveObject( so );
}
// Update Python script
- TPythonDump() << aGroupSO << " = " << SMESH::SMESH_Mesh_var(_this())
+ TPythonDump(_gen_i) << aGroupSO << " = " << SMESH::SMESH_Mesh_var(_this())
<< ".ConvertToStandalone( " << aGroupSO << " )";
// change icon of Group on Filter
aMeshEdVar = _editor->_this();
// Update Python script
- TPythonDump() << _editor << " = "
+ TPythonDump(_gen_i) << _editor << " = "
<< SMESH::SMESH_Mesh_var(_this()) << ".GetMeshEditor()";
SMESH_CATCH( SMESH::throwCorbaException );
Unexpect aCatch(SALOME_SalomeException);
_impl->SetAutoColor(theAutoColor);
- TPythonDump pyDump; // not to dump group->SetColor() from below code
+ TPythonDump pyDump(_gen_i); // not to dump group->SetColor() from below code
pyDump << SMESH::SMESH_Mesh_var(_this()) <<".SetAutoColor( "<<theAutoColor<<" )";
std::list<SALOMEDS::Color> aReservedColors;
// Perform Export
PrepareForWriting(file, overwrite);
string aMeshName = "Mesh";
- SALOMEDS::Study_var aStudy = SMESH_Gen_i::getStudyServant();
+ SALOMEDS::Study_var aStudy = _gen_i->getStudyServant();
if ( !aStudy->_is_nil() ) {
SALOMEDS::SObject_wrap aMeshSO = _gen_i->ObjectToSObject( _this() );
if ( !aMeshSO->_is_nil() ) {
}
// Update Python script
// set name of mesh before export
- TPythonDump() << _gen_i << ".SetName("
+ TPythonDump(_gen_i) << _gen_i << ".SetName("
<< SMESH::SMESH_Mesh_var(_this()) << ", '" << aMeshName.c_str() << "')";
// check names of groups
string aMeshName = prepareMeshNameAndGroups(file, overwrite);
_impl->ExportMED( file, aMeshName.c_str(), auto_groups, version, 0, autoDimension );
- TPythonDump() << SMESH::SMESH_Mesh_var(_this()) << ".ExportMED( r'"
+ TPythonDump(_gen_i) << SMESH::SMESH_Mesh_var(_this()) << ".ExportMED( r'"
<< file << "', "
<< "auto_groups=" <<auto_groups << ", "
<< "version=" << version << ", "
_preMeshInfo->FullLoadFromFile();
string aMeshName = prepareMeshNameAndGroups(file, true);
- TPythonDump() << SMESH::SMESH_Mesh_var( _this())
+ TPythonDump(_gen_i) << SMESH::SMESH_Mesh_var( _this())
<< ".ExportSAUV( r'" << file << "', " << auto_groups << " )";
_impl->ExportSAUV(file, aMeshName.c_str(), auto_groups);
}
// Update Python script
// check names of groups
checkGroupNames();
- TPythonDump() << SMESH::SMESH_Mesh_var(_this()) << ".ExportDAT( r'" << file << "' )";
+ TPythonDump(_gen_i) << SMESH::SMESH_Mesh_var(_this()) << ".ExportDAT( r'" << file << "' )";
// Perform Export
PrepareForWriting(file);
// Update Python script
// check names of groups
checkGroupNames();
- TPythonDump() << SMESH::SMESH_Mesh_var(_this()) << ".ExportUNV( r'" << file << "' )";
+ TPythonDump(_gen_i) << SMESH::SMESH_Mesh_var(_this()) << ".ExportUNV( r'" << file << "' )";
// Perform Export
PrepareForWriting(file);
// Update Python script
// check names of groups
checkGroupNames();
- TPythonDump() << SMESH::SMESH_Mesh_var(_this())
+ TPythonDump(_gen_i) << SMESH::SMESH_Mesh_var(_this())
<< ".ExportSTL( r'" << file << "', " << isascii << " )";
CORBA::String_var name;
GEOM::GEOM_BaseObject_var gbo = GEOM::GEOM_BaseObject::_narrow( fields[i] );
goList[i] = gbo;
}
- TPythonDump() << _this() << ".ExportPartToMED( "
+ TPythonDump(_gen_i) << _this() << ".ExportPartToMED( "
<< meshPart << ", r'"
<< file << "', "
<< auto_groups << ", "
SMESH_MeshPartDS partDS( meshPart );
_impl->ExportDAT(file,&partDS);
- TPythonDump() << SMESH::SMESH_Mesh_var(_this())
+ TPythonDump(_gen_i) << SMESH::SMESH_Mesh_var(_this())
<< ".ExportPartToDAT( " << meshPart << ", r'" << file << "' )";
}
//================================================================================
SMESH_MeshPartDS partDS( meshPart );
_impl->ExportUNV(file, &partDS);
- TPythonDump() << SMESH::SMESH_Mesh_var(_this())
+ TPythonDump(_gen_i) << SMESH::SMESH_Mesh_var(_this())
<< ".ExportPartToUNV( " << meshPart<< ", r'" << file << "' )";
}
//================================================================================
SMESH_MeshPartDS partDS( meshPart );
_impl->ExportSTL( file, isascii, name.in(), &partDS );
- TPythonDump() << SMESH::SMESH_Mesh_var(_this()) << ".ExportPartToSTL( "
+ TPythonDump(_gen_i) << SMESH::SMESH_Mesh_var(_this()) << ".ExportPartToSTL( "
<< meshPart<< ", r'" << file << "', " << isascii << ")";
}
SMESH_CATCH( SMESH::throwCorbaException );
- TPythonDump() << SMESH::SMESH_Mesh_var(_this()) << ".ExportCGNS( "
+ TPythonDump(_gen_i) << SMESH::SMESH_Mesh_var(_this()) << ".ExportCGNS( "
<< meshPart<< ", r'" << file << "', " << overwrite << ")";
#else
THROW_SALOME_CORBA_EXCEPTION("CGNS library is unavailable", SALOME::INTERNAL_ERROR);
SMESH_MeshPartDS partDS( meshPart );
_impl->ExportGMF(file, &partDS, withRequiredGroups);
- TPythonDump() << SMESH::SMESH_Mesh_var(_this()) << ".ExportGMF( "
+ TPythonDump(_gen_i) << SMESH::SMESH_Mesh_var(_this()) << ".ExportGMF( "
<< meshPart<< ", r'"
<< file << "', "
<< withRequiredGroups << ")";
set<int>::iterator it = addedIDs.find( i_grp->first );
if ( it != addedIDs.end() )
{
- TPythonDump() << i_grp->second << " = " << aMesh << ".GetGroups()[ "<< index << " ]";
+ TPythonDump(_gen_i) << i_grp->second << " = " << aMesh << ".GetGroups()[ "<< index << " ]";
addedIDs.erase( it );
if ( addedIDs.empty() )
break;
// avoid dump of "GetGroups"
{
// store python dump into a local variable inside local scope
- SMESH::TPythonDump pDump; // do not delete this line of code
+ SMESH::TPythonDump pDump(_gen_i); // do not delete this line of code
grpList = GetGroups();
}
SMESH_Gen_i *gen = SMESH_Gen_i::GetSMESHGen();
if(gen) {
CORBA::String_var aParameters = GetParameters();
- SALOMEDS::ListOfListOfStrings_var aSections = SMESH_Gen_i::getStudyServant()->ParseVariables(aParameters);
+ SALOMEDS::ListOfListOfStrings_var aSections = _gen_i->getStudyServant()->ParseVariables(aParameters);
if ( aSections->length() > 0 ) {
SALOMEDS::ListOfStrings aVars = aSections[ aSections->length() - 1 ];
aResult->length( aVars.length() );
bool res = false;
::SMESH_Mesh& mesh = GetImpl();
- TPythonDump aPythonDump; // prevent dump of called methods
+ TPythonDump aPythonDump(_gen_i); // prevent dump of called methods
aPythonDump << "isDone = " << SMESH::SMESH_Mesh_var(_this()) << ".SetMeshOrder( [ ";
TListOfListOfInt subMeshOrder;
const bool theIsDump)
{
int nbSet = theIdsOrder.size();
- TPythonDump aPythonDump; // prevent dump of called methods
+ TPythonDump aPythonDump(_gen_i); // prevent dump of called methods
if ( theIsDump )
aPythonDump << "[ ";
theResOrder.length(nbSet);