From 53f82ddf0b877048635841ba715ba72490a5f319 Mon Sep 17 00:00:00 2001 From: ouv Date: Wed, 3 Sep 2014 14:37:16 +0400 Subject: [PATCH] AFV: 0002108: External 20670 2D plot 2 YAXIS --- src/Plot2d/Plot2d_ViewFrame.cxx | 11 +++++++++++ src/Plot2d/Plot2d_ViewFrame.h | 1 + 2 files changed, 12 insertions(+) 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 ); -- 2.39.2