00001 //###################################################################### 00002 // 00003 // GraspIt! 00004 // Copyright (C) 2002-2009 Columbia University in the City of New York. 00005 // All rights reserved. 00006 // 00007 // This software is protected under a Research and Educational Use 00008 // Only license, (found in the file LICENSE.txt), that you should have 00009 // received with this distribution. 00010 // 00011 // Author(s): Matei T. Ciocarlie 00012 // 00013 // $Id: optimizerDlg.cpp,v 1.3 2009/07/02 22:06:55 cmatei Exp $ 00014 // 00015 //###################################################################### 00016 00017 #include "optimizerDlg.h" 00018 00019 #include "eigenTorques.h" 00020 #include "world.h" 00021 #include "graspitGUI.h" 00022 #include "ivmgr.h" 00023 00024 #include "debug.h" 00025 00026 OptimizerDlg::OptimizerDlg(World *w, QWidget *parent) : QDialog(parent), mWorld(w) 00027 { 00028 setupUi(this); 00029 QObject::connect(exitButton, SIGNAL(clicked()), this, SLOT(exitButtonClicked())); 00030 QObject::connect(torqueButton, SIGNAL(clicked()), this, SLOT(torqueButtonClicked())); 00031 } 00032 00033 void 00034 OptimizerDlg::torqueButtonClicked() 00035 { 00036 #ifdef CGDB_ENABLED 00037 if (!mWorld->getCurrentHand()) { 00038 DBGA("No hand selected"); 00039 return; 00040 } 00041 if (!graspItGUI->getIVmgr()->getDBMgr()) { 00042 DBGA("Connect to database first"); 00043 return; 00044 } 00045 CGDBGraspProcessor eigenTorques(mWorld->getCurrentHand()); 00046 DBGA("CGDBGraspProcessor constructed"); 00047 eigenTorques.run(); 00048 DBGA("CGDBGraspProcessor done"); 00049 #else 00050 DBGA("Optimizer needs the CGDB"); 00051 #endif 00052 }