if( occ_mgr )
occ_mgr->setChainedOperations( true );//TODO: via preferences
-
foreach( SUIT_ViewWindow* aViewWindow, aViewManager->getViews() )
{
OCCViewer_ViewFrame* aViewFrame = dynamic_cast<OCCViewer_ViewFrame*>( aViewWindow );
}
}
+
// SUIT_DataBrowser* ob = getApp()->objectBrowser();
// SUIT_AbstractModel* treeModel = dynamic_cast<SUIT_AbstractModel*>( ob->model() );
// treeModel->setAppropriate( SUIT_DataObject::VisibilityId, Qtx::Toggled );
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" );
+ addPreference( tr( "PREF_VIEWER_ZOOM_SHUTOFF" ), viewerGroup, LightApp_Preferences::Bool, "HYDRO", "zoom_shutoff" );
int StricklerTableGroup = addPreference( tr( "PREF_GROUP_STRICKLER_TABLE" ), genTab );
int defaultStricklerCoef = addPreference( tr( "PREF_DEFAULT_STRICKLER_COEFFICIENT" ), StricklerTableGroup,
getOCCDisplayer()->UpdatePolylines( aViewerId, aType, aSize );
}
}
- else if (theSection == "HYDRO" && thePref == "automatic_zoom")
+ else if (theSection == "HYDRO" && thePref == "zoom_shutoff")
{
- 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);
- }
- }
- }
- }
+ bool aZoomShutoff = resMgr->booleanValue( "HYDRO", "zoom_shutoff" );
+ setAutoZoomToAllViewManagers(!aZoomShutoff);
}
else
LightApp_Module::preferencesChanged( theSection, thePref );
setUpdateEnabled( true );
+ setAutoZoomToAllViewManagers(false);
+
QApplication::restoreOverrideCursor();
}
aViewFrame->onTopView();
HYDROGUI_Tool::setOCCActionShown( aViewFrame, OCCViewer_ViewWindow::MaximizedId, false );
-
OCCViewer_ViewPort3d* aViewPort = aViewFrame->getViewPort();
if ( aViewPort ) {
aViewPort->installEventFilter( this );
myOverview->setMainView( occwnd );
}
+
+void HYDROGUI_Module::setAutoZoomToAllViewManagers(bool bAutoZoom)
+{
+ ViewManagerList aViewManagers = getApp()->viewManagers();
+ foreach (SUIT_ViewManager* aVMgr, aViewManagers)
+ setAutoZoom(aVMgr, bAutoZoom);
+}
+
+void HYDROGUI_Module::setAutoZoom(SUIT_ViewManager* aVMgr, bool bAutoZoom)
+{
+ if (!aVMgr)
+ return;
+ 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(bAutoZoom);
+ for (int i = OCCViewer_ViewFrame::MAIN_VIEW; i<=OCCViewer_ViewFrame::TOP_RIGHT; i++)
+ {
+ OCCViewer_ViewWindow* aV = anOCCViewFrame->getView(i);
+ if (aV)
+ aV->setAutomaticZoom(bAutoZoom);
+ }
+ }
+ OCCViewer_ViewWindow* anOCCViewWindow = dynamic_cast<OCCViewer_ViewWindow*>( aView );
+ if (anOCCViewWindow)
+ anOCCViewWindow->setAutomaticZoom(bAutoZoom);
+ }
+ }
+}
+