This is the main user interface class that is responsible for creating and destroying the MainWindow and IVmgr. More...
#include <graspitGUI.h>
Public Member Functions | |
void | exitMainLoop () |
int | getExitCode () const |
Returns the exit code (set internally based on the application). | |
IVmgr * | getIVmgr () const |
MainWindow * | getMainWindow () const |
GraspItGUI (int argc, char **argv) | |
void | processPlugins () |
Calls the main processing routine of all active plugins. | |
void | startMainLoop () |
void | startPlugin (PluginCreator *creator, std::string args) |
Starts a plugin from the given creator. | |
void | stopAllPlugins () |
Stops and deletes all currently active plugins. | |
void | stopPlugin (Plugin *plugin) |
Stops and deletes the specified plugin. | |
bool | terminalFailure () const |
~GraspItGUI () | |
Static Public Member Functions | |
static void | sensorCB (void *data, SoSensor *) |
Static sensor callback, just calls processPlugins(). | |
Protected Member Functions | |
int | processArgs (int argc, char **argv) |
Private Attributes | |
IVmgr * | ivmgr |
A pointer to the IVmgr. | |
std::list< std::pair< Plugin *, std::string > > | mActivePlugins |
Plugins currently running. | |
MainWindow * | mainWindow |
A pointer to the MainWindow. | |
TaskDispatcher * | mDispatch |
A pointer to the Task Dispatcher, if any. | |
int | mExitCode |
Holds the exit code of the UI execution. | |
std::vector< PluginCreator * > | mPluginCreators |
Available plugin creators. | |
SoIdleSensor * | mPluginSensor |
Idle sensor for calling the plugins from GraspIt's event loop. | |
Static Private Attributes | |
static bool | initialized = false |
TRUE if this class has been initialized. | |
static int | initResult = SUCCESS |
Holds result of UI initialization. |
This is the main user interface class that is responsible for creating and destroying the MainWindow and IVmgr.
This class also processes command line arguments and holds pointers to both the MainWindow and IVmgr. There is one global instance of this class, which allows access to these two main pieces of the UI. This class also has methods for both the entry and exit to the interactive program loop.
This class can also initialize a task dispatcher which is then in charge of batch execution of tasks based on information form a grasp database.
Definition at line 55 of file graspitGUI.h.
GraspItGUI::GraspItGUI | ( | int | argc, | |
char ** | argv | |||
) |
If this class hasn't been initialized in another instance, it performs the following operations:
Definition at line 84 of file graspitGUI.cpp.
GraspItGUI::~GraspItGUI | ( | ) |
Deletes both the IVmgr and the MainWindow.
Definition at line 112 of file graspitGUI.cpp.
void GraspItGUI::exitMainLoop | ( | ) |
Exits the Qt event loop.
Definition at line 257 of file graspitGUI.cpp.
int GraspItGUI::getExitCode | ( | ) | const [inline] |
Returns the exit code (set internally based on the application).
Definition at line 95 of file graspitGUI.h.
IVmgr* GraspItGUI::getIVmgr | ( | ) | const [inline] |
Returns a pointer to the IVmgr.
Definition at line 101 of file graspitGUI.h.
MainWindow* GraspItGUI::getMainWindow | ( | ) | const [inline] |
Returns a pointer to the MainWindow.
Definition at line 98 of file graspitGUI.h.
int GraspItGUI::processArgs | ( | int | argc, | |
char ** | argv | |||
) | [protected] |
Processes the command line arguments. It first checks to make sure the GRASPIT environment variable is set, then if this is run under X11 it examines the command line. The usage is the following: graspit
[-w worldname]
[-r robotname]
[-o objectname]
[-b obstaclename]
Definition at line 143 of file graspitGUI.cpp.
void GraspItGUI::processPlugins | ( | ) |
Calls the main processing routine of all active plugins.
Definition at line 284 of file graspitGUI.cpp.
void GraspItGUI::sensorCB | ( | void * | data, | |
SoSensor * | ||||
) | [static] |
Static sensor callback, just calls processPlugins().
Definition at line 269 of file graspitGUI.cpp.
void GraspItGUI::startMainLoop | ( | ) |
Shows the mainWindow, sets its size, and starts the Qt event loop.
Definition at line 245 of file graspitGUI.cpp.
void GraspItGUI::startPlugin | ( | PluginCreator * | creator, | |
std::string | args | |||
) |
Starts a plugin from the given creator.
Definition at line 275 of file graspitGUI.cpp.
void GraspItGUI::stopAllPlugins | ( | ) |
Stops and deletes all currently active plugins.
Definition at line 313 of file graspitGUI.cpp.
void GraspItGUI::stopPlugin | ( | Plugin * | plugin | ) |
Stops and deletes the specified plugin.
Definition at line 300 of file graspitGUI.cpp.
bool GraspItGUI::terminalFailure | ( | ) | const |
Returns whether the UI pieces were successfully initialized.
Definition at line 263 of file graspitGUI.cpp.
bool GraspItGUI::initialized = false [static, private] |
TRUE if this class has been initialized.
Definition at line 67 of file graspitGUI.h.
int GraspItGUI::initResult = SUCCESS [static, private] |
Holds result of UI initialization.
Definition at line 70 of file graspitGUI.h.
IVmgr* GraspItGUI::ivmgr [private] |
A pointer to the IVmgr.
Definition at line 61 of file graspitGUI.h.
std::list< std::pair<Plugin*,std::string> > GraspItGUI::mActivePlugins [private] |
Plugins currently running.
Definition at line 76 of file graspitGUI.h.
MainWindow* GraspItGUI::mainWindow [private] |
A pointer to the MainWindow.
Definition at line 58 of file graspitGUI.h.
TaskDispatcher* GraspItGUI::mDispatch [private] |
A pointer to the Task Dispatcher, if any.
Definition at line 64 of file graspitGUI.h.
int GraspItGUI::mExitCode [private] |
Holds the exit code of the UI execution.
Definition at line 73 of file graspitGUI.h.
std::vector<PluginCreator*> GraspItGUI::mPluginCreators [private] |
Available plugin creators.
Definition at line 79 of file graspitGUI.h.
SoIdleSensor* GraspItGUI::mPluginSensor [private] |
Idle sensor for calling the plugins from GraspIt's event loop.
Definition at line 82 of file graspitGUI.h.