🛰️航天仿真算法库 SpaceAST 0.0.1
载入中...
搜索中...
未找到
PropertyPages.hpp
浏览该文件的文档.
1
8#pragma once
9
10#include "AstGlobal.h"
11#include <QWidget>
12#include <QLineEdit>
13#include <QDoubleSpinBox>
14#include <QCheckBox>
15#include <QComboBox>
16#include <QPushButton>
17#include <array>
18
19namespace matplot {
20 class axes_type;
21 class line;
22 class surface;
23}
24
25AST_NAMESPACE_BEGIN
26
28class ColorButton : public QPushButton {
29 Q_OBJECT
30public:
31 explicit ColorButton(QWidget* parent = nullptr);
32 ColorButton(const ColorButton&) = delete;
33 ColorButton& operator=(const ColorButton&) = delete;
34 QColor color() const { return color_; }
35 void setColor(const QColor& c);
36signals:
37 void colorChanged(const QColor& c);
38private slots:
39 void onClick();
40private:
41 QColor color_{};
42};
43
45class AxesPropertyPage : public QWidget {
46 Q_OBJECT
47public:
48 explicit AxesPropertyPage(QWidget* parent = nullptr);
49 AxesPropertyPage(const AxesPropertyPage&) = delete;
50 AxesPropertyPage& operator=(const AxesPropertyPage&) = delete;
51 void load(matplot::axes_type* axes, int index);
52 void apply(matplot::axes_type* axes);
53
54private:
55 void setupUi();
56 QDoubleSpinBox* posLeft_{};
57 QDoubleSpinBox* posBottom_{};
58 QDoubleSpinBox* posW_{};
59 QDoubleSpinBox* posH_{};
60 QLineEdit* titleEdit_{};
61 QComboBox* fontCombo_{};
62 QDoubleSpinBox* fontSize_{};
63 QDoubleSpinBox* titleFontSizeMultiplier_{};
64 ColorButton* titleColorBtn_{};
65 ColorButton* bgColorBtn_{};
66 QLineEdit* xLabelEdit_{};
67 QLineEdit* yLabelEdit_{};
68 QDoubleSpinBox* xMin_{};
69 QDoubleSpinBox* xMax_{};
70 QDoubleSpinBox* yMin_{};
71 QDoubleSpinBox* yMax_{};
72 QCheckBox* xVisible_{};
73 QCheckBox* yVisible_{};
74 QCheckBox* gridVisible_{};
75};
76
78class LinePropertyPage : public QWidget {
79 Q_OBJECT
80public:
81 explicit LinePropertyPage(QWidget* parent = nullptr);
82 LinePropertyPage(const LinePropertyPage&) = delete;
83 LinePropertyPage& operator=(const LinePropertyPage&) = delete;
84 void load(class matplot::line* line, int index);
85 void apply(class matplot::line* line);
86
87private:
88 void setupUi();
89 QLineEdit* nameEdit_{};
90 ColorButton* lineColorBtn_{};
91 QComboBox* lineStyleCombo_{};
92 QDoubleSpinBox* lineWidth_{};
93 QComboBox* markerCombo_{};
94 QDoubleSpinBox* markerSize_{};
95 ColorButton* markerColorBtn_{};
96 ColorButton* markerFaceBtn_{};
97 QCheckBox* visibleCheck_{};
98};
99
101class SurfacePropertyPage : public QWidget {
102 Q_OBJECT
103public:
104 explicit SurfacePropertyPage(QWidget* parent = nullptr);
106 SurfacePropertyPage& operator=(const SurfacePropertyPage&) = delete;
107 void load(class matplot::surface* surf, int index);
108 void apply(class matplot::surface* surf);
109
110private:
111 void setupUi();
112 QLineEdit* nameEdit_{};
113 QCheckBox* surfaceVisible_{};
114 QCheckBox* lightingCheck_{};
115 QDoubleSpinBox* faceAlpha_{};
116 ColorButton* edgeColorBtn_{};
117 QDoubleSpinBox* edgeWidth_{};
118 QCheckBox* colorbarVisible_{};
119};
120
121AST_NAMESPACE_END
坐标轴属性编辑页
定义 PropertyPages.hpp:45
辅助:颜色按钮(点击弹出 QColorDialog)
定义 PropertyPages.hpp:28
折线/散点属性编辑页
定义 PropertyPages.hpp:78
曲面属性编辑页
定义 PropertyPages.hpp:101