source: pacpusframework/branches/2.0-beta1/include/extlib/qwtplot3d/qwt3d_autoscaler.h@ 89

Last change on this file since 89 was 89, checked in by morasjul, 11 years ago

PACPUS 2.0 Beta deployed in new branch

Major changes:
-Add communication interface between components
-Add examples for communications interface (TestComponents)
-Move to Qt5 support

  • Property svn:executable set to *
File size: 1.4 KB
Line 
1#ifndef __qwt3d_autoscaler_2003_08_18_12_05__
2#define __qwt3d_autoscaler_2003_08_18_12_05__
3
4#include <vector>
5#include "qwt3d_global.h"
6#include "qwt3d_autoptr.h"
7
8namespace Qwt3D
9{
10
11//! ABC for autoscaler
12class QWT3D_EXPORT AutoScaler
13{
14friend class qwt3d_ptr<AutoScaler>;
15protected:
16 //! Returns a new heap based object of the derived class.
17 virtual AutoScaler* clone() const = 0;
18 //! To implement from subclasses
19 virtual int execute(double& a, double& b, double start, double stop, int ivals) = 0;
20 virtual ~AutoScaler(){}
21
22private:
23 void destroy() const {delete this;} //!< Used by qwt3d_ptr
24};
25
26//! Automatic beautifying of linear scales
27class QWT3D_EXPORT LinearAutoScaler : public AutoScaler
28{
29friend class LinearScale;
30protected:
31 LinearAutoScaler();
32 explicit LinearAutoScaler(std::vector<double>& mantisses);
33 //! Returns a new heap based object utilized from qwt3d_ptr
34 AutoScaler* clone() const {return new LinearAutoScaler(*this);}
35 int execute(double& a, double& b, double start, double stop, int ivals);
36
37private:
38
39 double start_, stop_;
40 int intervals_;
41
42 void init(double start, double stop, int ivals);
43 double anchorvalue(double start, double mantisse, int exponent);
44 int segments(int& l_intervals, int& r_intervals, double start, double stop, double anchor, double mantissa, int exponent);
45 std::vector<double> mantissi_;
46};
47
48} // ns
49
50
51#endif
Note: See TracBrowser for help on using the repository browser.