]> SALOME platform Git repositories - modules/smesh.git/commitdiff
Salome HOME
0020693: EDF 1288 SMESH: Problem to recompute a mesh with a sub-mesh and a conversion...
authoreap <eap@opencascade.com>
Thu, 13 May 2010 06:22:26 +0000 (06:22 +0000)
committereap <eap@opencascade.com>
Thu, 13 May 2010 06:22:26 +0000 (06:22 +0000)
 * save/restore _isModified attribute of the mesh

src/SMESH_I/SMESH_Gen_i.cxx

index 9e9b90e4bf2839cde28c01d4533f25d46c9d04db..49ec45fad60197f4c0b8a8882b058b280cb5d677 100644 (file)
@@ -2518,6 +2518,14 @@ SALOMEDS::TMPFile* SMESH_Gen_i::Save( SALOMEDS::SComponent_ptr theComponent,
             aDataset->WriteOnDisk( anAutoColor );
             aDataset->CloseOnDisk();
 
+            // issue 0020693. Store _isModified flag
+            int isModified = myImpl->GetImpl().GetIsModified();
+            aSize[ 0 ] = 1;
+            aDataset = new HDFdataset( "_isModified", aTopGroup, HDF_INT32, aSize, 1 );
+            aDataset->CreateOnDisk();
+            aDataset->WriteOnDisk( &isModified );
+            aDataset->CloseOnDisk();
+
             // write reference on a shape if exists
             SALOMEDS::SObject_var myRef;
             bool shapeRefFound = false;
@@ -3608,6 +3616,18 @@ bool SMESH_Gen_i::Load( SALOMEDS::SComponent_ptr theComponent,
               }
             }
           }
+
+          // issue 0020693. Restore _isModified flag
+          if( aTopGroup->ExistInternalObject( "_isModified" ) )
+          {
+            aDataset = new HDFdataset( "_isModified", aTopGroup );
+            aDataset->OpenOnDisk();
+            size = aDataset->GetSize();
+            int* isModified = new int[ size ];
+            aDataset->ReadFromDisk( isModified );
+            aDataset->CloseOnDisk();
+            myNewMeshImpl->GetImpl().SetIsModified( bool(*isModified));
+          }
         }
       }
     }