From da61389f82fbe9af224568dbc121ae92833446cf Mon Sep 17 00:00:00 2001 From: eap Date: Thu, 26 Jan 2012 15:57:56 +0000 Subject: [PATCH] 0021338: EDF 1926 SMESH: New controls and filters Correctly set mesh modified at transformations --- src/SMESH_I/SMESH_MeshEditor_i.cxx | 61 +++++++++++++++++++++++------- 1 file changed, 48 insertions(+), 13 deletions(-) diff --git a/src/SMESH_I/SMESH_MeshEditor_i.cxx b/src/SMESH_I/SMESH_MeshEditor_i.cxx index ee6499cb0..ac3973702 100644 --- a/src/SMESH_I/SMESH_MeshEditor_i.cxx +++ b/src/SMESH_I/SMESH_MeshEditor_i.cxx @@ -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()"; } -- 2.39.2