X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSMESH_I%2FSMESH_DumpPython.cxx;h=2d5d08883168734146f5a55a9443f1eac45c8865;hb=cf05ada8f4a7c685749d86fd6629ca31a61579eb;hp=e0ecf8fcd0cd328d320d187da17eded84f4f9e9e;hpb=c63ee099ad2b149bd70136839c973e8910137bc5;p=modules%2Fsmesh.git diff --git a/src/SMESH_I/SMESH_DumpPython.cxx b/src/SMESH_I/SMESH_DumpPython.cxx index e0ecf8fcd..2d5d08883 100644 --- a/src/SMESH_I/SMESH_DumpPython.cxx +++ b/src/SMESH_I/SMESH_DumpPython.cxx @@ -231,6 +231,7 @@ namespace SMESH case FT_BelongToGeom: myStream<< "aBelongToGeom"; break; case FT_BelongToPlane: myStream<< "aBelongToPlane"; break; case FT_BelongToCylinder: myStream<< "aBelongToCylinder"; break; + case FT_BelongToGenSurface:myStream<<"aBelongToGenSurface";break; case FT_LyingOnGeom: myStream<< "aLyingOnGeom"; break; case FT_RangeOfIds: myStream<< "aRangeOfIds"; break; case FT_BadOrientedVolume:myStream<< "aBadOrientedVolume";break; @@ -748,6 +749,53 @@ TCollection_AsciiString SMESH_Gen_i::DumpPython_impl if (aSeq->Value(aLen) < aScriptLength) anUpdatedScript += aScript.SubString(aSeq->Value(aLen) + 1, aScriptLength); + + SMESH_Gen_i* aSMESHGenI = SMESH_Gen_i::GetSMESHGen(); + SALOMEDS::Study_ptr aStudy = aSMESHGenI->GetCurrentStudy(); + if( !CORBA::is_nil(aStudy) ) + { + SALOMEDS::SObject_var aComp = aStudy->FindComponent(ComponentDataType()); + if( !CORBA::is_nil(aComp) ) + { + SALOMEDS::ChildIterator_var Itr = aStudy->NewChildIterator(aComp); + for( Itr->InitEx(true); Itr->More(); Itr->Next() ) + { + SALOMEDS::SObject_var aSObj = Itr->Value(); + CORBA::String_var aName = aSObj->GetName(); + + SMESH::SMESH_Mesh_var aMesh = SMESH::SMESH_Mesh::_narrow( SMESH_Gen_i::SObjectToObject( aSObj ) ); + if( !CORBA::is_nil(aMesh) ) + { + bool isAutoColor = aMesh->GetAutoColor(); + if( isAutoColor ) + { + anUpdatedScript += "\n\t"; + anUpdatedScript += (char*)aName.in(); + anUpdatedScript += ".SetAutoColor(1)"; + } + } + + SMESH::SMESH_GroupBase_var aGroup = SMESH::SMESH_GroupBase::_narrow( SMESH_Gen_i::SObjectToObject( aSObj ) ); + if( !CORBA::is_nil(aGroup) ) + { + SALOMEDS::Color aColor = aGroup->GetColor(); + if ( aColor.R > 0 || aColor.G > 0 || aColor.B > 0 ) + { + anUpdatedScript += "\n\t"; + anUpdatedScript += (char*)aName.in(); + anUpdatedScript += ".SetColor(SALOMEDS.Color("; + anUpdatedScript += aColor.R; + anUpdatedScript += ","; + anUpdatedScript += aColor.G; + anUpdatedScript += ","; + anUpdatedScript += aColor.B; + anUpdatedScript += "))"; + } + } + } + } + } + // Remove removed objects if ( seqRemoved.Length() > 0 ) { anUpdatedScript += "\n\t## some objects were removed";