Qwt User's Guide: qwt_double_range.h Source File

Qwt User's Guide 5.2.3

- Main Page
- Related Pages
- Classes

qwt_double_range.h
1 /* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
2 * Qwt Widget Library
3 * Copyright (C) 1997 Josef Wilgen
4 * Copyright (C) 2002 Uwe Rathmann
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the Qwt License, Version 1.0
8 *****************************************************************************/
9
10 #ifndef QWT_DOUBLE_RANGE_H
11 #define QWT_DOUBLE_RANGE_H
12
13 #include "qwt_global.h"
14
31 class QWT_EXPORT QwtDoubleRange
32 {
33 public:
34 QwtDoubleRange();
35 virtual ~QwtDoubleRange();
36
37 void setRange(double vmin, double vmax, double vstep = 0.0,
38 int pagesize = 1);
39
40 void setValid(bool);
41 bool isValid() const;
42
43 virtual void setValue(double);
44 double value() const;
45
46 void setPeriodic(bool tf);
47 bool periodic() const;
48
49 void setStep(double);
50 double step() const;
51
52 double maxValue() const;
53 double minValue() const;
54
55 int pageSize() const;
56
57 virtual void incValue(int);
58 virtual void incPages(int);
59 virtual void fitValue(double);
60
61 protected:
62
63 double exactValue() const;
64 double exactPrevValue() const;
65 double prevValue() const;
66
67 virtual void valueChange();
68 virtual void stepChange();
69 virtual void rangeChange();
70
71 private:
72 void setNewValue(double x, bool align = false);
73
74 double d_minValue;
75 double d_maxValue;
76 double d_step;
77 int d_pageSize;
78
79 bool d_isValid;
80 double d_value;
81 double d_exactValue;
82 double d_exactPrevValue;
83 double d_prevValue;
84
85 bool d_periodic;
86 };
87
88 #endif