GraspItGUI Class Reference

This is the main user interface class that is responsible for creating and destroying the MainWindow and IVmgr. More...

#include <graspitGUI.h>

List of all members.

Public Member Functions

void exitMainLoop ()
int getExitCode () const
 Returns the exit code (set internally based on the application).
IVmgrgetIVmgr () const
MainWindowgetMainWindow () 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

IVmgrivmgr
 A pointer to the IVmgr.
std::list< std::pair< Plugin
*, std::string > > 
mActivePlugins
 Plugins currently running.
MainWindowmainWindow
 A pointer to the MainWindow.
TaskDispatchermDispatch
 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.

Detailed Description

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.


Constructor & Destructor Documentation

GraspItGUI::GraspItGUI ( int  argc,
char **  argv 
)

If this class hasn't been initialized in another instance, it performs the following operations:

  • creates a new MainWindow,
  • starts Coin by initializing SoQt,
  • initializes our Coin add on classes,
  • creates a new IVmgr,
  • sets the focus policy of the SoQt viewer so keyboard events are accepted
  • calls a method to process the command line arguments.

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.


Member Function Documentation

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.


Member Data Documentation

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.

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.

A pointer to the MainWindow.

Definition at line 58 of file graspitGUI.h.

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.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines


graspit
Author(s):
autogenerated on Wed Jan 25 11:00:21 2012