SDFormat Editor
Loading...
Searching...
No Matches
Classes | Public Member Functions | Protected Member Functions | List of all members
GUII Class Referenceabstract

Interface for the SDFormat Editor's Graphical User Interface Note that this class also inherits from std::enable_shared_from_this<GUII>, as it may be required to pass a shared pointer of itself into the CommandI object in the Update method. More...

#include <gui_interface.h>

Inheritance diagram for GUII:
Inheritance graph
Collaboration diagram for GUII:
Collaboration graph

Classes

struct  DialogMessage
 Struct representing a dialog message. This struct encapsulates the components of a dialog message. More...
 

Public Member Functions

virtual std::unique_ptr< CommandIUpdate (std::shared_ptr< CommandFactoryI > command_factory)=0
 Updating the GUI.
 
virtual bool ShouldClose ()=0
 Indicate if the GUI should close

 
virtual void OpenChoiceDialog (DialogMessage dialogMessage, std::vector< std::pair< std::string, bool > > &choices)=0
 Enables a choice dialog message in the GUI that will be override everything else.
 
virtual void SetPreventInputFlag (bool set)=0
 Method to change the flag which can be set to prevent the GUI from taking user input. This can be used in instances where OpenFileDialog or another threadded method is running.
 
virtual std::unique_lock< std::mutex > LockMutex ()=0
 Method to lock mutex.
 

Protected Member Functions

virtual void Initialize (const std::string &windowName, std::shared_ptr< SDFormatParserI > sdformat_parser, bool &success)=0
 Initialization of the GUI. Should be wrapped in the constructor of the implementation. NOTE: (zaid) As more features are added, more things will be added to this initalize method.
 

Detailed Description

Interface for the SDFormat Editor's Graphical User Interface Note that this class also inherits from std::enable_shared_from_this<GUII>, as it may be required to pass a shared pointer of itself into the CommandI object in the Update method.

Member Function Documentation

◆ Initialize()

virtual void GUII::Initialize ( const std::string &  windowName,
std::shared_ptr< SDFormatParserI sdformat_parser,
bool &  success 
)
protectedpure virtual

Initialization of the GUI. Should be wrapped in the constructor of the implementation. NOTE: (zaid) As more features are added, more things will be added to this initalize method.

Parameters
[in]window_nameThe name to be given to the SDFormatEditor Window
[in]sdformat_parserPointer to the sdformat parser object
[out]successtrue if window initalization is successful

Implemented in GUI.

◆ LockMutex()

virtual std::unique_lock< std::mutex > GUII::LockMutex ( )
pure virtual

Method to lock mutex.

Implemented in GUI.

◆ OpenChoiceDialog()

virtual void GUII::OpenChoiceDialog ( DialogMessage  dialogMessage,
std::vector< std::pair< std::string, bool > > &  choices 
)
pure virtual

Enables a choice dialog message in the GUI that will be override everything else.

Parameters
[in]dialogMessagestruct containing the strings to display
[out]choicesa vector of string,bools pairs where one bool will be set true, corresponding to the user's choice

Implemented in GUI.

◆ SetPreventInputFlag()

virtual void GUII::SetPreventInputFlag ( bool  set)
pure virtual

Method to change the flag which can be set to prevent the GUI from taking user input. This can be used in instances where OpenFileDialog or another threadded method is running.

Parameters
[in]setvalue to set the flag

Implemented in GUI.

◆ ShouldClose()

virtual bool GUII::ShouldClose ( )
pure virtual

Indicate if the GUI should close

Implemented in GUI.

◆ Update()

virtual std::unique_ptr< CommandI > GUII::Update ( std::shared_ptr< CommandFactoryI command_factory)
pure virtual

Updating the GUI.

Parameters
[in]command_factoryused for creating command objects
Returns
The a pointer to the command resulting from the user's action during this frame

Implemented in GUI.


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