From: eap Date: Mon, 14 Mar 2011 08:33:11 +0000 (+0000) Subject: 0021177: EDF 1563 SMESH: Preview of mesh during a modification X-Git-Tag: StartingPortingMED3~7 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=a2db5e7c304efdf1b3c82bcfcad8ce98b385be9e;p=modules%2Fsmesh.git 0021177: EDF 1563 SMESH: Preview of mesh during a modification to add adjacent elements to preview only when move nodes in this mesh --- diff --git a/src/SMESHGUI/SMESHGUI_RotationDlg.cxx b/src/SMESHGUI/SMESHGUI_RotationDlg.cxx index ab5b63733..13a6434c4 100644 --- a/src/SMESHGUI/SMESHGUI_RotationDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_RotationDlg.cxx @@ -1084,7 +1084,8 @@ void SMESHGUI_RotationDlg::onDisplaySimulation( bool toDisplayPreview ) { try { SUIT_OverrideCursor aWaitCursor; - bool copy = ActionGroup->checkedId() == COPY_ELEMS_BUTTON; + bool copy = ( ActionGroup->checkedId() == COPY_ELEMS_BUTTON || + ActionGroup->checkedId() == MAKE_MESH_BUTTON ); SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditPreviewer(); if(CheckBoxMesh->isChecked()) aMeshEditor->RotateObject(mySelectedObject, anAxis, anAngle, copy); diff --git a/src/SMESHGUI/SMESHGUI_ScaleDlg.cxx b/src/SMESHGUI/SMESHGUI_ScaleDlg.cxx index faf385d63..a5bc816ef 100644 --- a/src/SMESHGUI/SMESHGUI_ScaleDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_ScaleDlg.cxx @@ -1084,7 +1084,8 @@ void SMESHGUI_ScaleDlg::onDisplaySimulation( bool toDisplayPreview ) { getScale(aPoint, aScaleFact); try { - bool copy = ActionGroup->checkedId() == COPY_ELEMS_BUTTON; + bool copy = ( ActionGroup->checkedId() == COPY_ELEMS_BUTTON || + ActionGroup->checkedId() == MAKE_MESH_BUTTON ); SUIT_OverrideCursor aWaitCursor; SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditPreviewer(); SMESH::SMESH_IDSource_var obj; diff --git a/src/SMESHGUI/SMESHGUI_SymmetryDlg.cxx b/src/SMESHGUI/SMESHGUI_SymmetryDlg.cxx index e0437bd8e..b62a150d4 100644 --- a/src/SMESHGUI/SMESHGUI_SymmetryDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_SymmetryDlg.cxx @@ -1155,7 +1155,8 @@ void SMESHGUI_SymmetryDlg::onDisplaySimulation( bool toDisplayPreview ) { getMirror(aMirror,aMirrorType); try { - bool copy = ActionGroup->checkedId() == COPY_ELEMS_BUTTON; + bool copy = ( ActionGroup->checkedId() == COPY_ELEMS_BUTTON || + ActionGroup->checkedId() == MAKE_MESH_BUTTON ); SUIT_OverrideCursor aWaitCursor; SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditPreviewer(); if(CheckBoxMesh->isChecked()) diff --git a/src/SMESHGUI/SMESHGUI_TranslationDlg.cxx b/src/SMESHGUI/SMESHGUI_TranslationDlg.cxx index 4f403d6ad..4b3094af4 100644 --- a/src/SMESHGUI/SMESHGUI_TranslationDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_TranslationDlg.cxx @@ -1133,7 +1133,8 @@ void SMESHGUI_TranslationDlg::onDisplaySimulation( bool toDisplayPreview ) { } try { - bool copy = ActionGroup->checkedId() == COPY_ELEMS_BUTTON; + bool copy = ( ActionGroup->checkedId() == COPY_ELEMS_BUTTON || + ActionGroup->checkedId() == MAKE_MESH_BUTTON ); SUIT_OverrideCursor aWaitCursor; SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditPreviewer(); if(CheckBoxMesh->isChecked()) diff --git a/src/SMESH_I/SMESH_MeshEditor_i.cxx b/src/SMESH_I/SMESH_MeshEditor_i.cxx index bb155c7bc..824a13141 100644 --- a/src/SMESH_I/SMESH_MeshEditor_i.cxx +++ b/src/SMESH_I/SMESH_MeshEditor_i.cxx @@ -2936,6 +2936,9 @@ SMESH_MeshEditor_i::mirror(TIDSortedElemSet & theElements, gp_Pnt P ( theAxis.x, theAxis.y, theAxis.z ); gp_Vec V ( theAxis.vx, theAxis.vy, theAxis.vz ); + if ( theTargetMesh ) + theCopy = false; + gp_Trsf aTrsf; switch ( theMirrorType ) { case SMESH::SMESH_MeshEditor::POINT: @@ -2956,7 +2959,7 @@ SMESH_MeshEditor_i::mirror(TIDSortedElemSet & theElements, if ( myPreviewMode ) { tmpMesh.Copy( theElements, copyElements); - if ( !theCopy ) + if ( !theCopy && !theTargetMesh ) { TIDSortedElemSet elemsAround, elemsAroundCopy; getElementsAround( theElements, GetMeshDS(), elemsAround ); @@ -3196,6 +3199,9 @@ SMESH_MeshEditor_i::translate(TIDSortedElemSet & theElements, { initData(); + if ( theTargetMesh ) + theCopy = false; + gp_Trsf aTrsf; const SMESH::PointStruct * P = &theVector.PS; aTrsf.SetTranslation( gp_Vec( P->x, P->y, P->z )); @@ -3208,7 +3214,7 @@ SMESH_MeshEditor_i::translate(TIDSortedElemSet & theElements, if ( myPreviewMode ) { tmpMesh.Copy( theElements, copyElements); - if ( !theCopy ) + if ( !theCopy && !theTargetMesh ) { TIDSortedElemSet elemsAround, elemsAroundCopy; getElementsAround( theElements, GetMeshDS(), elemsAround ); @@ -3434,6 +3440,9 @@ SMESH_MeshEditor_i::rotate(TIDSortedElemSet & theElements, { initData(); + if ( theTargetMesh ) + theCopy = false; + gp_Pnt P ( theAxis.x, theAxis.y, theAxis.z ); gp_Vec V ( theAxis.vx, theAxis.vy, theAxis.vz ); @@ -3447,7 +3456,7 @@ SMESH_MeshEditor_i::rotate(TIDSortedElemSet & theElements, if ( myPreviewMode ) { tmpMesh.Copy( theElements, copyElements ); - if ( !theCopy ) + if ( !theCopy && !theTargetMesh ) { TIDSortedElemSet elemsAround, elemsAroundCopy; getElementsAround( theElements, GetMeshDS(), elemsAround ); @@ -3691,6 +3700,9 @@ SMESH_MeshEditor_i::scale(SMESH::SMESH_IDSource_ptr theObject, if ( theScaleFact.length() == 2 ) THROW_SALOME_CORBA_EXCEPTION("Invalid nb of scale factors : 2", SALOME::BAD_PARAM); + if ( theTargetMesh ) + theCopy = false; + TIDSortedElemSet elements; bool emptyIfIsMesh = myPreviewMode ? false : true; if ( !idSourceToSet(theObject, GetMeshDS(), elements, SMDSAbs_All, emptyIfIsMesh)) @@ -3715,7 +3727,7 @@ SMESH_MeshEditor_i::scale(SMESH::SMESH_IDSource_ptr theObject, if ( myPreviewMode ) { tmpMesh.Copy( elements, copyElements); - if ( !theCopy ) + if ( !theCopy && !theTargetMesh ) { TIDSortedElemSet elemsAround, elemsAroundCopy; getElementsAround( elements, GetMeshDS(), elemsAround );