1 | #ifndef __PLANE_H__
|
---|
2 | #define __PLANE_H__
|
---|
3 |
|
---|
4 | #include "qwt3d_global.h"
|
---|
5 | #include "qwt3d_drawable.h"
|
---|
6 | #include "qwt3d_axis.h"
|
---|
7 | #include "qwt3d_color.h"
|
---|
8 |
|
---|
9 | namespace Qwt3D
|
---|
10 | {
|
---|
11 |
|
---|
12 | //! A flat color legend
|
---|
13 | /**
|
---|
14 | The class visualizes a ColorVector together with a scale (axis) and a caption. ColorLegends are vertical
|
---|
15 | or horizontal
|
---|
16 | */
|
---|
17 | class QWT3D_EXPORT ColorLegend : public Drawable
|
---|
18 | {
|
---|
19 |
|
---|
20 | public:
|
---|
21 |
|
---|
22 | //! Possible anchor points for caption and axis
|
---|
23 | enum SCALEPOSITION
|
---|
24 | {
|
---|
25 | Top, //!< scale on top
|
---|
26 | Bottom, //!< scale on bottom
|
---|
27 | Left, //!< scale left
|
---|
28 | Right //!< scale right
|
---|
29 | };
|
---|
30 |
|
---|
31 | //! Orientation of the legend
|
---|
32 | enum ORIENTATION
|
---|
33 | {
|
---|
34 | BottomTop, //!< Positionate the legend vertically, the lowest color index is on the bottom
|
---|
35 | LeftRight //!< Positionate the legend horizontally, the lowest color index is on left side
|
---|
36 | };
|
---|
37 |
|
---|
38 | ColorLegend(); //!< Standard constructor
|
---|
39 |
|
---|
40 | void draw(); //!< Draws the object. You should not use this explicitely - the function is called by updateGL().
|
---|
41 |
|
---|
42 | void setRelPosition(Qwt3D::Tuple relMin, Qwt3D::Tuple relMax); //!< Sets the relative position of the legend inside widget
|
---|
43 | void setOrientation(ORIENTATION, SCALEPOSITION); //!< Sets legend orientation and scale position
|
---|
44 | void setLimits(double start, double stop); //!< Sets the limit of the scale.
|
---|
45 | void setMajors(int); //!< Sets scale major tics.
|
---|
46 | void setMinors(int); //!< Sets scale minor tics.
|
---|
47 | void drawScale(bool val) { showaxis_ = val; } //!< Sets whether a scale will be drawn.
|
---|
48 | void drawNumbers(bool val) { axis_.setNumbers(val); } //!< Sets whether the scale will have scale numbers.
|
---|
49 | void setAutoScale(bool val); //!< Sets, whether the axis is autoscaled or not.
|
---|
50 | void setScale(Qwt3D::Scale *scale); //!< Sets another scale
|
---|
51 | void setScale(Qwt3D::SCALETYPE); //!< Sets one of the predefined scale types
|
---|
52 |
|
---|
53 | void setTitleString(QString const& s); //!< Sets the legends caption string.
|
---|
54 |
|
---|
55 | //! Sets the legends caption font.
|
---|
56 | void setTitleFont(QString const& family, int pointSize, int weight = QFont::Normal, bool italic = false);
|
---|
57 |
|
---|
58 | Qwt3D::ColorVector colors; //!< The color vector
|
---|
59 |
|
---|
60 | private:
|
---|
61 |
|
---|
62 | Qwt3D::Label caption_;
|
---|
63 | Qwt3D::ParallelEpiped geometry() const { return pe_;}
|
---|
64 | void setGeometryInternal();
|
---|
65 |
|
---|
66 | Qwt3D::ParallelEpiped pe_;
|
---|
67 | Qwt3D::Tuple relMin_, relMax_;
|
---|
68 | Qwt3D::Axis axis_;
|
---|
69 | SCALEPOSITION axisposition_;
|
---|
70 | ORIENTATION orientation_;
|
---|
71 |
|
---|
72 | bool showaxis_;
|
---|
73 | };
|
---|
74 |
|
---|
75 | } // ns
|
---|
76 |
|
---|
77 | #endif
|
---|