00001 // g2o - General Graph Optimization 00002 // Copyright (C) 2011 R. Kuemmerle, G. Grisetti, W. Burgard 00003 // 00004 // This file is part of g2o. 00005 // 00006 // g2o is free software: you can redistribute it and/or modify 00007 // it under the terms of the GNU General Public License as published by 00008 // the Free Software Foundation, either version 3 of the License, or 00009 // (at your option) any later version. 00010 // 00011 // g2o is distributed in the hope that it will be useful, 00012 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 // GNU General Public License for more details. 00015 // 00016 // You should have received a copy of the GNU General Public License 00017 // along with g2o. If not, see <http://www.gnu.org/licenses/>. 00018 00019 #ifndef MAIN_WINDOW_H 00020 #define MAIN_WINDOW_H 00021 00022 #include "ui_base_main_window.h" 00023 00024 #include "g2o/core/solver_property.h" 00025 00026 #include <vector> 00027 00028 namespace g2o { 00029 class DlWrapper; 00030 } // end namespace 00031 00035 class MainWindow : public QMainWindow, public Ui::BaseMainWindow 00036 { 00037 Q_OBJECT 00038 public: 00039 MainWindow(QWidget * parent = 0, Qt::WindowFlags flags = 0); 00040 ~MainWindow(); 00041 00042 public: 00046 void updateDisplayedSolvers(); 00047 00051 bool loadFromFile(const QString& filename); 00052 00053 public slots: 00054 void on_actionLoad_triggered(bool); 00055 void on_actionSave_triggered(bool); 00056 void on_actionQuit_triggered(bool); 00057 void on_actionWhite_Background_triggered(bool); 00058 void on_actionDefault_Background_triggered(bool); 00059 00060 void on_btnOptimize_clicked(); 00061 void on_btnInitialGuess_clicked(); 00062 void on_btnForceStop_clicked(); 00063 00064 protected: 00065 void fixGraph(); 00066 bool allocateSolver(bool& allocatedNewSolver); 00067 bool prepare(); 00068 void setRobustKernel(); 00069 bool load(const QString& filename); 00070 00071 std::vector<g2o::SolverProperty> _knownSolvers; 00072 int _lastSolver; 00073 bool _forceStopFlag; 00074 g2o::SolverProperty _currentSolverProperty; 00075 }; 00076 00077 00078 #endif