From 027436579afa6ffdcac8896df525f04577081803 Mon Sep 17 00:00:00 2001 From: sln Date: Thu, 11 Sep 2008 11:55:35 +0000 Subject: [PATCH] Possibility of specifying number of markers belong adjacent points moved here from For_CTH_V12 branch --- src/Plot2d/Plot2d_Curve.cxx | 22 +++++++++++++++++++++- src/Plot2d/Plot2d_Curve.h | 4 ++++ 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/src/Plot2d/Plot2d_Curve.cxx b/src/Plot2d/Plot2d_Curve.cxx index f027bedc4..fec976268 100755 --- a/src/Plot2d/Plot2d_Curve.cxx +++ b/src/Plot2d/Plot2d_Curve.cxx @@ -34,7 +34,8 @@ Plot2d_Curve::Plot2d_Curve() myMarker( Plot2d::Circle ), myLine( Plot2d::Solid ), myLineWidth( 0 ), - myYAxis( QwtPlot::yLeft ) + myYAxis( QwtPlot::yLeft ), + myNbMarkers( 1 ) { } @@ -60,6 +61,7 @@ Plot2d_Curve::Plot2d_Curve( const Plot2d_Curve& curve ) myLine = curve.getLine(); myLineWidth = curve.getLineWidth(); myPoints = curve.getPointList(); + myNbMarkers = curve.getNbMarkers(); } /*! @@ -77,6 +79,7 @@ Plot2d_Curve& Plot2d_Curve::operator=( const Plot2d_Curve& curve ) myLine = curve.getLine(); myLineWidth = curve.getLineWidth(); myPoints = curve.getPointList(); + myNbMarkers = curve.getNbMarkers(); return *this; } @@ -314,6 +317,23 @@ Plot2d::MarkerType Plot2d_Curve::getMarker() const return myMarker; } +/*! + Sets number of markers per step ( and resets AutoAssign flag ). +*/ +void Plot2d_Curve::setNbMarkers( const int nbMarkers ) +{ + myNbMarkers = nbMarkers; + myAutoAssign = false; +} + +/*! + Gets number of markers per step ( and resets AutoAssign flag ). +*/ +int Plot2d_Curve::getNbMarkers() const +{ + return myNbMarkers; +} + /*! Sets curve's line type and width ( and resets AutoAssign flag ) NOTE : A line width of 0 will produce a 1 pixel wide line using a fast algorithm for diagonals. diff --git a/src/Plot2d/Plot2d_Curve.h b/src/Plot2d/Plot2d_Curve.h index 330095415..8692be8c9 100755 --- a/src/Plot2d/Plot2d_Curve.h +++ b/src/Plot2d/Plot2d_Curve.h @@ -85,6 +85,9 @@ public: void setMarker( Plot2d::MarkerType ); Plot2d::MarkerType getMarker() const; + void setNbMarkers( const int ); + int getNbMarkers() const; + void setLine( Plot2d::LineType, const int = 0 ); Plot2d::LineType getLine() const; int getLineWidth() const; @@ -111,6 +114,7 @@ protected: QString myVerUnits; QColor myColor; Plot2d::MarkerType myMarker; + int myNbMarkers; Plot2d::LineType myLine; int myLineWidth; QwtPlot::Axis myYAxis; -- 2.39.2