Radium Engine  1.5.20
Loading...
Searching...
No Matches
Ra::Gui::VariableSetEditor Class Reference

Simple Widget for RenderParameter editing The editor will expose a control panel containing all of the editable parameters from a RenderParameter set. More...

#include <Gui/ParameterSetEditor/ParameterSetEditor.hpp>

+ Inheritance diagram for Ra::Gui::VariableSetEditor:
+ Collaboration diagram for Ra::Gui::VariableSetEditor:

Signals

void parameterModified (const std::string &name)
 

Public Member Functions

 VariableSetEditor (const std::string &name, QWidget *parent=nullptr)
 
 VariableSetEditor (const VariableSetEditor &)=delete
 
VariableSetEditoroperator= (const VariableSetEditor &)=delete
 
 VariableSetEditor (VariableSetEditor &&)=delete
 
VariableSetEditor && operator= (VariableSetEditor &&)=delete
 
void setupUi (Core::VariableSet &params, const nlohmann::json &constraints)
 Update the different UI element with the given renderParameter, using the given constraints.
 
void setShowUnspecified (bool enable)
 Wether to show parameters without associated metadata.
 
bool showUnspecified ()
 
template<typename T >
void addEnumWidget (const std::string &name, T &initial, Core::VariableSet &params, const nlohmann::json &paramMetadata)
 Add a combobox allowing to chose the value of an enumerator.
 
template<typename T >
void addNumberWidget (const std::string &name, T &initial, Core::VariableSet &params, const nlohmann::json &metadata)
 
template<typename T >
void addVectorWidget (const std::string &key, std::vector< T > &initial, Core::VariableSet &params, const nlohmann::json &metadata)
 
template<typename T >
void addMatrixWidget (const std::string &key, T &initial, Core::VariableSet &params, const nlohmann::json &metadata)
 
- Public Member Functions inherited from Ra::Gui::Widgets::ControlPanel
 ControlPanel (const std::string &name, bool hline=true, QWidget *parent=nullptr)
 
 ControlPanel (const ControlPanel &)=delete
 
ControlPaneloperator= (const ControlPanel &)=delete
 
 ControlPanel (ControlPanel &&)=delete
 
ControlPaneloperator= (ControlPanel &&)=delete
 
void addSeparator ()
 
void addStretch (int stretch)
 
void newLayout ()
 
void addOption (const std::string &name, std::function< void(bool)> callback, bool set=false, const std::string &tooltip="")
 
void addLabel (const std::string &text)
 
void addButton (const std::string &name, std::function< void()> callback, const std::string &tooltip="")
 
void addColorInput (const std::string &name, const std::function< void(const Ra::Core::Utils::Color &clr)> &callback, Ra::Core::Utils::Color color=Ra::Core::Utils::Color::Black(), bool withAlpha=true, const std::string &tooltip="")
 
template<typename T = Scalar>
void addNumberInput (const std::string &name, std::function< void(T)> callback, T initial, T min=std::numeric_limits< T >::lowest(), T max=std::numeric_limits< T >::max(), const std::string &tooltip="", int dec=3)
 
template<typename T = Scalar>
void addConstrainedNumberInput (const std::string &name, std::function< void(T)> callback, Scalar initial, std::function< bool(T)> predicate, const std::string &tooltip="", int dec=3)
 
void addSliderInput (const std::string &name, std::function< void(int)> callback, int initial=0, int min=0, int max=100, const std::string &tooltip="")
 
void addPowerSliderInput (const std::string &name, std::function< void(double)> callback, double initial=0, double min=0, double max=100, const std::string &tooltip="")
 
template<typename T = Scalar>
void addVectorInput (const std::string &name, std::function< void(const std::vector< T > &)> callback, const std::vector< T > &initial, const std::string &tooltip="")
 
void addMatrixInput (const std::string &name, std::function< void(const Ra::Core::MatrixN &)> callback, const Ra::Core::MatrixN &initial, int dec=3, const std::string &tooltip="")
 
