addPreference( tr( "PREF_VIEWER_AUTO_FITALL" ), viewerGroup,
LightApp_Preferences::Bool, "HYDRO", "auto_fit_all" );
+ addPreference( tr( "PREF_VIEWER_AUTOMATIC_ZOOM" ), viewerGroup, LightApp_Preferences::Bool, "HYDRO", "automatic_zoom" );
+
int StricklerTableGroup = addPreference( tr( "PREF_GROUP_STRICKLER_TABLE" ), genTab );
int defaultStricklerCoef = addPreference( tr( "PREF_DEFAULT_STRICKLER_COEFFICIENT" ), StricklerTableGroup,
LightApp_Preferences::DblSpin, "preferences", "default_strickler_coefficient" );
getOCCDisplayer()->UpdatePolylines( aViewerId, aType, aSize );
}
}
+ else if (theSection == "HYDRO" && thePref == "automatic_zoom")
+ {
+ bool anAutoZoom = resMgr->booleanValue( "HYDRO", "automatic_zoom" );
+ ViewManagerList aViewManagers = getApp()->viewManagers();
+ foreach (SUIT_ViewManager* aVMgr, aViewManagers)
+ {
+ if (aVMgr)
+ {
+ QVector<SUIT_ViewWindow*> aViews = aVMgr->getViews();
+ foreach (SUIT_ViewWindow* aView, aViews)
+ {
+ if (aView)
+ {
+ OCCViewer_ViewFrame* anOCCViewFrame = dynamic_cast<OCCViewer_ViewFrame*>( aView );
+ if (anOCCViewFrame)
+ {
+ anOCCViewFrame->setAutomaticZoom(anAutoZoom);
+ for (int i = OCCViewer_ViewFrame::MAIN_VIEW; i<=OCCViewer_ViewFrame::TOP_RIGHT; i++)
+ {
+ OCCViewer_ViewWindow* aV = anOCCViewFrame->getView(i);
+ if (aV)
+ aV->setAutomaticZoom(anAutoZoom);
+ }
+ }
+ OCCViewer_ViewWindow* anOCCViewWindow = dynamic_cast<OCCViewer_ViewWindow*>( aView );
+ if (anOCCViewWindow)
+ anOCCViewWindow->setAutomaticZoom(true);
+ }
+ }
+ }
+ }
+ }
else
LightApp_Module::preferencesChanged( theSection, thePref );
}
<source>PREF_VIEWER_AUTO_FITALL</source>
<translation>Make automatic fit all after show object operation</translation>
</message>
+ <message>
+ <source>PREF_VIEWER_AUTOMATIC_ZOOM</source>
+ <translation>Turn on the automatic fit-all operation when front/top/left/etc called</translation>
+ </message>
<message>
<source>PREF_GROUP_STRICKLER_TABLE</source>
<translation>Strickler table</translation>
<parameter value="0" name="parameter_test" />
<parameter name="version" value="2.0.0"/>
<parameter value="false" name="auto_fit_all"/>
+ <parameter value="false" name="automatic_zoom"/>
<parameter name="documentation" value="hydro_help"/>
</section>
<section name="hydro_help" >