Changeset 8127 in ntrip for trunk/BNC/qwt/qwt_scale_engine.h
- Timestamp:
- May 10, 2017, 3:20:54 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/qwt/qwt_scale_engine.h
r4271 r8127 15 15 #include "qwt_interval.h" 16 16 17 class Qwt ScaleTransformation;17 class QwtTransform; 18 18 19 19 /*! … … 28 28 static double divideEps( double interval, double steps ); 29 29 30 static double ceil125( double x );31 static double floor125( double x);30 static double divideInterval( double interval, 31 int numSteps, uint base ); 32 32 }; 33 33 … … 40 40 The layout of the scale can be varied with setAttribute(). 41 41 42 Qwt offers implementations for logarithmic (log10) 43 and linear scales. Contributions for other types of scale engines 44 (date/time, log2 ... ) are welcome. 42 Qwt offers implementations for logarithmic and linear scales. 45 43 */ 46 44 … … 81 79 typedef QFlags<Attribute> Attributes; 82 80 83 explicit QwtScaleEngine( );81 explicit QwtScaleEngine( uint base = 10 ); 84 82 virtual ~QwtScaleEngine(); 83 84 void setBase( uint base ); 85 uint base() const; 85 86 86 87 void setAttribute( Attribute, bool on = true ); … … 113 114 \param x1 First interval limit 114 115 \param x2 Second interval limit 115 \param maxMaj Steps Maximum for the number of major steps116 \param maxMin Steps Maximum number of minor steps116 \param maxMajorSteps Maximum for the number of major steps 117 \param maxMinorSteps Maximum number of minor steps 117 118 \param stepSize Step size. If stepSize == 0.0, the scaleEngine 118 119 calculates one. 120 121 \return Calculated scale division 119 122 */ 120 123 virtual QwtScaleDiv divideScale( double x1, double x2, 121 int maxMaj Steps, int maxMinSteps,124 int maxMajorSteps, int maxMinorSteps, 122 125 double stepSize = 0.0 ) const = 0; 123 126 124 //! \return a transformation125 virtual QwtScaleTransformation *transformation() const = 0;127 void setTransformation( QwtTransform * ); 128 QwtTransform *transformation() const; 126 129 127 130 protected: 128 131 bool contains( const QwtInterval &, double val ) const; 129 132 QList<double> strip( const QList<double>&, const QwtInterval & ) const; 133 130 134 double divideInterval( double interval, int numSteps ) const; 131 135 … … 147 151 { 148 152 public: 153 QwtLinearScaleEngine( uint base = 10 ); 154 virtual ~QwtLinearScaleEngine(); 155 149 156 virtual void autoScale( int maxSteps, 150 157 double &x1, double &x2, double &stepSize ) const; … … 154 161 double stepSize = 0.0 ) const; 155 162 156 virtual QwtScaleTransformation *transformation() const;157 163 158 164 protected: … … 166 172 const QwtInterval &interval, double stepSize ) const; 167 173 168 void buildMinorTicks( 169 const QList<double>& majorTicks, 170 int maxMinMark, double step, 171 QList<double> &, QList<double> & ) const; 172 }; 173 174 /*! 175 \brief A scale engine for logarithmic (base 10) scales 174 void buildMinorTicks( const QList<double>& majorTicks, 175 int maxMinorSteps, double stepSize, 176 QList<double> &minorTicks, QList<double> &mediumTicks ) const; 177 }; 178 179 /*! 180 \brief A scale engine for logarithmic scales 176 181 177 182 The step size is measured in *decades* … … 183 188 */ 184 189 185 class QWT_EXPORT QwtLog10ScaleEngine: public QwtScaleEngine 186 { 187 public: 190 class QWT_EXPORT QwtLogScaleEngine: public QwtScaleEngine 191 { 192 public: 193 QwtLogScaleEngine( uint base = 10 ); 194 virtual ~QwtLogScaleEngine(); 195 188 196 virtual void autoScale( int maxSteps, 189 197 double &x1, double &x2, double &stepSize ) const; … … 193 201 double stepSize = 0.0 ) const; 194 202 195 virtual QwtScaleTransformation *transformation() const;196 197 203 protected: 198 QwtInterval log10( const QwtInterval& ) const;199 QwtInterval pow10( const QwtInterval& ) const;200 201 204 QwtInterval align( const QwtInterval&, double stepSize ) const; 202 205 … … 208 211 const QwtInterval &interval, double stepSize ) const; 209 212 210 QList<double> buildMinorTicks(211 const QList<double>& majorTicks,212 int maxMinMark, double step) const;213 void buildMinorTicks( const QList<double>& majorTicks, 214 int maxMinorSteps, double stepSize, 215 QList<double> &minorTicks, QList<double> &mediumTicks ) const; 213 216 }; 214 217
Note:
See TracChangeset
for help on using the changeset viewer.