Salome HOME
0021177: EDF 1563 SMESH: Preview of mesh during a modification
authoreap <eap@opencascade.com>
Mon, 14 Mar 2011 08:33:11 +0000 (08:33 +0000)
committereap <eap@opencascade.com>
Mon, 14 Mar 2011 08:33:11 +0000 (08:33 +0000)
   to add adjacent elements to preview only when move nodes in this mesh

src/SMESHGUI/SMESHGUI_RotationDlg.cxx
src/SMESHGUI/SMESHGUI_ScaleDlg.cxx
src/SMESHGUI/SMESHGUI_SymmetryDlg.cxx
src/SMESHGUI/SMESHGUI_TranslationDlg.cxx
src/SMESH_I/SMESH_MeshEditor_i.cxx

index ab5b63733c0596656947260bac266bfd35f99242..13a6434c41a28f3716c5b911b35253e6804637f7 100644 (file)
@@ -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);
index faf385d633d2648d59d833d0d72e4afab890d3a1..a5bc816ef0e6f964be606c4b9e2d2a6a91d60f0e 100644 (file)
@@ -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;
index e0437bd8e45504312fb173a1a066f34d8531bb27..b62a150d47cdbe9db2f85d6dc5a26d62e887150a 100644 (file)
@@ -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())
index 4f403d6ad5ff3f8cfc53c862255ac3b4f4f7cf1f..4b3094af44b8b38205dc4e86bd8e1c93a4e1b4b2 100644 (file)
@@ -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())
index bb155c7bcb0394e09f9fee7ad4afd298e5a5f39a..824a1314160da6c790599fc71a4b55b930a85ceb 100644 (file)
@@ -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 );