#include "HYDROGUI_ProfileInterpolateOp.h"
#include "HYDROGUI_RecognizeContoursOp.h"
#include "HYDROGUI_SubmersibleOp.h"
-#include "HYDROGUI_UnSubmersibleOp.h"
#include "HYDROGUI_StricklerTableOp.h"
#include "HYDROGUI_DuplicateOp.h"
#include "HYDROGUI_LandCoverMapOp.h"
#include "HYDROGUI_ImportLandCoverMapOp.h"
#include "HYDROGUI_BathymetrySelectionOp.h"
#include "HYDROGUI_BathymetryOp.h"
-#include "HYDROGUI_PolylineStyleOp.h"
#include "HYDROGUI_RegenerateRegionColorsOp.h"
-
+#include "HYDROGUI_PolylineStyleOp.h"
+#include "HYDROGUI_ZoneSetColorOp.h"
#include <HYDROData_Document.h>
#include <HYDROData_Obstacle.h>
#include <HYDROData_SplitToZonesTool.h>
#include <LightApp_Application.h>
-#include <CAM_Application.h>
+#include <OCCViewer_ViewModel.h>
+#include <OCCViewer_ViewManager.h>
+#include <OCCViewer_ViewWindow.h>
+#include <OCCViewer_ViewFrame.h>
#include <QtxListAction.h>
#include <QtxActionToolMgr.h>
createAction( LandCoverScalarMapModeOnId, "LC_SCALARMAP_COLORING_ON" );
createAction( LandCoverScalarMapModeOffId, "LC_SCALARMAP_COLORING_OFF" );
- createAction( ShowHideArrows, "SHOW_HIDE_ARROWS" );
createAction( RegenerateRegionColorsId, "REGENERATE_REGION_COLORS" );
-
+ createAction( ZoneSetColorId, "ZONE_SET_COLOR" );
+ createAction( ShowHideArrows, "SHOW_HIDE_ARROWS" );
}
void HYDROGUI_Module::createMenus()
if ( anAction ) anAction->setEnabled( anEnableTools );
}
+void HYDROGUI_Module::resetViewState()
+{
+ OCCViewer_ViewManager* mgr = dynamic_cast<OCCViewer_ViewManager*>(getApp()->viewManager( OCCViewer_Viewer::Type()));
+ if( mgr )
+ {
+ foreach( SUIT_ViewWindow* wnd, mgr->getViews() )
+ {
+ 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
+ {
+ 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 );
+ }
if( anId==ShowHideArrows )
{
anOp = new HYDROGUI_ShowHideOp( aModule, theId );
break;
case SubmersibleId:
- anOp = new HYDROGUI_SubmersibleOp( aModule );
+ anOp = new HYDROGUI_SubmersibleOp( aModule, true );
break;
case UnSubmersibleId:
- anOp = new HYDROGUI_UnSubmersibleOp( aModule );
+ anOp = new HYDROGUI_SubmersibleOp( aModule, false );
break;
case PolylineExtractionId:
anOp = new HYDROGUI_PolylineExtractionOp( aModule );
anOp = new HYDROGUI_LandCoverColoringOp( aModule, theId );
break;
case RegenerateRegionColorsId:
- anOp = new HYDROGUI_RegenerateRegionColorsOp( aModule );
+ anOp = new HYDROGUI_RegenerateRegionColorsOp( aModule );
+ break;
+ case ZoneSetColorId:
+ anOp = new HYDROGUI_ZoneSetColorOp( aModule );
+ break;
}
if( !anOp )
if( isChecked )
startOperation( BathymetryTextId );
else
- operation( BathymetryTextId )->abort();
+ {
+ HYDROGUI_BathymetryOp* op = dynamic_cast<HYDROGUI_BathymetryOp*>( operation( BathymetryTextId ) );
+ if( op )
+ op->commit();
+ }
}