if ( anAction ) anAction->setEnabled( anEnableTools );
}
-void HYDROGUI_Module::onOperation()
+void HYDROGUI_Module::resetViewState()
{
- const QAction* anAction = dynamic_cast<const QAction*>( sender() );
- int anId = actionId( anAction );
- if( anId >= 0 )
+ OCCViewer_ViewManager* mgr = dynamic_cast<OCCViewer_ViewManager*>(getApp()->viewManager( OCCViewer_Viewer::Type()));
+ if( mgr )
{
- OCCViewer_ViewManager* mgr = dynamic_cast<OCCViewer_ViewManager*>(
- getApp()->viewManager( OCCViewer_Viewer::Type() ) );
- if( mgr )
+ foreach( SUIT_ViewWindow* wnd, mgr->getViews() )
{
- foreach( SUIT_ViewWindow* wnd, mgr->getViews() )
+ OCCViewer_ViewFrame* vf = dynamic_cast<OCCViewer_ViewFrame*>( wnd );
+ if( vf )
{
- OCCViewer_ViewFrame* vf = dynamic_cast<OCCViewer_ViewFrame*>( wnd );
- if( vf )
- {
- for( int i=OCCViewer_ViewFrame::MAIN_VIEW; i<=OCCViewer_ViewFrame::TOP_RIGHT; i++ )
- {
- OCCViewer_ViewWindow* iwnd = vf->getView(i);
- if( iwnd )
- iwnd->resetState();
- }
- }
- else
+ for( int i=OCCViewer_ViewFrame::MAIN_VIEW; i<=OCCViewer_ViewFrame::TOP_RIGHT; i++ )
{
- OCCViewer_ViewWindow* ownd = dynamic_cast<OCCViewer_ViewWindow*>( wnd );
- if( ownd )
- ownd->resetState();
+ OCCViewer_ViewWindow* iwnd = vf->getView(i);
+ if( iwnd )
+ iwnd->resetState();
}
}
+ else
+ {
+ OCCViewer_ViewWindow* ownd = dynamic_cast<OCCViewer_ViewWindow*>( wnd );
+ if( ownd )
+ ownd->resetState();
+ }
}
+ }
+}
+
+void HYDROGUI_Module::onOperation()
+{
+ const QAction* anAction = dynamic_cast<const QAction*>( sender() );
+ int anId = actionId( anAction );
+ if( anId >= 0 )
+ {
+ resetViewState();
startOperation( anId );
}
{
HYDROGUI_BathymetryOp* op = dynamic_cast<HYDROGUI_BathymetryOp*>( operation( BathymetryTextId ) );
if( op )
- op->activate( false );
+ op->commit();
}
}