void addFileInput (const std::string &name, std::function< void(std::string)> callback, const std::string &rootDirectory, const std::string &filters, const std::string &tooltip="")
 
void addFileOutput (const std::string &name, std::function< void(std::string)> callback, const std::string &rootDirectory, const std::string &filters, const std::string &tooltip="")
 
void addComboBox (const std::string &name, std::function< void(int)> callback, int initial, const std::vector< std::string > &items, const std::string &tooltip="")
 
void addComboBox (const std::string &name, std::function< void(const QString &)> callback, const std::string &initial, const std::vector< std::string > &items, const std::string &tooltip="")
 
void addWidget (QWidget *newWidget)
 

Detailed Description

Simple Widget for RenderParameter editing The editor will expose a control panel containing all of the editable parameters from a RenderParameter set.

Definition at line 33 of file ParameterSetEditor.hpp.

Constructor & Destructor Documentation

◆ VariableSetEditor()

Ra::Gui::VariableSetEditor::VariableSetEditor ( const std::string & name,
QWidget * parent = nullptr )
explicit

Definition at line 118 of file ParameterSetEditor.cpp.

Member Function Documentation

◆ addEnumWidget()

template<typename T >
void Ra::Gui::VariableSetEditor::addEnumWidget ( const std::string & name,
T & initial,
Core::VariableSet & params,
const nlohmann::json & paramMetadata )

Add a combobox allowing to chose the value of an enumerator.

Note
Only un-scoped enum (i.e. implicitly convertible from and to integral type), with enumerators without initializer.
Template Parameters
T
Parameters
name
initial
params
paramMetadata

Definition at line 122 of file ParameterSetEditor.cpp.

+ Here is the call graph for this function:

◆ addMatrixWidget()

template<typename T >
void Ra::Gui::VariableSetEditor::addMatrixWidget ( const std::string & key,
T & initial,
Core::VariableSet & params,
const nlohmann::json & metadata )
Template Parameters
T
Parameters
key
initial
params
metadata

Definition at line 237 of file ParameterSetEditor.cpp.

◆ addNumberWidget()

template<typename T >
void Ra::Gui::VariableSetEditor::addNumberWidget ( const std::string & name,
T & initial,
Core::VariableSet & params,
const nlohmann::json & metadata )
Template Parameters
T
Parameters
name
initial
params
metadata

Definition at line 162 of file ParameterSetEditor.cpp.

+ Here is the call graph for this function:

◆ addVectorWidget()

template<typename T >
void Ra::Gui::VariableSetEditor::addVectorWidget ( const std::string & key,
std::vector< T > & initial,
Core::VariableSet & params,
const nlohmann::json & metadata )
Template Parameters
T
Parameters
key
initial
params
metadata

Definition at line 219 of file ParameterSetEditor.cpp.

◆ parameterModified

void Ra::Gui::VariableSetEditor::parameterModified ( const std::string & name)
signal

Signal emitted whenever a parameter is modified

◆ setShowUnspecified()

void Ra::Gui::VariableSetEditor::setShowUnspecified ( bool enable)
inline

Wether to show parameters without associated metadata.

Parameters
enable

Definition at line 56 of file ParameterSetEditor.hpp.

◆ setupUi()

void Ra::Gui::VariableSetEditor::setupUi ( Core::VariableSet & params,
const nlohmann::json & constraints )

Update the different UI element with the given renderParameter, using the given constraints.

Parameters
paramsthe VariableSet to edit
constraintsthe parameter constraints descriptor

Definition at line 254 of file ParameterSetEditor.cpp.

+ Here is the call graph for this function:

◆ showUnspecified()

bool Ra::Gui::VariableSetEditor::showUnspecified ( )
inline

Definition at line 57 of file ParameterSetEditor.hpp.


The documentation for this class was generated from the following files: