🛰️航天仿真算法库 SpaceAST 0.0.1
载入中...
搜索中...
未找到
UiPointMassForce.hpp
1#pragma once
2
3#include "AstGlobal.h"
4#include "AstGUI/UiObject.hpp"
5#include "AstGUI/UiDouble.hpp"
6#include "AstGUI/UiQuantity.hpp"
7#include <QVBoxLayout>
8#include <QHBoxLayout>
9#include <QLabel>
10#include <QComboBox>
11
12AST_NAMESPACE_BEGIN
13
14class PointMassForce;
15
16class AST_GUI_API UiPointMassForce: public UiObject
17{
18 Q_OBJECT
19public:
20 UiPointMassForce(Object* object, QWidget *parent = nullptr);
21 UiPointMassForce(QWidget *parent = nullptr);
22 ~UiPointMassForce() = default;
23 UiPointMassForce(const UiPointMassForce&) = delete;
24 UiPointMassForce& operator=(const UiPointMassForce&) = delete;
25
26 PointMassForce* getPointMassForce() const;
27 void setPointMassForce(PointMassForce* pointMass);
28 void refreshUi();
29 void apply();
30protected:
31 void setupUi();
32 void refreshGMSource();
33private slots:
34 void applyTo(PointMassForce* pointMass);
35 void onGMSourceChanged(int index);
36private:
37 // 布局
38 QVBoxLayout* mainLayout_{nullptr};
39
40 // 引力常数来源
41 QHBoxLayout* gmSourceLayout_{nullptr};
42 QLabel* gmSourceLabel_{nullptr};
43 QComboBox* gmSourceCombo_{nullptr};
44
45 // 指定引力常数
46 QHBoxLayout* specifiedGMLayout_{nullptr};
47 QLabel* specifiedGMLabel_{nullptr};
48 UiQuantity* specifiedGMEdit_{nullptr};
49};
50
51AST_NAMESPACE_END
对象基类,继承自该类的对象可以使用运行时类型信息相关功能,实现强弱引用计数、运行时元信息(属性访问、序列化等)等基础功能
定义 Object.hpp:95
点质量引力模型/
定义 PointMassForce.hpp:35
与对象关联的 QWidget
定义 UiObject.hpp:36
定义 UiPointMassForce.hpp:17
数量输入框
定义 UiQuantity.hpp:41