23615: EDF 17317 - Fit All when display one mesh

This commit is contained in:
eap 2018-11-30 13:54:14 +03:00
parent 48b83422af
commit 60beecbdbd
7 changed files with 29 additions and 6 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 92 KiB

After

Width:  |  Height:  |  Size: 92 KiB

View 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.

View 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.

View 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"/>

View 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") );

View 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;
}
}

View 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>