QWT API (中文) 7.0.1
Qt绘图库 - 中文API文档
载入中...
搜索中...
未找到
qwt3d_coordsys.h
1#ifndef __COORDSYS_H__
2#define __COORDSYS_H__
3
4#include "qwt3d_axis.h"
5#include "qwt3d_colorlegend.h"
6
7namespace Qwt3D {
8
18class QWT3D_EXPORT CoordinateSystem : public Drawable
19{
20
21public:
22 explicit CoordinateSystem(Qwt3D::Triple blb = Qwt3D::Triple(0, 0, 0),
23 Qwt3D::Triple ftr = Qwt3D::Triple(0, 0, 0),
24 Qwt3D::COORDSTYLE = Qwt3D::BOX);
26
27 void init(Qwt3D::Triple beg = Qwt3D::Triple(0, 0, 0),
28 Qwt3D::Triple end = Qwt3D::Triple(0, 0, 0));
29 // Set style for the coordinate system (NOCOORD, FRAME or BOX)
30 void setStyle(Qwt3D::COORDSTYLE s, Qwt3D::AXIS frame_1 = Qwt3D::X1,
31 Qwt3D::AXIS frame_2 = Qwt3D::Y1, Qwt3D::AXIS frame_3 = Qwt3D::Z1);
32 // Return style of the coordinate system
33 Qwt3D::COORDSTYLE style() const { return style_; }
34 // first == front_left_bottom, second == back_right_top
35 void setPosition(Qwt3D::Triple first,
36 Qwt3D::Triple second);
37
38 // Set common color for all axes
39 void setAxesColor(Qwt3D::RGBA val);
40 // Set common font for all axis numberings
41 void setNumberFont(QString const &family, int pointSize, int weight = QFont::Normal,
42 bool italic = false);
43 // Set common font for all axis numberings
44 void setNumberFont(QFont const &font);
45 // Set common color for all axis numberings
46 void setNumberColor(Qwt3D::RGBA val);
47 // Sets an linear axis with real number items
48 void setStandardScale();
49
50 // Fine tunes distance between axis numbering and axis body
51 void adjustNumbers(int val);
52 // Fine tunes distance between axis label and axis body
53 void adjustLabels(int val);
54
55 // Sets color for the grid lines
56 void setGridLinesColor(Qwt3D::RGBA val) { gridlinecolor_ = val; }
57
58 // Set common font for all axis labels
59 void setLabelFont(QString const &family, int pointSize, int weight = QFont::Normal,
60 bool italic = false);
61 // Set common font for all axis labels
62 void setLabelFont(QFont const &font);
63 // Set common color for all axis labels
64 void setLabelColor(Qwt3D::RGBA val);
65
66 // Set line width for tic marks and axes
67 void setLineWidth(double val, double majfac = 0.9, double minfac = 0.5);
68 // Set length for tic marks
69 void setTicLength(double major, double minor);
70
71 // Switch autoscaling of axes
72 void setAutoScale(bool val = true);
73
74 Qwt3D::Triple first() const { return first_; }
75 Qwt3D::Triple second() const { return second_; }
76
77 void setAutoDecoration(bool val = true) { autodecoration_ = val; }
78 bool autoDecoration() const { return autodecoration_; }
79
80 // Draw smooth axes
81 void setLineSmooth(bool val = true) { smooth_ = val; }
82 // Smooth axes enabled?
83 bool lineSmooth() const { return smooth_; }
84
85 void draw();
86
87 // Defines whether a grid between the major and/or minor tics should be drawn
88 void setGridLines(bool majors, bool minors, int sides = Qwt3D::NOSIDEGRID);
89 // Returns grids switched on
90 int grids() const { return sides_; }
91
92 // The vector of all 12 axes - use them to set axis properties individually
93 std::vector<Axis> axes;
94
95private:
96 void destroy();
97
98 Qwt3D::Triple first_, second_;
99 Qwt3D::COORDSTYLE style_;
100
101 Qwt3D::RGBA gridlinecolor_;
102
103 bool smooth_;
104
105 void chooseAxes();
106 void autoDecorateExposedAxis(Axis &ax, bool left);
107 void drawMajorGridLines();
108 void drawMinorGridLines();
109 void drawMajorGridLines(Qwt3D::Axis &, Qwt3D::Axis &);
110 void drawMinorGridLines(Qwt3D::Axis &, Qwt3D::Axis &);
111 void recalculateAxesTics();
112
113 bool autodecoration_;
114 bool majorgridlines_, minorgridlines_;
115 int sides_;
116};
117
118} // ns
119
120#endif
带标题的自动缩放坐标轴
Definition qwt3d_axis.h:26
具有不同样式(BOX, FRAME)的坐标系
Definition qwt3d_coordsys.h:19
可绘制对象的抽象基类
Definition qwt3d_drawable.h:21
红-绿-蓝-透明度值
Definition qwt3d_types.h:480
三元组 [x,y,z]
Definition qwt3d_types.h:240