#include <parametergui.h>
Public Member Functions | |
| ParameterGUI (nap::Core &core) | |
| void | show (bool newWindow=true) |
| bool | load (std::string preset, utility::ErrorState &errorState) |
| int | getSelectedPresetIndex () const |
| const std::string & | getSelectedPreset () const |
| virtual bool | init (utility::ErrorState &errorState) override |
Public Member Functions inherited from Resource | |
| Resource () | |
Public Member Functions inherited from Object | |
| Object () | |
| virtual | ~Object () |
| virtual void | onDestroy () |
| Object (Object &)=delete | |
| Object & | operator= (const Object &)=delete |
| Object (Object &&)=delete | |
| Object & | operator= (Object &&)=delete |
Public Attributes | |
| bool | mSerializable = true |
| Property: 'Serializable' if the group, including child groups, is a preset that can be saved and loaded using this GUI. More... | |
| ResourcePtr< nap::ParameterGroup > | mParameterGroup = nullptr |
| Property: 'Group' Which parameter group to show, including all child groups. More... | |
Public Attributes inherited from Object | |
| std::string | mID |
| Property: 'mID' unique name of the object. Used as an identifier by the system. More... | |
Additional Inherited Members | |
Static Public Member Functions inherited from Object | |
| static bool | isIDProperty (rtti::Instance &object, const rtti::Property &property) |
Shows an ImGUI window that can be used to edit/load/save parameters of a specific group. The GUI is created by (recursively) traversing the parameters in a group and creating appropriate UI elements for each parameter.
The editor that is used to create the UI element for a given parameter type can be customized, allowing for custom types to be displayed in the UI. Call nap::ParameterGUIService() to register your own editor. Default UI elements are provided for built-in types such as int, float, etc.
| ParameterGUI | ( | nap::Core & | core | ) |
| const std::string& getSelectedPreset | ( | ) | const |
Returns the currently selected preset if one was selected, asserts false otherwise
| int getSelectedPresetIndex | ( | ) | const |
Returns the index of the currently selected preset if one was selected, returns -1 otherwise
|
overridevirtual |
Initializes the parameter GUI
| errorState | contains the error if initialization failed |
Reimplemented from Object.
| bool load | ( | std::string | preset, |
| utility::ErrorState & | errorState | ||
| ) |
Load a preset programmatically
| preset | the filename of the preset to load |
| errorState | contains the error if the preset load failed |
| void show | ( | bool | newWindow = true | ) |
Display all parameters, including parameters in child groups, as UI elements. Should be called each frame on update(). When 'newWindow' is set to true a new window will be created. When 'newWindow' is disabled the parameters will be added to the currently active GUI window.
| newWindow | if the parameters should be added to a new window. |
| ResourcePtr<nap::ParameterGroup> mParameterGroup = nullptr |
Property: 'Group' Which parameter group to show, including all child groups.
| bool mSerializable = true |
Property: 'Serializable' if the group, including child groups, is a preset that can be saved and loaded using this GUI.