From 704b788d2b9ab761a2402aca62ba8b94c71b4983 Mon Sep 17 00:00:00 2001 From: adv Date: Fri, 28 Mar 2014 12:22:52 +0400 Subject: [PATCH] Function to access right AXIS added. --- src/Plot2d/Plot2d_ViewFrame.cxx | 18 ++++++++++-------- src/Plot2d/Plot2d_ViewFrame.h | 2 ++ 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/src/Plot2d/Plot2d_ViewFrame.cxx b/src/Plot2d/Plot2d_ViewFrame.cxx index 94bf51630..b7c609afa 100755 --- a/src/Plot2d/Plot2d_ViewFrame.cxx +++ b/src/Plot2d/Plot2d_ViewFrame.cxx @@ -278,14 +278,7 @@ void Plot2d_ViewFrame::Display( const Plot2d_Prs* prs ) if ( !prs || prs->IsNull() ) return; - if (prs->isSecondY()) { - myPlot->enableAxis(QwtPlot::yRight, true); - mySecondY = true; - } - else { - myPlot->enableAxis(QwtPlot::yRight, false); - mySecondY = false; - } + setSecondY( prs->isSecondY() ); // display all curves from presentation curveList aCurves = prs->getCurves(); @@ -295,6 +288,15 @@ void Plot2d_ViewFrame::Display( const Plot2d_Prs* prs ) myY2GridMajorEnabled, myY2GridMaxMajor, myY2GridMinorEnabled, myY2GridMaxMinor, true ); } +/*! + Set second Y +*/ +void Plot2d_ViewFrame::setSecondY( const bool& theSecondY ) +{ + myPlot->enableAxis(QwtPlot::yRight, theSecondY); + mySecondY = theSecondY; +} + /*! Erase presentation */ diff --git a/src/Plot2d/Plot2d_ViewFrame.h b/src/Plot2d/Plot2d_ViewFrame.h index 620a3c81d..0e52ba67e 100755 --- a/src/Plot2d/Plot2d_ViewFrame.h +++ b/src/Plot2d/Plot2d_ViewFrame.h @@ -110,6 +110,8 @@ public: void setTitle( bool enabled, const QString& title, ObjectType type, bool update = true ); QString getTitle( ObjectType type ) const; + void setSecondY( const bool& theSecondY ); + bool isTitleChangedByUser( const ObjectType type ); void forgetLocalUserChanges( const ObjectType type ); -- 2.39.2