Salome HOME
0021338: EDF 1926 SMESH: New controls and filters
authoreap <eap@opencascade.com>
Thu, 26 Jan 2012 15:57:56 +0000 (15:57 +0000)
committereap <eap@opencascade.com>
Thu, 26 Jan 2012 15:57:56 +0000 (15:57 +0000)
    Correctly set mesh modified at transformations

src/SMESH_I/SMESH_MeshEditor_i.cxx

index ee6499cb0564f4a23268ca34e667d610fa1c28bf..ac397370243607201fe0859315ab8fbf154c4358 100644 (file)
@@ -3003,11 +3003,19 @@ SMESH_MeshEditor_i::mirror(TIDSortedElemSet &                  theElements,
       anEditor.Transform (*workElements, aTrsf, theCopy, theMakeGroups, theTargetMesh);
 
   if(theCopy || myPreviewMode)
-    storeResult(anEditor);
-  else
+    storeResult(anEditor); // store preview data or new elements
+
+  if ( !myPreviewMode )
   {
-    myMesh->SetIsModified( true );
-    myMesh->GetMeshDS()->Modified();
+    if ( theTargetMesh )
+    {
+      theTargetMesh->GetMeshDS()->Modified();
+    }
+    else
+    {
+      myMesh->GetMeshDS()->Modified();
+      myMesh->SetIsModified( true );
+    }
   }
   return theMakeGroups ? getGroups(groupIds.get()) : 0;
 }
@@ -3259,10 +3267,18 @@ SMESH_MeshEditor_i::translate(TIDSortedElemSet        & theElements,
 
   if(theCopy || myPreviewMode)
     storeResult(anEditor);
-  else
+
+  if ( !myPreviewMode )
   {
-    myMesh->GetMeshDS()->Modified();
-    myMesh->SetIsModified( true );
+    if ( theTargetMesh )
+    {
+      theTargetMesh->GetMeshDS()->Modified();
+    }
+    else
+    {
+      myMesh->GetMeshDS()->Modified();
+      myMesh->SetIsModified( true );
+    }
   }
 
   return theMakeGroups ? getGroups(groupIds.get()) : 0;
@@ -3501,10 +3517,18 @@ SMESH_MeshEditor_i::rotate(TIDSortedElemSet &        theElements,
 
   if(theCopy || myPreviewMode)
     storeResult(anEditor);
-  else
+
+  if ( !myPreviewMode )
   {
-    myMesh->GetMeshDS()->Modified();
-    myMesh->SetIsModified( true );
+    if ( theTargetMesh )
+    {
+      theTargetMesh->GetMeshDS()->Modified();
+    }
+    else
+    {
+      myMesh->GetMeshDS()->Modified();
+      myMesh->SetIsModified( true );
+    }
   }
 
   return theMakeGroups ? getGroups(groupIds.get()) : 0;
@@ -3772,11 +3796,20 @@ SMESH_MeshEditor_i::scale(SMESH::SMESH_IDSource_ptr  theObject,
 
   if(theCopy || myPreviewMode )
     storeResult(anEditor);
-  else
+
+  if ( !myPreviewMode )
   {
-    myMesh->GetMeshDS()->Modified();
-    myMesh->SetIsModified( true );
+    if ( theTargetMesh )
+    {
+      theTargetMesh->GetMeshDS()->Modified();
+    }
+    else
+    {
+      myMesh->GetMeshDS()->Modified();
+      myMesh->SetIsModified( true );
+    }
   }
+
   return theMakeGroups ? getGroups(groupIds.get()) : 0;
 }
 
@@ -4121,6 +4154,8 @@ void SMESH_MeshEditor_i::MergeEqualElements()
   ::SMESH_MeshEditor anEditor( myMesh );
   anEditor.MergeEqualElements();
 
+  myMesh->GetMeshDS()->Modified();
+
   TPythonDump() << this << ".MergeEqualElements()";
 }