From 3ed4f70e77bd6bbd24647c46279eb5af82cb2b58 Mon Sep 17 00:00:00 2001 From: nds Date: Wed, 5 Mar 2008 05:39:46 +0000 Subject: [PATCH] Method setAxisEnabled. --- src/Plot2d/Plot2d_ViewFrame.cxx | 22 ++++++++++++++++++---- src/Plot2d/Plot2d_ViewFrame.h | 1 + 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/src/Plot2d/Plot2d_ViewFrame.cxx b/src/Plot2d/Plot2d_ViewFrame.cxx index fef319331..1244096e7 100755 --- a/src/Plot2d/Plot2d_ViewFrame.cxx +++ b/src/Plot2d/Plot2d_ViewFrame.cxx @@ -261,12 +261,14 @@ void Plot2d_ViewFrame::Display( const Plot2d_Prs* prs ) return; if (prs->isSecondY()) { - myPlot->enableAxis(QwtPlot::yRight, true); - mySecondY = true; + setEnableAxis( QwtPlot::yRight, true ); + //myPlot->enableAxis(QwtPlot::yRight, true); + //mySecondY = true; } else { - myPlot->enableAxis(QwtPlot::yRight, false); - mySecondY = false; + setEnableAxis( QwtPlot::yRight, false ); + //myPlot->enableAxis(QwtPlot::yRight, false); + //mySecondY = false; } // display all curves from presentation @@ -1668,6 +1670,18 @@ bool Plot2d_ViewFrame::isYLogEnabled() const return allPositive; } +/** + * + */ +void Plot2d_ViewFrame::setEnableAxis( const QwtPlot::Axis& theAxis, const bool& isEnable ) +{ + if ( myPlot->axisEnabled( theAxis ) == isEnable ) + return; + myPlot->enableAxis( theAxis, isEnable ); + if ( theAxis == QwtPlot::yRight ) + mySecondY = isEnable; +} + class Plot2d_QwtPlotZoomer : public QwtPlotZoomer { public: diff --git a/src/Plot2d/Plot2d_ViewFrame.h b/src/Plot2d/Plot2d_ViewFrame.h index 0ca3e1f77..2637a16ab 100755 --- a/src/Plot2d/Plot2d_ViewFrame.h +++ b/src/Plot2d/Plot2d_ViewFrame.h @@ -139,6 +139,7 @@ public: // non-positive X/Y coordinate bool isXLogEnabled() const; bool isYLogEnabled() const; + void setEnableAxis( const QwtPlot::Axis&, const bool& ); virtual bool print( const QString& file, const QString& format ) const; void printPlot( QPainter* p, const QRect& rect, -- 2.39.2