00001 //###################################################################### 00002 // 00003 // GraspIt! 00004 // Copyright (C) 2002-2009 Columbia University in the City of New York. 00005 // All rights reserved. 00006 // 00007 // GraspIt! is free software: you can redistribute it and/or modify 00008 // it under the terms of the GNU General Public License as published by 00009 // the Free Software Foundation, either version 3 of the License, or 00010 // (at your option) any later version. 00011 // 00012 // GraspIt! is distributed in the hope that it will be useful, 00013 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 // GNU General Public License for more details. 00016 // 00017 // You should have received a copy of the GNU General Public License 00018 // along with GraspIt!. If not, see <http://www.gnu.org/licenses/>. 00019 // 00020 // Author(s): Andrew T. Miller 00021 // 00022 // $Id: graspitGUI.h,v 1.5 2010/08/11 02:45:37 cmatei Exp $ 00023 // 00024 //###################################################################### 00025 00030 #ifndef GRASPITGUI_HXX 00031 00032 #include <string> 00033 #include <vector> 00034 #include <list> 00035 00036 class MainWindow; 00037 class IVmgr; 00038 class TaskDispatcher; 00039 class Application; 00040 class Plugin; 00041 class PluginCreator; 00042 class SoIdleSensor; 00043 class SoSensor; 00044 00046 00055 class GraspItGUI 00056 { 00058 MainWindow *mainWindow; 00059 00061 IVmgr *ivmgr; 00062 00064 TaskDispatcher *mDispatch; 00065 00067 static bool initialized; 00068 00070 static int initResult; 00071 00073 int mExitCode; 00074 00076 std::list< std::pair<Plugin*,std::string> > mActivePlugins; 00077 00079 std::vector<PluginCreator*> mPluginCreators; 00080 00082 SoIdleSensor *mPluginSensor; 00083 00084 protected: 00085 int processArgs(int argc, char **argv); 00086 00087 public: 00088 GraspItGUI(int argc,char **argv); 00089 ~GraspItGUI(); 00090 00092 bool terminalFailure() const; 00093 00095 int getExitCode() const {return mExitCode;} 00096 00098 MainWindow *getMainWindow() const {return mainWindow;} 00099 00101 IVmgr *getIVmgr() const {return ivmgr;} 00102 00104 static void sensorCB(void *data, SoSensor*); 00105 00107 void processPlugins(); 00108 00110 void startPlugin(PluginCreator* creator, std::string args); 00111 00113 void stopPlugin(Plugin *plugin); 00114 00116 void stopAllPlugins(); 00117 00118 void startMainLoop(); 00119 void exitMainLoop(); 00120 }; 00121 00122 extern GraspItGUI *graspItGUI; 00123 00124 #define GRASPITGUI_HXX 00125 #endif