Radium Engine  1.5.20
Loading...
Searching...
No Matches
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
14namespace Ra {
15
16namespace Core {
17class VariableSet;
18}
19namespace Engine {
20namespace Data {
21class Material;
22class RenderParameters;
23} // namespace Data
24} // namespace Engine
25
26namespace Gui {
27
34{
35 Q_OBJECT
36 public:
37 explicit VariableSetEditor( const std::string& name, QWidget* parent = nullptr );
38 VariableSetEditor( const VariableSetEditor& ) = delete;
39 VariableSetEditor& operator=( const VariableSetEditor& ) = delete;
41 VariableSetEditor&& operator=( VariableSetEditor&& ) = delete;
42 ~VariableSetEditor() = default;
43
50 void setupUi( Core::VariableSet& params, const nlohmann::json& constraints );
51
56 void setShowUnspecified( bool enable ) { m_showUnspecified = enable; }
57 bool showUnspecified() { return m_showUnspecified; }
58
69 template <typename T>
70 void addEnumWidget( const std::string& name,
71 T& initial,
72 Core::VariableSet& params,
73 const nlohmann::json& paramMetadata );
82 template <typename T>
83 void addNumberWidget( const std::string& name,
84 T& initial,
85 Core::VariableSet& params,
86 const nlohmann::json& metadata );
87
96 template <typename T>
97 void addVectorWidget( const std::string& key,
98 std::vector<T>& initial,
99 Core::VariableSet& params,
100 const nlohmann::json& metadata );
101
110 template <typename T>
111 void addMatrixWidget( const std::string& key,
112 T& initial,
113 Core::VariableSet& params,
114 const nlohmann::json& metadata );
115
116 signals:
120 void parameterModified( const std::string& name );
121
122 private:
124 bool m_showUnspecified = false;
125};
126
127} // namespace Gui
128} // namespace Ra
Heterogeneous container storing "Variables", that maps a name (std::string) to a value (of any type T...
Simple Widget for RenderParameter editing The editor will expose a control panel containing all of th...
void setShowUnspecified(bool enable)
Wether to show parameters without associated metadata.
void parameterModified(const std::string &name)
hepler function to manage enum as underlying types in VariableSet
Definition Cage.cpp:3