X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=blobdiff_plain;f=src%2FSMESH_I%2FSMESH_Gen_i.cxx;h=f3d2d43249feb392a522e13f3c8aaa5096bbb78a;hp=d1d80774140a60474b92ab33940ac33bc5f7c498;hb=fe4d201b78c5a39c2c1186498a481323d537e928;hpb=24412178e1a7c741a73d5b23822c43e08c353b97 diff --git a/src/SMESH_I/SMESH_Gen_i.cxx b/src/SMESH_I/SMESH_Gen_i.cxx index d1d807741..f3d2d4324 100644 --- a/src/SMESH_I/SMESH_Gen_i.cxx +++ b/src/SMESH_I/SMESH_Gen_i.cxx @@ -1947,6 +1947,7 @@ CORBA::Boolean SMESH_Gen_i::Compute( SMESH::SMESH_Mesh_ptr theMesh, bool ok = myGen.Compute( myLocMesh, myLocShape, how ); meshServant->CreateGroupServants(); // algos can create groups (issue 0020918) myLocMesh.GetMeshDS()->Modified(); + UpdateIcons( theMesh ); return ok; } } @@ -3074,7 +3075,6 @@ SALOMEDS::TMPFile* SMESH_Gen_i::Save( SALOMEDS::SComponent_ptr theComponent, myMesh->Load(); // load from study file if not yet done TPythonDump pd; // not to dump GetGroups() SMESH::ListOfGroups_var groups = myMesh->GetGroups(); - pd << ""; // to avoid optimizing pd out for ( CORBA::ULong i = 0; i < groups->length(); ++i ) { SMESH_GroupBase_i* grImpl = SMESH::DownCast( groups[i]); @@ -3328,6 +3328,17 @@ SALOMEDS::TMPFile* SMESH_Gen_i::Save( SALOMEDS::SComponent_ptr theComponent, } } + // Store file info + std::string info = myImpl->FileInfoToString(); + if ( !info.empty() ) + { + aSize[ 0 ] = info.size(); + aDataset = new HDFdataset( "file info", aTopGroup, HDF_STRING, aSize, 1 ); + aDataset->CreateOnDisk(); + aDataset->WriteOnDisk( (char*) info.data() ); + aDataset->CloseOnDisk(); + } + // write applied hypotheses if exist SALOMEDS::SObject_wrap myHypBranch; found = gotBranch->FindSubObject( GetRefOnAppliedHypothesisTag(), myHypBranch.inout() ); @@ -4001,7 +4012,7 @@ bool SMESH_Gen_i::Load( SALOMEDS::SComponent_ptr theComponent, const char* theURL, bool isMultiFile ) { - if (!myStudyContext) + //if (!myStudyContext) UpdateStudy(); SALOMEDS::Study_var aStudy = getStudyServant(); /* if( !theComponent->_is_nil() ) @@ -4352,6 +4363,18 @@ bool SMESH_Gen_i::Load( SALOMEDS::SComponent_ptr theComponent, myNewMeshImpl->GetImpl().GetMeshDS()->SetPersistentId( *meshPersistentId ); delete [] meshPersistentId; } + + // Restore file info + if ( aTopGroup->ExistInternalObject( "file info" )) + { + aDataset = new HDFdataset( "file info", aTopGroup ); + aDataset->OpenOnDisk(); + size = aDataset->GetSize(); + std::string info( size, ' '); + aDataset->ReadFromDisk( (char*) info.data() ); + aDataset->CloseOnDisk(); + myNewMeshImpl->FileInfoFromString( info ); + } } } } // reading MESHes