Salome HOME
23615: EDF 17317 - Fit All when display one mesh
authoreap <eap@opencascade.com>
Fri, 30 Nov 2018 10:54:14 +0000 (13:54 +0300)
committereap <eap@opencascade.com>
Fri, 30 Nov 2018 10:54:14 +0000 (13:54 +0300)
doc/salome/gui/SMESH/images/pref21.png
doc/salome/gui/SMESH/input/mesh_preferences.rst
doc/salome/gui/SMESH/input/viewing_meshes_overview.rst
resources/SalomeApp.xml.in
src/SMESHGUI/SMESHGUI.cxx
src/SMESHGUI/SMESHGUI_VTKUtils.cxx
src/SMESHGUI/SMESH_msg_en.ts

index 43e65618779b6041d50f1e05a6239809432e23e7..1f5d63cf92ee2e0b0e7848f4546c6682c2959070 100644 (file)
Binary files a/doc/salome/gui/SMESH/images/pref21.png and b/doc/salome/gui/SMESH/images/pref21.png differ
index c4bfbacfc22720177b32f17df6ed75785c98cf95..734011f1b2076ae2f04fcb79919439564d45a616 100644 (file)
@@ -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 <display_mode_page>` as default.
 
index 44cb38860a93256031f6d3d6a06c0c3bc2971a75..7dc0dff9872924e2eaf64ecbdc1c65d28471212d 100644 (file)
@@ -47,8 +47,8 @@ right-clicking on the selected mesh.
 * :ref:`Transparency <transparency_page>` - allows to change the transparency of mesh elements.
 * :ref:`Controls <quality_page>` - 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 <clipping_page>` - 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 <display_mode_pref>` 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.
index e1434ad4e19da297bd475f46775703e982842cc0..efbe065a336a66ba93d50a36f6ea1e180777aea8 100644 (file)
@@ -84,6 +84,7 @@
     <parameter name="update_limit"                 value="500000" />
     <parameter name="display_entity"               value="true" />
     <parameter name="display_mode"                 value="1"    />
+    <parameter name="fitall_on_displayonly"        value="1"    />
     <parameter name="auto_groups"                  value="false"/>
     <parameter name="show_warning"                 value="true"/>
     <parameter name="show_result_notification"     value="2"/>
index b4a75cb4dd97d6b84bf532bf65ed155e95736149..a2b1e74256e852b07010a9f26afcb4327985be12 100644 (file)
@@ -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") );
index cf0e475d49403d4f000d17825c648e4d73b85b06..52f969ef19cba14463dc933c41d145c72e4db609 100644 (file)
@@ -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;
                 }
               }
index 209a6bd8856c55ad027273bef7c4978952415768..41d27f5c0bdfd90daa8ba1865af31fe5c345d23f 100644 (file)
@@ -4733,12 +4733,16 @@ Please, create VTK viewer and try again</translation>
     </message>
     <message>
         <source>PREF_DISPLAY_MODE_GROUP</source>
-        <translation>Display mode</translation>
+        <translation>Display</translation>
     </message>
     <message>
         <source>PREF_DISPLAY_MODE</source>
         <translation>Default display mode</translation>
     </message>
+    <message>
+        <source>PREF_FITALL_ON_DISPLAYONLY</source>
+        <translation>Fit All upon Show Only</translation>
+    </message>
     <message>
         <source>PREF_ELEMENTS</source>
         <translation>Elements</translation>