PeriDyno 1.0.0
Loading...
Searching...
No Matches
PSettingEditor.h
Go to the documentation of this file.
1#pragma once
2
3#include <QMainWindow>
4
5#include <QMouseEvent>
6#include <QCheckBox>
7#include <QSlider>
8#include <QPushButton>
9#include <QGridLayout>
10#include <QComboBox>
11#include <QSpinBox>
12#include <QLineEdit>
13
16#include "PPropertyWidget.h"
17
18namespace dyno
19{
20 class PSettingWidget;
22 class SceneGraph;
23 class RenderEngine;
24 class GLRenderEngine;
25
27 public QMainWindow
28 {
29 Q_OBJECT
30 public:
31 PSettingEditor(QWidget* widget = nullptr);
32
34
36
37 void setRenderEngine(std::shared_ptr<RenderEngine> engine);
38
39 signals:
40 void changed(SceneGraph* scn);
41
42 public slots:
43
46
48
49 private:
50
53 QDockWidget* DockerRight = nullptr;
54 };
55
57 public QWidget
58 {
59 Q_OBJECT
60 public:
61 PSettingWidget(PSettingEditor* editor,std::string title);
62
64
65 QGridLayout* getScrollLayout() { return mScrollLayout; }
67 void setLabelTitle(std::string text) { mTitle->setText(QString(text.c_str())); };
68
69 signals:
70 void changed(SceneGraph* scn);
71
72 public slots:
73
74 virtual void updateData() { ; }
75
76 private:
77
79 QGridLayout* layoutRight = nullptr;
80 QVBoxLayout* mMainLayout = nullptr;
81 QScrollArea* mScrollArea = nullptr;
82 QGridLayout* mScrollLayout = nullptr;
83 QLabel* mTitle = nullptr;
84 };
85
86
88 public PSettingWidget
89 {
90 Q_OBJECT
91 public:
92 PSceneSetting(PSettingEditor* editor,std::string title)
93 :PSettingWidget(editor,title)
94 { }
96 public slots:
97 void updateData() override;
98 void setGravity(double v0, double v1, double v2);
99 void setLowerBound(double v0, double v1, double v2);
100 void setUpperBound(double v0, double v1, double v2);
101 private:
102
106 };
107
108
110 public PSettingWidget
111 {
112 Q_OBJECT
113 public:
114 PRenderSetting(PSettingEditor* editor, std::string title);
116
117 void setRenderEngine(std::shared_ptr<RenderEngine> engine);
118
119 public slots:
120 void updateData() override;
121
122 void setMSAA(int idx);
123
124 void setShadowMapSize(int idx);
125
126 void setShadowBlurIters(int iters);
127
128
129 private:
130 std::shared_ptr<GLRenderEngine> mRenderEngine = nullptr;
131
132 QCheckBox* fxaaEnabled;
133 QComboBox* msaaSamples;
134 QComboBox* shadowMapSize;
136 QLineEdit* mLineEdit = nullptr;
137 };
138
140 public PSettingWidget
141 {
142 Q_OBJECT
143 public:
144 POtherSetting(PSettingEditor* editor,std::string title)
145 :PSettingWidget(editor,title)
146 {}
147
149
150 public slots:
151
152 void updateData() override
153 {
154 QFont font("Microsoft YaHei", 20, 75);
155
156 QLabel* overviveLabel = new QLabel("Overview");
157 overviveLabel->setFont(font);
158
159 QLabel* textLabel1 = new QLabel("PeriDyno is a CUDA-based, highly parallal physics engine targeted at providing real-time simulation of physical environments for intelligent agents.");
160 textLabel1->setWordWrap(true);
161
162 QLabel* licenseLabel = new QLabel("License");
163 licenseLabel->setFont(font);
164
165
166 QLabel* textLabel2 = new QLabel("Peridyno's default license is the Apache 2.0 (See LICENSE).\nExternal libraries are distributed under their own terms.\n");
167 textLabel2->setWordWrap(true);
168
169 getScrollLayout()->addWidget(overviveLabel);
170 getScrollLayout()->addWidget(textLabel1);
171 getScrollLayout()->addWidget(licenseLabel);
172 getScrollLayout()->addWidget(textLabel2);
173 }
174
175 };
176
177
179 public QPushButton
180 {
181 Q_OBJECT
182 public:
183 PPushButton(const QString& text, QWidget* parent = nullptr)
184 : QPushButton(text, parent)
185 {
186 str = text;
187 };
188
190
191 signals:
192 void active(QString);
193
194 public slots:
195
196 protected:
197 void mousePressEvent(QMouseEvent* e) override
198 {
199 emit active(str);
200 }
201
202
203 private:
204 QString str = nullptr;
205
206
207 };
208
209}
POtherSetting(PSettingEditor *editor, std::string title)
void updateData() override
PPushButton(const QString &text, QWidget *parent=nullptr)
void mousePressEvent(QMouseEvent *e) override
void active(QString)
PRenderSetting(PSettingEditor *editor, std::string title)
void setShadowBlurIters(int iters)
void setShadowMapSize(int idx)
std::shared_ptr< GLRenderEngine > mRenderEngine
void updateData() override
void setRenderEngine(std::shared_ptr< RenderEngine > engine)
QVector3FieldWidget * upperBoundWidget
void setLowerBound(double v0, double v1, double v2)
QVector3FieldWidget * lowerBoundWidget
void updateData() override
PSceneSetting(PSettingEditor *editor, std::string title)
void setGravity(double v0, double v1, double v2)
QVector3FieldWidget * gravityWidget
void setUpperBound(double v0, double v1, double v2)
PSettingWidget * renderSettingWidget
PSettingWidget * getSettingWidget()
PSettingWidget * settingWidget
PSettingEditor(QWidget *widget=nullptr)
void setRenderEngine(std::shared_ptr< RenderEngine > engine)
QDockWidget * DockerRight
void changed(SceneGraph *scn)
PSettingEditor * Editor
QGridLayout * mScrollLayout
QVBoxLayout * mMainLayout
void setLabelTitle(std::string text)
QGridLayout * getScrollLayout()
QGridLayout * layoutRight
virtual void updateData()
PSettingEditor * getEditor()
void changed(SceneGraph *scn)
PSettingWidget(PSettingEditor *editor, std::string title)
QScrollArea * mScrollArea
This is an implementation of AdditiveCCD based on peridyno.
Definition Array.h:25