2 #include <HYDROGUI_Module.h>
3 #include <LightApp_Application.h>
4 #include <LightApp_SelectionMgr.h>
5 #include <GraphicsView_PrsImage.h>
6 #include <GraphicsView_Viewer.h>
7 #include <GraphicsView_ViewFrame.h>
8 #include <GraphicsView_ViewPort.h>
9 #include <LightApp_GVSelector.h>
10 #include <SUIT_ViewManager.h>
11 #include <SUIT_Desktop.h>
12 #include <QApplication>
13 #include <HYDROGUI_InputPanel.h>
14 #include <HYDROGUI_ObjSelector.h>
15 #include <HYDROGUI_Operations.h>
17 extern "C" HYDRO_EXPORT CAM_Module* createModule()
19 return new HYDROGUI_Module();
22 HYDROGUI_Module::HYDROGUI_Module()
23 : LightApp_Module( "HYDRO GUI" )
27 HYDROGUI_Module::~HYDROGUI_Module()
31 void HYDROGUI_Module::initialize( CAM_Application* theApp )
33 printf( "Initialization of the HYDROGUI module\n" );
34 LightApp_Module::initialize( theApp );
41 setMenuShown( false );
43 //startOperation( ImportImageId );
44 startOperation( FuseId );
47 bool HYDROGUI_Module::activateModule( SUIT_Study* theStudy )
50 return LightApp_Module::activateModule( theStudy );
53 void HYDROGUI_Module::windows( QMap<int, int>& theMap ) const
56 theMap.insert( LightApp_Application::WT_LogWindow, Qt::BottomDockWidgetArea );
57 theMap.insert( LightApp_Application::WT_ObjectBrowser, Qt::LeftDockWidgetArea );
60 void HYDROGUI_Module::viewManagers( QStringList& theTypesList ) const
62 theTypesList << GraphicsView_Viewer::Type();
65 void HYDROGUI_Module::onViewManagerAdded( SUIT_ViewManager* theMgr )
67 LightApp_Module::onViewManagerAdded( theMgr );
68 connect( theMgr, SIGNAL( viewCreated( SUIT_ViewWindow* ) ),
69 this, SLOT( onViewWindowAdded( SUIT_ViewWindow* ) ) );
72 void HYDROGUI_Module::onViewWindowAdded( SUIT_ViewWindow* theWnd )
74 GraphicsView_ViewFrame* aViewFrame = dynamic_cast<GraphicsView_ViewFrame*>( theWnd );
76 LightApp_SelectionMgr* aSelMgr = getApp()->selectionMgr();
77 LightApp_GVSelector* aSelector = new LightApp_GVSelector( aViewFrame->getViewer(), aSelMgr );
79 GraphicsView_ViewPort* aViewPort = aViewFrame->getViewPort();
81 GraphicsView_PrsImage* aPrs1 = new GraphicsView_PrsImage();
82 QImage anImage1( "W:/Work/HYDRO/data/samples/1.bmp" );
83 aPrs1->setImage( anImage1 );
84 aPrs1->setName( "example_1" );
86 aViewPort->addItem( aPrs1 );
88 GraphicsView_PrsImage* aPrs2 = new GraphicsView_PrsImage();
89 QImage anImage2( "W:/Work/HYDRO/data/samples/2.bmp" );
90 aPrs2->setImage( anImage2 );
91 aPrs2->setName( "example_2" );
92 aPrs2->setRotationAngle( 30 );
93 aPrs2->setPosition( 200, 50 );
95 aViewPort->addItem( aPrs2 );
97 //qApp->processEvents();