diff --git a/Code/Application/mvdMainWindow.cxx b/Code/Application/mvdMainWindow.cxx index 51642bb54c967161277bb0d8f6445efaa38e5ba2..566192b390ecebbc9ab306de4af4b7825679a13b 100644 --- a/Code/Application/mvdMainWindow.cxx +++ b/Code/Application/mvdMainWindow.cxx @@ -84,38 +84,40 @@ MainWindow setWindowTitle( PROJECT_NAME ); // instanciate the manipulator and the renderer relative to this widget - ImageViewManipulator* imageViewManipulator = new ImageViewManipulator(); - ImageModelRenderer* imageModelRenderer = new ImageModelRenderer(); + m_ImageViewManipulator = new ImageViewManipulator(); + m_ImageModelRenderer = new ImageModelRenderer(); // set the GLImageWidget as the centralWidget in MainWindow. setCentralWidget( new GLImageWidget( - imageViewManipulator, - imageModelRenderer, + m_ImageViewManipulator, + m_ImageModelRenderer, this ) ); - - // instanciate the Ql manipulator/renderer here to be able to connect - // its signals to the centralWidget manipulator slots + + // instanciate the Ql manipulator/renderer m_QLModelRenderer = new ImageModelRenderer(); m_QLViewManipulator = new QuicklookViewManipulator(); // Connect centralWidget manipulator to Ql renderer when viewportRegionChanged QObject::connect( - imageViewManipulator, SIGNAL( ViewportRegionRepresentationChanged(const PointType&, const PointType&) ), + m_ImageViewManipulator, SIGNAL( ViewportRegionRepresentationChanged(const PointType&, const PointType&) ), m_QLModelRenderer, SLOT( OnViewportRegionRepresentationChanged(const PointType&, const PointType&) ) ); // Connect ql mousePressEventpressed to centralWidget manipulator QObject::connect( m_QLViewManipulator, SIGNAL( ViewportRegionChanged(double, double) ), - imageViewManipulator, SLOT( OnViewportRegionChanged(double, double) ) + m_ImageViewManipulator, SLOT( OnViewportRegionChanged(double, double) ) ); // add the needed docks InitializeDockWidgets(); + // add needed widget to the status bar + InitializeStatusBarWidgets(); + // Connect Quit action of main menu to QApplication's quit() slot. QObject::connect( m_UI->action_Quit, SIGNAL( activated() ), @@ -142,6 +144,27 @@ MainWindow Application::Instance()->SetModel( NULL ); } +/*****************************************************************************/ +void +MainWindow +::InitializeStatusBarWidgets() +{ + // Add a QLabel to the status bar to show pixel coordinates + QLabel * currentPixelLabel = new QLabel(statusBar()); + currentPixelLabel->setAlignment(Qt::AlignCenter); + + // connect this widget to receive notification from + // ImageViewManipulator + QObject::connect( + m_ImageViewManipulator, + SIGNAL( CurrentCoordinatesUpdated(const QString& ) ), + currentPixelLabel, + SLOT( setText(const QString &) ) + ); + + statusBar()->addWidget(currentPixelLabel); +} + /*****************************************************************************/ void MainWindow @@ -150,6 +173,7 @@ MainWindow // // EXPERIMENTAL QUICKLOOK Widget. assert( qobject_cast< GLImageWidget* >( centralWidget() )!=NULL ); + GLImageWidget* qlWidget = new GLImageWidget( m_QLViewManipulator, m_QLModelRenderer, diff --git a/Code/Application/mvdMainWindow.h b/Code/Application/mvdMainWindow.h index fe867e22f97946a2dae255a35238ca6ca03e6ee6..da651101847d22a193d391d256256bada8da723d 100644 --- a/Code/Application/mvdMainWindow.h +++ b/Code/Application/mvdMainWindow.h @@ -63,6 +63,7 @@ namespace mvd // Internal class pre-declaration. class AbstractModel; class AbstractModelController; +class ImageViewManipulator; class QuicklookViewManipulator; class ImageModelRenderer; @@ -130,6 +131,9 @@ private: /** */ void InitializeDockWidgets(); + /** */ + void InitializeStatusBarWidgets(); + /** */ QDockWidget* AddWidgetToDock( QWidget* widget, @@ -175,6 +179,16 @@ private: */ Ui::MainWindow* m_UI; + /** + * \brief centralView manipulator. + */ + ImageViewManipulator* m_ImageViewManipulator; + + /** + * \brief centralView manipulator. + */ + ImageModelRenderer* m_ImageModelRenderer; + /** * \brief ql manipulator. */