Shader Tool
Small shader visualiser.
|
Builds the nanogui interface from a xml. More...
#include <UIBuilder.hpp>
Public Member Functions | |
UIBuilder ()=default | |
nanogui::Screen * | parseUI (const string &path) |
Reads the layout xml and starts the parsing. More... | |
void | add_callback (const string &name, function< void() > fun) |
Adds a function callback to the callbacks map. More... | |
Public Attributes | |
Canvas * | canvas |
nanogui::TextBox * | save_shader_name |
nanogui::TextBox * | open_shader_name |
nanogui::TextBox * | texture_path |
Private Member Functions | |
nanogui::Screen * | parse_screen (const rapidxml::xml_node<> *screen_node) |
Parses the Screen node. More... | |
nanogui::Layout * | parse_layout (const rapidxml::xml_node<> *layout_node) |
Parses a layout. More... | |
void | parseWidget (nanogui::Widget *parent, rapidxml::xml_node<> *widget_node) |
Parses and creates a pointer to a Widget. More... | |
void | parseButton (nanogui::Widget *parent, rapidxml::xml_node<> *button_node) |
Parses and creates a pointer to a Button. More... | |
void | parseCanvas (nanogui::Widget *parent, rapidxml::xml_node<> *button_node) |
Parses and creates a pointer to a Canvas. More... | |
void | parseLabel (nanogui::Widget *parent, rapidxml::xml_node<> *button_node) |
Parses and creates a pointer to a Label. More... | |
void | parseTextBox (nanogui::Widget *parent, rapidxml::xml_node<> *button_node) |
Parses and creates a pointer to a Textboc. More... | |
Private Attributes | |
nanogui::Screen * | screen |
std::map< string, function< void() > > | callbacks |
Builds the nanogui interface from a xml.
|
default |
|
inline |
Adds a function callback to the callbacks map.
This needs to be called before calling parseUI, as many times as methods you want to use. The name should be the same as appears in the xml.
|
private |
Parses a layout.
Only Screen and Widget can have a Layout.
|
private |
Parses the Screen node.
Creates a new screen and starts parsing its child nodes. We assume an Screen can only have Layouts and Widgets as children.
|
private |
Parses and creates a pointer to a Button.
Accepted parameters: name, width, height, callback.
|
private |
Parses and creates a pointer to a Canvas.
Accepted parameters: width, height.
|
private |
Parses and creates a pointer to a Label.
Accepted parameters: name.
|
private |
Parses and creates a pointer to a Textboc.
Accepted parameters: name, caption, width, height, editable.
nanogui::Screen * st::UIBuilder::parseUI | ( | const string & | path | ) |
Reads the layout xml and starts the parsing.
|
private |
Parses and creates a pointer to a Widget.
|
private |
Canvas* st::UIBuilder::canvas |
nanogui::TextBox* st::UIBuilder::open_shader_name |
nanogui::TextBox* st::UIBuilder::save_shader_name |
|
private |
nanogui::TextBox* st::UIBuilder::texture_path |