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 and Matei T. Ciocarlie 00021 // 00022 // $Id: mainWindow.h,v 1.13 2009/09/14 18:07:18 hao Exp $ 00023 // 00024 //###################################################################### 00025 00026 // 00027 // $Header: 00028 // 00029 00044 #include "ui_mainWindow.h" 00045 00046 #include <Q3MainWindow> 00047 //#include <QMainWindow> 00048 #include <QString> 00049 #include <QObject> 00050 00051 class World; 00052 class QAction; 00053 class Grasp; 00054 00055 class MainWindow : public QObject 00056 { 00057 Q_OBJECT 00058 private: 00059 World *world; 00060 QString fileName; 00061 int selectedContact; 00062 00063 void init(); 00064 void destroy(); 00065 void destroyChildren(); 00066 public: 00067 Ui::MainWindowUI *mUI; 00068 Q3MainWindow *mWindow; 00069 00070 MainWindow(QWidget *parent = 0); 00071 virtual ~MainWindow(){ 00072 destroy(); 00073 delete mWindow; 00074 delete mUI; 00075 } 00076 void setMainWorld( World *w ); 00077 World* getMainWorld(){return world;} 00078 00079 public slots: 00080 //------------- 00081 void fileNew(); 00082 void fileOpen(); 00083 void fileSave(); 00084 void fileSaveAs(); 00085 void fileImportRobot(); 00086 void fileImportObstacle(); 00087 void fileImportObject(); 00088 void fileEditSettings(); 00089 void fileExit(); 00090 void fileSaveImage(); 00091 int saveAndContinue(const QString & action); 00092 //------------- 00093 void helpManual(); 00094 void helpAbout(); 00095 void helpAboutQT(); 00096 //------------- 00097 void setTool( QAction *a ); 00098 void elementTurnOffCollisions(); 00099 void elementBodyProperties(); 00100 void elementPrimitives(); 00101 void updateElementMenu(); 00102 //------------- 00103 void graspAutoGrasp(); 00104 void graspAutoOpen(); 00105 void graspQualityMeasures(); 00106 void graspCreateProjection(Grasp* g = NULL); 00107 void graspForceOptimization(); 00108 void graspPlanner(); 00109 void updateGraspMenu(); 00110 //------------- 00111 void eigenGraspActivated(); 00112 void graspContactExaminer_activated(); 00113 void eigenGraspPlannerActivated(); 00114 void graspCompliantPlanner(); 00115 //------------- 00116 void dbaseGUIAction_activated(); 00117 void dbasePlannerAction_activated(); 00118 void graspCapture(); 00119 //------------- 00120 void sensorsSensor_InputAction_activated(); 00121 void sensorsBarrettHandAction(); 00122 //------------- 00123 void stereoOn(); 00124 void stereoOff(); 00125 void stereoFlip(); 00126 //------------- 00127 void archBuilder(); 00128 void miscOptimizer(); 00129 void miscEigengridsAction_activated(); 00130 void miscArizonaProjectDlg_activated(); 00131 void misStaubliControlDlg(); 00132 //------------- 00133 void updateContactsList(); 00134 void contactSelected(int newSelection); 00135 void clearContactsList(); 00136 void updateQualityList(); 00137 //-------------- 00138 void updateTimeReadout(); 00139 void toggleDynamics(); 00140 void showDynamicsError( const char *errMsg ); 00141 void dynamicsPushState(); 00142 void dynamicsPopState(); 00143 //-------------- 00144 void updateMaterialBoxList(); 00145 void materialSelected( int whichMat ); 00146 void updateMaterialBox(); 00147 void updateGraspBoxes(); 00148 void handleHandSelectionChange(); 00149 void selectGraspedBody(int sb); 00150 void setCurrentHand( int sh ); 00151 void updateCollisionAction(bool state); 00152 //--------------- 00153 void updateTendonNamesBox(); 00154 void handleTendonSelectionArea(); 00155 void handleTendonDetailsArea(); 00156 void TendonForceInput_valueChanged( int f); 00157 void tendonNamesBoxActivated( int i); 00158 void tendonVisibleCheckBox_toggled( bool vis); 00159 void forcesVisibleCheckBox_toggled( bool vis); 00160 };