Salome HOME
0020145: EDF 666 SMESH: Modifications of GEOM groups are not taken into account
authoreap <eap@opencascade.com>
Mon, 25 May 2009 11:20:50 +0000 (11:20 +0000)
committereap <eap@opencascade.com>
Mon, 25 May 2009 11:20:50 +0000 (11:20 +0000)
   allow changing shape to mesh in case of shape being group

src/SMESH/SMESH_Mesh.cxx

index 5ddf9a5157cf9e6c54f42e9c726dd9325a80da85..88bb601e023b2a0599a62ffdf21268902761c01f 100644 (file)
@@ -134,9 +134,11 @@ void SMESH_Mesh::ShapeToMesh(const TopoDS_Shape & aShape)
 {
   if(MYDEBUG) MESSAGE("SMESH_Mesh::ShapeToMesh");
 
-  if ( !aShape.IsNull() && _isShapeToMesh )
-    throw SALOME_Exception(LOCALIZED ("a shape to mesh has already been defined"));
-
+  if ( !aShape.IsNull() && _isShapeToMesh ) {
+    if ( aShape.ShapeType() != TopAbs_COMPOUND && // group contents is allowed to change
+         _myMeshDS->ShapeToMesh().ShapeType() != TopAbs_COMPOUND )
+      throw SALOME_Exception(LOCALIZED ("a shape to mesh has already been defined"));
+  }
   // clear current data
   if ( !_myMeshDS->ShapeToMesh().IsNull() )
   {