From 086cc8cd32b0cdee15e61a1aece4423896627080 Mon Sep 17 00:00:00 2001 From: adv Date: Tue, 1 Mar 2016 15:15:04 +0300 Subject: [PATCH] 0000588: External 584: All the curve characteristics must be saved. --- src/Plot2d/Plot2d_ViewFrame.cxx | 37 +++++++++++++++++++++++++++++---- src/Plot2d/Plot2d_ViewFrame.h | 20 +++++++++++------- 2 files changed, 46 insertions(+), 11 deletions(-) diff --git a/src/Plot2d/Plot2d_ViewFrame.cxx b/src/Plot2d/Plot2d_ViewFrame.cxx index d4160fbe1..19bebf92d 100755 --- a/src/Plot2d/Plot2d_ViewFrame.cxx +++ b/src/Plot2d/Plot2d_ViewFrame.cxx @@ -1434,8 +1434,8 @@ QColor Plot2d_ViewFrame::backgroundColor() const Sets hor.axis grid parameters */ void Plot2d_ViewFrame::setXGrid( bool xMajorEnabled, const int xMajorMax, - bool xMinorEnabled, const int xMinorMax, - bool update ) + bool xMinorEnabled, const int xMinorMax, + bool update ) { myXGridMajorEnabled = xMajorEnabled; myXGridMinorEnabled = xMinorEnabled; @@ -1454,11 +1454,22 @@ void Plot2d_ViewFrame::setXGrid( bool xMajorEnabled, const int xMajorMax, if ( update ) myPlot->replot(); } +/*! + Returns hor.axis grid parameters +*/ +void Plot2d_ViewFrame::getXGrid( bool& xMajorEnabled, int& xMajorMax, + bool& xMinorEnabled, int& xMinorMax ) +{ + xMajorEnabled = myXGridMajorEnabled; + xMinorEnabled = myXGridMinorEnabled; + xMajorMax = myXGridMaxMajor; + xMinorMax = myXGridMaxMinor; +} /*! Sets ver.axis grid parameters */ -void Plot2d_ViewFrame::setYGrid( bool yMajorEnabled, const int yMajorMax, - bool yMinorEnabled, const int yMinorMax, +void Plot2d_ViewFrame::setYGrid( bool yMajorEnabled, const int yMajorMax, + bool yMinorEnabled, const int yMinorMax, bool y2MajorEnabled, const int y2MajorMax, bool y2MinorEnabled, const int y2MinorMax, bool update ) @@ -1509,6 +1520,24 @@ void Plot2d_ViewFrame::setYGrid( bool yMajorEnabled, const int yMajorMax, if ( update ) myPlot->replot(); } +/*! + Returns ver.axis grid parameters +*/ +void Plot2d_ViewFrame::getYGrid( bool& yMajorEnabled, int& yMajorMax, + bool& yMinorEnabled, int& yMinorMax, + bool& y2MajorEnabled, int& y2MajorMax, + bool& y2MinorEnabled, int& y2MinorMax ) +{ + yMajorEnabled = myYGridMajorEnabled; + yMinorEnabled = myYGridMinorEnabled; + yMajorMax = myYGridMaxMajor; + yMinorMax = myYGridMaxMinor; + + y2MajorEnabled = mySecondY ? myY2GridMajorEnabled : true; + y2MinorEnabled = mySecondY ? myY2GridMinorEnabled : false; + y2MajorMax = mySecondY ? myY2GridMaxMajor : 8; + y2MinorMax = mySecondY ? myY2GridMaxMinor : 5; +} /*! Sets title for some axis diff --git a/src/Plot2d/Plot2d_ViewFrame.h b/src/Plot2d/Plot2d_ViewFrame.h index ff3a61fb1..d8570b457 100755 --- a/src/Plot2d/Plot2d_ViewFrame.h +++ b/src/Plot2d/Plot2d_ViewFrame.h @@ -100,18 +100,25 @@ public: int getCurveType() const { return myCurveType; } void setCurveTitle( Plot2d_Curve* curve, const QString& title ); void showLegend( bool show, bool update = true ); + bool isLegendShow() { return myShowLegend; }; void setLegendPos( int pos ); int getLegendPos() const { return myLegendPos; } void setMarkerSize( const int size, bool update = true ); int getMarkerSize() const { return myMarkerSize; } void setBackgroundColor( const QColor& color ); QColor backgroundColor() const; - void setXGrid( bool xMajorEnabled, const int xMajorMax, - bool xMinorEnabled, const int xMinorMax, bool update = true ); - void setYGrid( bool yMajorEnabled, const int yMajorMax, - bool yMinorEnabled, const int yMinorMax, - bool y2MajorEnabled, const int y2MajorMax, - bool y2MinorEnabled, const int y2MinorMax, bool update = true ); + void setXGrid( bool xMajorEnabled, const int xMajorMax, + bool xMinorEnabled, const int xMinorMax, bool update = true ); + void getXGrid( bool& xMajorEnabled, int& xMajorMax, + bool& xMinorEnabled, int& xMinorMax ); + void setYGrid( bool yMajorEnabled, const int yMajorMax, + bool yMinorEnabled, const int yMinorMax, + bool y2MajorEnabled, const int y2MajorMax, + bool y2MinorEnabled, const int y2MinorMax, bool update = true ); + void getYGrid( bool& yMajorEnabled, int& yMajorMax, + bool& yMinorEnabled, int& yMinorMax, + bool& y2MajorEnabled, int& y2MajorMax, + bool& y2MinorEnabled, int& y2MinorMax ); void setTitle( bool enabled, const QString& title, ObjectType type, bool update = true ); QString getTitle( ObjectType type ) const; @@ -132,7 +139,6 @@ public: bool isModeHorLinear(); bool isModeVerLinear(); - bool isLegendShow() { return myShowLegend; }; // Protection against QwtCurve::drawLines() bug in Qwt 0.4.x: // it crashes if switched to X/Y logarithmic mode, when one or more points have -- 2.39.2