Loading [MathJax]/extensions/TeX/AMSmath.js
Radium Engine  1.5.0
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Modules Pages
ParameterSetEditor.hpp
1 #pragma once
2 #include <Gui/RaGui.hpp>
3 
4 #include <QGroupBox>
5 #include <QLabel>
6 #include <QPlainTextEdit>
7 #include <QVBoxLayout>
8 #include <QWidget>
9 
10 #include <nlohmann/json.hpp>
11 
12 #include <Gui/Widgets/ControlPanel.hpp>
13 
14 namespace Ra {
15 namespace Engine {
16 namespace Data {
17 class Material;
18 class RenderParameters;
19 } // namespace Data
20 } // namespace Engine
21 
22 namespace Gui {
23 
25 namespace internal {
27 class RenderParameterUiBuilder;
28 } // namespace internal
34 class RA_GUI_API ParameterSetEditor : public Widgets::ControlPanel
35 {
36  Q_OBJECT
37  public:
41  explicit ParameterSetEditor( const std::string& name, QWidget* parent = nullptr );
42  ParameterSetEditor( const ParameterSetEditor& ) = delete;
43  ParameterSetEditor& operator=( const ParameterSetEditor& ) = delete;
45  ParameterSetEditor&& operator=( ParameterSetEditor&& ) = delete;
46  ~ParameterSetEditor() override = default;
57  void setupFromParameters( Engine::Data::RenderParameters& params,
58  const nlohmann::json& constraints );
59 
65  void showUnspecified( bool enable );
66 
67  signals:
71  void parameterModified( const std::string& name );
72 
73  private:
74  friend class internal::RenderParameterUiBuilder;
85  template <typename T>
86  void addEnumParameterWidget( const std::string& name,
87  T& initial,
89  const nlohmann::json& paramMetadata );
98  template <typename T>
99  void addNumberParameterWidget( const std::string& name,
100  T& initial,
102  const nlohmann::json& metadata );
103 
112  template <typename T>
113  void addVectorParameterWidget( const std::string& key,
114  std::vector<T>& initial,
116  const nlohmann::json& metadata );
117 
126  template <typename T>
127  void addMatrixParameterWidget( const std::string& key,
128  T& initial,
130  const nlohmann::json& metadata );
132  bool m_showUnspecified = false;
133 };
134 
135 } // namespace Gui
136 } // namespace Ra
Simple Widget for RenderParameter edition The editor will expose a control panel containing all of th...
void parameterModified(const std::string &name)
Definition: Cage.cpp:3