From: eap Date: Fri, 30 Nov 2018 10:54:14 +0000 (+0300) Subject: 23615: EDF 17317 - Fit All when display one mesh X-Git-Tag: V9_3_0a1~37 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=60beecbdbd81ffe3bfa4cfc263fe17193a16bf3e;p=modules%2Fsmesh.git 23615: EDF 17317 - Fit All when display one mesh --- diff --git a/doc/salome/gui/SMESH/images/pref21.png b/doc/salome/gui/SMESH/images/pref21.png index 43e656187..1f5d63cf9 100644 Binary files a/doc/salome/gui/SMESH/images/pref21.png and b/doc/salome/gui/SMESH/images/pref21.png differ diff --git a/doc/salome/gui/SMESH/input/mesh_preferences.rst b/doc/salome/gui/SMESH/input/mesh_preferences.rst index c4bfbacfc..734011f1b 100644 --- a/doc/salome/gui/SMESH/input/mesh_preferences.rst +++ b/doc/salome/gui/SMESH/input/mesh_preferences.rst @@ -22,7 +22,9 @@ General Preferences .. _display_mode_pref: -* **Display mode** +* **Display** + + * **Fit All upon Show Only** - if activated, *Show Only* command additionally performs *Fit All* command. * **Default display mode** - allows to set Wireframe, Shading, Nodes or Shrink :ref:`presentation mode ` as default. diff --git a/doc/salome/gui/SMESH/input/viewing_meshes_overview.rst b/doc/salome/gui/SMESH/input/viewing_meshes_overview.rst index 44cb38860..7dc0dff98 100644 --- a/doc/salome/gui/SMESH/input/viewing_meshes_overview.rst +++ b/doc/salome/gui/SMESH/input/viewing_meshes_overview.rst @@ -47,8 +47,8 @@ right-clicking on the selected mesh. * :ref:`Transparency ` - allows to change the transparency of mesh elements. * :ref:`Controls ` - graphically presents various information about the mesh. * **Hide** - allows to hide the selected mesh from the viewer. -* **Show Only** - allows to display only the selected mesh, hiding all others from the viewer. -* :ref:`Clipping ` - allows to create cross-sections of the displayed objects. +* **Show Only** - allows to display only the selected mesh, hiding all others from the viewer. If :ref:`Fit All upon Show Only ` Preference option is active, *Fit All* command is additionally performed. +* :doc:`clipping` - allows to create cross-sections of the displayed objects. * **Dump view** - exports an object from the viewer in bmp, png or jpeg image format. * **Change background** - allows to redefine the background color. By default it is black. * **View Operations** - allows to show/hide the visualization toolbar in the Viewer window. diff --git a/resources/SalomeApp.xml.in b/resources/SalomeApp.xml.in index e1434ad4e..efbe065a3 100644 --- a/resources/SalomeApp.xml.in +++ b/resources/SalomeApp.xml.in @@ -84,6 +84,7 @@ + diff --git a/src/SMESHGUI/SMESHGUI.cxx b/src/SMESHGUI/SMESHGUI.cxx index b4a75cb4d..a2b1e7425 100644 --- a/src/SMESHGUI/SMESHGUI.cxx +++ b/src/SMESHGUI/SMESHGUI.cxx @@ -5086,6 +5086,9 @@ void SMESHGUI::createPreferences() int dispgroup = addPreference( tr( "PREF_DISPLAY_MODE_GROUP" ), genTab ); setPreferenceProperty( dispgroup, "columns", 2 ); + + addPreference( tr( "PREF_FITALL_ON_DISPLAYONLY" ), dispgroup, LightApp_Preferences::Bool, "SMESH", "fitall_on_displayonly" ); + int dispmode = addPreference( tr( "PREF_DISPLAY_MODE" ), dispgroup, LightApp_Preferences::Selector, "SMESH", "display_mode" ); QStringList modes; modes.append( tr("MEN_WIRE") ); diff --git a/src/SMESHGUI/SMESHGUI_VTKUtils.cxx b/src/SMESHGUI/SMESHGUI_VTKUtils.cxx index cf0e475d4..52f969ef1 100644 --- a/src/SMESHGUI/SMESHGUI_VTKUtils.cxx +++ b/src/SMESHGUI/SMESHGUI_VTKUtils.cxx @@ -677,6 +677,7 @@ namespace SMESH if (!aStudy) return OK; + SUIT_ResourceMgr* resMgr; { OK = true; vtkRenderer *aRenderer = aViewWnd->getRenderer(); @@ -722,6 +723,10 @@ namespace SMESH anActor->SetVisibility(true); if (theAction == eDisplayOnly) aRenderer->ResetCameraClippingRange(); aStudy->setVisibilityState(theEntry, Qtx::ShownState); + if (( theAction == eDisplayOnly ) && + ( resMgr = SMESHGUI::resourceMgr() ) && + ( resMgr->booleanValue( "SMESH", "fitall_on_displayonly", false ))) + FitAll(); // PAL23615 break; case eErase: //MESSAGE("--- erase " << anActor); @@ -746,8 +751,16 @@ namespace SMESH anActor->SetVisibility(true); aStudy->setVisibilityState(theEntry, Qtx::ShownState); // FitAll(); - PAL16770(Display of a group performs an automatic fit all) - if (needFitAll) FitAll(); - } else { + if (( !needFitAll ) && + ( theAction == eDisplayOnly ) && + ( resMgr = SMESHGUI::resourceMgr() )) + { + needFitAll = resMgr->booleanValue( "SMESH", "fitall_on_displayonly", false ); + } + if ( needFitAll ) + FitAll(); + } + else { OK = false; } } diff --git a/src/SMESHGUI/SMESH_msg_en.ts b/src/SMESHGUI/SMESH_msg_en.ts index 209a6bd88..41d27f5c0 100644 --- a/src/SMESHGUI/SMESH_msg_en.ts +++ b/src/SMESHGUI/SMESH_msg_en.ts @@ -4733,12 +4733,16 @@ Please, create VTK viewer and try again PREF_DISPLAY_MODE_GROUP - Display mode + Display PREF_DISPLAY_MODE Default display mode + + PREF_FITALL_ON_DISPLAYONLY + Fit All upon Show Only + PREF_ELEMENTS Elements