diff --git a/Modules/Visualization/Monteverdi/src/mvdMainWindow.cxx b/Modules/Visualization/Monteverdi/src/mvdMainWindow.cxx index 656587c0ad5bfd1ab600d4c3681f254b9aad43b9..136343a139cb84f0e804a452e49e6288be0fd154 100644 --- a/Modules/Visualization/Monteverdi/src/mvdMainWindow.cxx +++ b/Modules/Visualization/Monteverdi/src/mvdMainWindow.cxx @@ -107,7 +107,6 @@ namespace mvd /* CONSTANTS */ #define REFERENCE_LAYER_COMBOBOX_NAME "referenceLayerComboBox" -#define REFERENCE_PROJECTION_ZOOM_LINE_EDIT "ProjZoomLineEdit" #define FORCE_NO_GLSL ( ( defined( OTB_DEBUG ) && 0 ) || 0 ) @@ -142,9 +141,9 @@ MainWindow #endif // USE_TABBED_VIEW m_StatusBarWidget( NULL ), m_ShaderWidget( NULL ), - m_ProjectionBarWidget( NULL ), m_FilenameDragAndDropEventFilter( NULL ), m_KeymapDialog( NULL ), + m_ProjectionBarWidget( NULL ), m_GLSL140( -2 ), m_isGLSLAvailable( false ), m_ForceNoGLSL( false ) @@ -639,23 +638,21 @@ MainWindow assert( m_ProjectionBarWidget!=NULL ); assert( m_ImageView!=NULL ); -/* QObject::connect( - m_ImageView, - SIGNAL( ScaleChanged( double, double ) ), - // to: - m_ProjectionBarWidget, - SLOT( SetProjectionScale( double, double ) ) + m_ImageView, + SIGNAL( ScaleChanged( double, double ) ), + // to: + m_ProjectionBarWidget, + SLOT( SetProjectionScale( double, double ) ) ); QObject::connect( - m_ProjectionBarWidget, - SIGNAL( ProjectionScaleChanged( double ) ), - // to: - m_ImageView->GetManipulator(), - SLOT( ZoomTo( double ) ) + m_ProjectionBarWidget, + SIGNAL( ProjectionScaleChanged( double ) ), + // to: + m_ImageView->GetManipulator(), + SLOT( ZoomTo( double ) ) ); - */ } diff --git a/Modules/Visualization/MonteverdiGui/include/mvdProjectionBarWidget.h b/Modules/Visualization/MonteverdiGui/include/mvdProjectionBarWidget.h index 658487758cecd816fb6d9125a41283bec03de9a7..5a2d40ee7936b0b6ddb52cf00c65b7d9318050bc 100644 --- a/Modules/Visualization/MonteverdiGui/include/mvdProjectionBarWidget.h +++ b/Modules/Visualization/MonteverdiGui/include/mvdProjectionBarWidget.h @@ -84,6 +84,9 @@ public: /** \brief Destructor. */ ~ProjectionBarWidget() ITK_OVERRIDE; +public slots: + void SetProjectionScale(double scale_x, double scale_y); + private: /** diff --git a/Modules/Visualization/MonteverdiGui/src/mvdProjectionBarWidget.cxx b/Modules/Visualization/MonteverdiGui/src/mvdProjectionBarWidget.cxx index dde1b582d81ef2533d6746bf5c704eac942c81a3..0e74ba6632697233c22c2a8c2c63c6627992b0e5 100644 --- a/Modules/Visualization/MonteverdiGui/src/mvdProjectionBarWidget.cxx +++ b/Modules/Visualization/MonteverdiGui/src/mvdProjectionBarWidget.cxx @@ -37,6 +37,19 @@ ProjectionBarWidget::~ProjectionBarWidget() m_UI = NULL; } +void ProjectionBarWidget::SetProjectionScale(double scale_x, double scale_y) +{ + QString text = "1:1"; + + if( scale_x>1.0 ) + text = QString( "%1:1" ).arg( scale_x ); + + else if( scale_x<1.0 ) + text = QString( "1:%1" ).arg( 1.0 / scale_x ); + + m_UI->projectionScaleLineEdit->setText(text); +} + void ProjectionBarWidget::on_projectionScaleLineEdit_returnPressed() { ChangeScale();