aDataset->WriteOnDisk( &meshPersistentId );
aDataset->CloseOnDisk();
+ // Store SMESH_Mesh_i::_mainShapeTick
+ int shapeTick = myImpl->MainShapeTick();
+ aSize[ 0 ] = 1;
+ aDataset = new HDFdataset( "shapeTick", aTopGroup, HDF_INT32, aSize, 1 );
+ aDataset->CreateOnDisk();
+ aDataset->WriteOnDisk( &shapeTick );
+ aDataset->CloseOnDisk();
+
// write reference on a shape if exists
SALOMEDS::SObject_wrap myRef;
bool shapeRefFound = false;
}
// issue 20918. Restore Persistent Id of SMESHDS_Mesh
- if( aTopGroup->ExistInternalObject( "meshPersistentId" ) )
+ if ( aTopGroup->ExistInternalObject( "meshPersistentId" ) )
{
aDataset = new HDFdataset( "meshPersistentId", aTopGroup );
aDataset->OpenOnDisk();
delete [] meshPersistentId;
}
+ // Restore SMESH_Mesh_i::_mainShapeTick
+ if ( aTopGroup->ExistInternalObject( "shapeTick" ))
+ {
+ aDataset = new HDFdataset( "shapeTick", aTopGroup );
+ aDataset->OpenOnDisk();
+ int* shapeTick = & myNewMeshImpl->MainShapeTick();
+ aDataset->ReadFromDisk( shapeTick );
+ aDataset->CloseOnDisk();
+ }
+
// Restore file info
if ( aTopGroup->ExistInternalObject( "file info" ))
{
*/
//================================================================================
-TopoDS_Shape SMESH_Mesh_i::newGroupShape( TGeomGroupData & groupData)
+TopoDS_Shape SMESH_Mesh_i::newGroupShape( TGeomGroupData & groupData, bool onlyIfChanged )
{
TopoDS_Shape newShape;
for ( CORBA::ULong i = 0; i < ids->length(); ++i )
curIndices.insert( ids[i] );
- if ( groupData._indices == curIndices )
+ if ( onlyIfChanged && groupData._indices == curIndices )
return newShape; // group not changed
// update data
std::list<TGeomGroupData>::iterator data = _geomGroupData.begin();
for ( ; data != _geomGroupData.end(); ++data )
{
- TopoDS_Shape newShape = newGroupShape( *data );
+ TopoDS_Shape newShape = newGroupShape( *data, /*onlyIfChanged=*/false );
if ( !newShape.IsNull() )
{
if ( meshDS->ShapeToIndex( newShape ) > 0 ) // a group reduced to one sub-shape
bool processedGroup = !it_new.second;
TopoDS_Shape& newShape = it_new.first->second;
if ( !processedGroup )
- newShape = newGroupShape( *data );
+ newShape = newGroupShape( *data, /*onlyIfChanged=*/true );
if ( newShape.IsNull() )
continue; // no changes
std::string FileInfoToString();
void FileInfoFromString(const std::string& info);
+ /*!
+ * Persistence of geometry tick
+ */
+ int& MainShapeTick() { return _mainShapeTick; }
+
+
/*!
* Sets list of notebook variables used for Mesh operations separated by ":" symbol
*/
/*!
* Return new group contents if it has been changed and update group data
*/
- TopoDS_Shape newGroupShape( TGeomGroupData & groupData);
+ TopoDS_Shape newGroupShape( TGeomGroupData & groupData, bool onlyIfChanged);
};