From: ouv Date: Wed, 3 Sep 2014 10:37:16 +0000 (+0400) Subject: AFV: 0002108: External 20670 2D plot 2 YAXIS X-Git-Tag: CTH_1_10_b~4 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=53f82ddf0b877048635841ba715ba72490a5f319;p=modules%2Fgui.git AFV: 0002108: External 20670 2D plot 2 YAXIS --- diff --git a/src/Plot2d/Plot2d_ViewFrame.cxx b/src/Plot2d/Plot2d_ViewFrame.cxx index a6fd03948..c1b269078 100755 --- a/src/Plot2d/Plot2d_ViewFrame.cxx +++ b/src/Plot2d/Plot2d_ViewFrame.cxx @@ -297,6 +297,14 @@ void Plot2d_ViewFrame::setSecondY( const bool& theSecondY ) mySecondY = theSecondY; } +/*! + Get second Y +*/ +bool Plot2d_ViewFrame::getSecondY() +{ + return mySecondY; +} + /*! Erase presentation */ @@ -632,6 +640,8 @@ void Plot2d_ViewFrame::displayCurve( Plot2d_Curve* curve, bool update ) } setCurveType( aPCurve, myCurveType ); aPCurve->setData( curve->horData(), curve->verData(), curve->nbPoints() ); + if ( mySecondY ) + aPCurve->setYAxis( QwtPlot::yRight ); } updateTitles(); if ( update ) @@ -721,6 +731,7 @@ void Plot2d_ViewFrame::updateCurve( Plot2d_Curve* curve, bool update ) } aPCurve->setTitle( curve->getVerTitle() ); aPCurve->setVisible( true ); + aPCurve->setYAxis( mySecondY ? QwtPlot::yRight : QwtPlot::yLeft ); if ( update ) myPlot->replot(); } diff --git a/src/Plot2d/Plot2d_ViewFrame.h b/src/Plot2d/Plot2d_ViewFrame.h index 30b7424cb..079d0d9ec 100755 --- a/src/Plot2d/Plot2d_ViewFrame.h +++ b/src/Plot2d/Plot2d_ViewFrame.h @@ -111,6 +111,7 @@ public: QString getTitle( ObjectType type ) const; void setSecondY( const bool& theSecondY ); + bool getSecondY(); bool isTitleChangedByUser( const ObjectType type ); void forgetLocalUserChanges( const ObjectType type );