Loading [MathJax]/extensions/TeX/AMSmath.js
Radium Engine  1.5.0
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Modules Pages
MaterialParameterEditor.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/ParameterSetEditor/ParameterSetEditor.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 
29 class RA_GUI_API MaterialParameterEditor : public QWidget
30 {
31  Q_OBJECT
32  public:
36  explicit MaterialParameterEditor( QWidget* parent = nullptr );
38  MaterialParameterEditor& operator=( const MaterialParameterEditor& ) = delete;
40  MaterialParameterEditor&& operator=( MaterialParameterEditor&& ) = delete;
41  ~MaterialParameterEditor() override = default;
53  const nlohmann::json& constraints,
54  const std::string& name = "" );
55 
63  void setupFromMaterial( std::shared_ptr<Ra::Engine::Data::Material> material );
64 
70  void showUnspecified( bool enable );
71 
72  signals:
76  void materialParametersModified( const std::string& name );
77 
78  private:
80  QLabel* m_matInstanceNameLabel;
82  QLabel* m_matNameLabel;
84  QPlainTextEdit* m_matProperties;
86  QVBoxLayout* m_matParamsLayout;
88  ParameterSetEditor* m_parametersControlPanel;
90  bool m_showUnspecified = false;
91 
92  // matInfoGroup
93  QGroupBox* m_matInfoGroup;
94 };
95 
96 } // namespace Gui
97 } // namespace Ra
Simple Widget for Material/RenderParameter edition A material editor will show information about the ...
void materialParametersModified(const std::string &name)
void setupFromParameters(Engine::Data::RenderParameters &params, const nlohmann::json &constraints, const std::string &name="")
Update the different UI element with the given renderParameter, using the given constraints.
Simple Widget for RenderParameter edition The editor will expose a control panel containing all of th...
Definition: Cage.cpp:3