QWT API (中文) 7.3.0
Qt绘图库 - 中文API文档
载入中...
搜索中...
未找到
qwt3d_colorlegend.h
1#ifndef QWT3D_COLORLEGEND_H
2#define QWT3D_COLORLEGEND_H
3
4#include "qwt3d_global.h"
5#include "qwt3d_drawable.h"
6#include "qwt3d_axis.h"
7#include "qwt3d_color.h"
8
9#include <QRectF>
10
11
12
18class QWT3D_EXPORT Qwt3DColorLegend : public Qwt3DDrawable
19{
20 QWT_DECLARE_PRIVATE(Qwt3DColorLegend)
21
22public:
23 // Possible anchor points for caption and axis
24 enum SCALEPOSITION
25 {
26 Top,
27 Bottom,
28 Left,
29 Right
30 };
31
32 // Orientation of the legend
33 enum ORIENTATION
34 {
35 BottomTop,
36 LeftRight
37 };
38
39 // Predefined screen positions for the legend
40 enum Position
41 {
42 PosTopLeft,
43 PosTopCenter,
44 PosTopRight,
45 PosLeftCenter,
46 PosCenter,
47 PosRightCenter,
48 PosBottomLeft,
49 PosBottomCenter,
50 PosBottomRight,
51 PosCustom
52 };
53
54 // Standard constructor
56 ~Qwt3DColorLegend() override;
57
58 // Draws the object - called by paintGL()
59 void draw(const Qwt3DRenderContext& ctx) override;
60
61 // Sets the relative position of the legend inside widget
62 void setRelPosition(Tuple relMin, Tuple relMax);
63 // Sets legend to a predefined screen position
64 void setPosition(Position pos);
65 // Sets legend position using absolute pixel coordinates (Qt coordinate system, origin top-left)
66 void setAbsolutePosition(const QRectF& pixelRect);
67 // Returns the current position mode
68 Position position() const;
69 // Returns the absolute pixel rect (only meaningful when useAbsolutePosition() is true)
70 QRectF absolutePosition() const;
71 // Returns true if absolute positioning is active
72 bool useAbsolutePosition() const;
73 // Returns the legend orientation
74 ORIENTATION orientation() const;
75 // Returns the scale position
76 SCALEPOSITION scalePosition() const;
77 // Returns whether the scale is drawn
78 bool drawScale() const;
79 // Returns the scale limits
80 void limits(double& start, double& stop) const;
81 // Returns the number of major tics
82 int majors() const;
83 // Returns the number of minor tics
84 int minors() const;
85 // Returns the legend caption string
86 QString titleString() const;
87 // Sets legend orientation and scale position
88 void setOrientation(ORIENTATION, SCALEPOSITION);
89 // Sets the limit of the scale
90 void setLimits(double start, double stop);
91 // Sets scale major tics
92 void setMajors(int);
93 // Sets scale minor tics
94 void setMinors(int);
95 // Sets whether a scale will be drawn
96 void drawScale(bool val);
97 // Sets whether the scale will have scale numbers
98 void drawNumbers(bool val);
99 // Sets whether the axis is autoscaled or not
100 void setAutoScale(bool val);
101 // Sets another scale
102 void setScale(Qwt3DScale* scale);
103 // Sets one of the predefined scale types
104 void setScale(SCALETYPE);
105
106 // Sets the legends caption string
107 void setTitleString(QString const& s);
108
109 // Sets the legends caption font
110 void setTitleFont(QString const& family, int pointSize, int weight = QFont::Normal, bool italic = false);
111
112 // The color vector
113 ColorVector colors;
114
115private:
116 ParallelEpiped geometry() const;
117 void setGeometryInternal(const Qwt3DRenderContext& ctx);
118};
119
120
121#endif
A flat color legend
Definition qwt3d_colorlegend.h:19
Abstract base class for Drawables
Definition qwt3d_drawable.h:18
Non-visual scale class encapsulating tic generation
Definition qwt3d_scale.h:21
Parallelepiped spanned by 2 Triples
Definition qwt3d_types.h:334
Bundles all widget resources that drawables need during rendering
Definition qwt3d_render_context.h:38
Tuple [x,y]
Definition qwt3d_types.h:182