Implementation of GUII.
More...
#include <gui.h>
|
| | GUI (const std::string &window_name, std::shared_ptr< SDFormatParserI > sdformat_parser, bool &success) |
| | Constructor that wraps the Initialize method.
|
| |
|
| ~GUI () |
| | Destructor.
|
| |
|
| void | Initialize (const std::string &window_name, std::shared_ptr< SDFormatParserI > sdformat_parser, bool &success) override |
| | Implementation of interface method, wrapped by constructor.
|
| |
| bool | ShouldClose () override |
| | Implementation of interface method.
|
| |
| std::unique_ptr< CommandI > | Update (std::shared_ptr< CommandFactoryI > command_factory) override |
| | Implementation of interface method.
|
| |
| void | SetPreventInputFlag (bool set) override |
| | Implementation of flag setting method.
|
| |
| void | OpenChoiceDialog (DialogMessage dialogMessage, std::vector< std::pair< std::string, bool > > &choices) override |
| | Implementation of interface method.
|
| |
| void | DisplaySDFRootElement (std::unique_ptr< CommandI > &command, std::shared_ptr< SDFormatParserI > sdformat_parser, std::shared_ptr< CommandFactoryI > command_factory) |
| | Function to display the SDF root element in the GUI in a tree format.
|
| |
| bool | SetupNewFrame () |
| | Sets up a new ImGUI frame.
|
| |
| void | DrawCoreFrame (std::unique_ptr< CommandI > &command, std::shared_ptr< CommandFactoryI > command_factory) |
| | Draw the core part of the ImGUI frame.
|
| |
| void | CreateModifyAttributeDropdown (sdf::ParamPtr attribute, std::unique_ptr< CommandI > &command, std::shared_ptr< CommandFactoryI > command_factory, int &unique_id) |
| | Create a dropdown list.
|
| |
| void | CreateModifyElementDropdown (sdf::ElementPtr element, std::unique_ptr< CommandI > &command, std::shared_ptr< CommandFactoryI > command_factory, int &unique_id) |
| | Create a dropdown list.
|
| |
| void | CreateAppendElementDropdown (sdf::ElementPtr element, std::unique_ptr< CommandI > &command, std::shared_ptr< CommandFactoryI > command_factory, int &unique_id) |
| | Create a dropdown list for an element.
|
| |
| void | CreateDropdown (const std::vector< std::string > &items, const std::vector< std::string > &item_descriptions, int &selected_item, int &unique_id) |
| | Create a dropdown list.
|
| |
| std::unique_lock< std::mutex > | LockMutex () override |
| | Implementation of lock method.
|
| |
|
| static void | GLFWErrorCallback (int error, const char *description) |
| | Function for handling GLFW Error (required to be static by GLFW)
|
| |
|
|
std::shared_ptr< CommandFactory > | command_factory |
| |
|
std::atomic< bool > | prevent_input_flag = false |
| | Flag which can be set to prevent the GUI from taking user input.
|
| |
|
bool | model_viewer_running = false |
| | Flag to indicate if the model viewer is currently running.
|
| |
|
bool | render_collisions_in_model_viewer = false |
| | Flag to indicate if collisions should be loaded in the model viewer.
|
| |
|
GLFWwindow * | window = nullptr |
| | Pointer to the GLFW window object, used to manage for rendering and handling window events.
|
| |
|
ImGuiIO * | io = nullptr |
| | Reference to the ImGuiIO structure, which handles input/output operations for ImGui.
|
| |
|
std::shared_ptr< SDFormatParserI > | sdformat_parser |
| | Pointer to the sdformat_parser object.
|
| |
|
sdf::ElementPtr | element_to_append_to |
| | An element for which we want to show the "append_to" dropdown.
|
| |
|
ImVec4 | background_colour |
| | The background color used in the GUI.
|
| |
|
std::mutex | gui_mutex |
| | Mutex to protect shared resources.
|
| |
|
bool | use_dropdown_for_editing_attribute = false |
| | Indicates if a dropdown is used for editing attributes.
|
| |
|
sdf::ParamPtr | attribute_to_edit |
| | Holds a reference to the attribute the user is currently editing.
|
| |
|
sdf::ElementPtr | element_to_edit |
| | Holds a reference to the element the user is currently editing.
|
| |
|
bool | use_dropdown_for_editing_element = false |
| | Indicates if a dropdown is used for editing attributes.
|
| |
◆ GUI()
| GUI::GUI |
( |
const std::string & |
window_name, |
|
|
std::shared_ptr< SDFormatParserI > |
sdformat_parser, |
|
|
bool & |
success |
|
) |
| |
Constructor that wraps the Initialize method.
- Parameters
-
| [in] | window_name | The name to be given to the SDFormatEditor Window |
| [in] | sdformat_parser | A pointer to the sdformat parser object |
| [out] | success | true if window initalization is successful |
◆ CreateAppendElementDropdown()
| void GUI::CreateAppendElementDropdown |
( |
sdf::ElementPtr |
element, |
|
|
std::unique_ptr< CommandI > & |
command, |
|
|
std::shared_ptr< CommandFactoryI > |
command_factory, |
|
|
int & |
unique_id |
|
) |
| |
|
private |
Create a dropdown list for an element.
- Parameters
-
| [in] | element | A pointer to the element for which to create a dropdown |
| [out] | command | a pointer to the command resulting from the user's action during this frame |
| [in] | command_factory | used for creating command objects |
| [out] | unique_id | a unique id for the ImGUI dropdowm
|
◆ CreateDropdown()
| void GUI::CreateDropdown |
( |
const std::vector< std::string > & |
items, |
|
|
const std::vector< std::string > & |
item_descriptions, |
|
|
int & |
selected_item, |
|
|
int & |
unique_id |
|
) |
| |
|
private |
Create a dropdown list.
- Parameters
-
| [in] | items | A vector of strings to include in the dropdown |
| [in] | item_descriptions | A vector of strings for the descriptions of each item |
| [out] | selected_item | an integer representing the selected item |
| [out] | unique_id | a unique id for the ImGUI dropdowm
|
◆ CreateModifyAttributeDropdown()
| void GUI::CreateModifyAttributeDropdown |
( |
sdf::ParamPtr |
attribute, |
|
|
std::unique_ptr< CommandI > & |
command, |
|
|
std::shared_ptr< CommandFactoryI > |
command_factory, |
|
|
int & |
unique_id |
|
) |
| |
|
private |
Create a dropdown list.
- Parameters
-
| [in] | attribute | A pointer to the attribute for which to create a dropdown |
| [out] | command | a pointer to the command resulting from the user's action during this frame |
| [in] | command_factory | used for creating command objects |
| [out] | unique_id | a unique id for the ImGUI dropdowm
|
◆ CreateModifyElementDropdown()
| void GUI::CreateModifyElementDropdown |
( |
sdf::ElementPtr |
element, |
|
|
std::unique_ptr< CommandI > & |
command, |
|
|
std::shared_ptr< CommandFactoryI > |
command_factory, |
|
|
int & |
unique_id |
|
) |
| |
|
private |
Create a dropdown list.
- Parameters
-
| [in] | element | A pointer to the element for which to create a dropdown |
| [out] | command | a pointer to the command resulting from the user's action during this frame |
| [in] | command_factory | used for creating command objects |
| [out] | unique_id | a unique id for the ImGUI dropdowm
|
◆ DisplaySDFRootElement()
Function to display the SDF root element in the GUI in a tree format.
- Parameters
-
| [out] | command | a pointer to the command resulting from the user's action during this frame |
| [in] | sdformat_parser | an SDFormatParserI instance containing an sdf element |
| [in] | command_factory | used for creating command objects |
◆ DrawCoreFrame()
| void GUI::DrawCoreFrame |
( |
std::unique_ptr< CommandI > & |
command, |
|
|
std::shared_ptr< CommandFactoryI > |
command_factory |
|
) |
| |
|
private |
Draw the core part of the ImGUI frame.
- Parameters
-
| [out] | command | a pointer to the command resulting from the user's action during this frame |
| [in] | command_factory | used for creating command objects |
◆ GLFWErrorCallback()
| void GUI::GLFWErrorCallback |
( |
int |
error, |
|
|
const char * |
description |
|
) |
| |
|
staticprivate |
Function for handling GLFW Error (required to be static by GLFW)
- Parameters
-
| [in] | error | Error code from GLFW |
| [in] | description | Description of the error from GLFW
|
◆ Initialize()
| void GUI::Initialize |
( |
const std::string & |
window_name, |
|
|
std::shared_ptr< SDFormatParserI > |
sdformat_parser, |
|
|
bool & |
success |
|
) |
| |
|
overrideprivatevirtual |
Implementation of interface method, wrapped by constructor.
- Parameters
-
| [in] | window_name | The name to be given to the SDFormatEditor Window |
| [in] | sdformat_parser | A pointer to the sdformat parser object |
| [out] | success | true if window initalization is successful |
Implements GUII.
◆ LockMutex()
| std::unique_lock< std::mutex > GUI::LockMutex |
( |
| ) |
|
|
overrideprivatevirtual |
Implementation of lock method.
Implements GUII.
◆ OpenChoiceDialog()
| void GUI::OpenChoiceDialog |
( |
DialogMessage |
dialogMessage, |
|
|
std::vector< std::pair< std::string, bool > > & |
choices |
|
) |
| |
|
overrideprivatevirtual |
Implementation of interface method.
- Parameters
-
| [in] | dialogMessage | struct containing the strings to display |
| [out] | choices | a vector of string,bools pairs where one bool will be set true, corresponding to the user's choice |
Implements GUII.
◆ SetPreventInputFlag()
| void GUI::SetPreventInputFlag |
( |
bool |
set | ) |
|
|
overrideprivatevirtual |
Implementation of flag setting method.
- Parameters
-
| [in] | set | value to set the flag |
Implements GUII.
◆ SetupNewFrame()
| bool GUI::SetupNewFrame |
( |
| ) |
|
|
private |
Sets up a new ImGUI frame.
- Returns
- false if the window is minimized
◆ ShouldClose()
| bool GUI::ShouldClose |
( |
| ) |
|
|
overrideprivatevirtual |
Implementation of interface method.
Implements GUII.
◆ Update()
Implementation of interface method.
- Parameters
-
| [in] | command_factory | used for creating command objects |
- Returns
- The a pointer to the command resulting from the user's action during this frame
Implements GUII.
The documentation for this class was generated from the following files:
- include/gui.h
- src/gui.cpp