g2o
g2o_viewer.cpp
Go to the documentation of this file.
1 // g2o - General Graph Optimization
2 // Copyright (C) 2011 R. Kuemmerle, G. Grisetti, W. Burgard
3 //
4 // This file is part of g2o.
5 //
6 // g2o is free software: you can redistribute it and/or modify
7 // it under the terms of the GNU General Public License as published by
8 // the Free Software Foundation, either version 3 of the License, or
9 // (at your option) any later version.
10 //
11 // g2o is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
15 //
16 // You should have received a copy of the GNU General Public License
17 // along with g2o. If not, see <http://www.gnu.org/licenses/>.
18 
19 #include <iostream>
20 
21 #include "run_g2o_viewer.h"
22 
26 #include "g2o/stuff/command_args.h"
27 
28 #include <QApplication>
29 using namespace std;
30 using namespace g2o;
31 
32 int main(int argc, char** argv)
33 {
34  OptimizableGraph::initMultiThreading();
35  QApplication qapp(argc, argv);
36 
37  CommandArgs arg;
38 #ifndef G2O_DISABLE_DYNAMIC_LOADING_OF_LIBRARIES
39  string dummy;
40  arg.param("solverlib", dummy, "", "specify a solver library which will be loaded");
41  arg.param("typeslib", dummy, "", "specify a types library which will be loaded");
42  // loading the standard solver / types
43  DlWrapper dlTypesWrapper;
44  loadStandardTypes(dlTypesWrapper, argc, argv);
45  // register all the solvers
46  DlWrapper dlSolverWrapper;
47  loadStandardSolver(dlSolverWrapper, argc, argv);
48 #endif
49 
50  // run the viewer
51  return RunG2OViewer::run(argc, argv, arg);
52 }
Command line parsing of argc and argv.
Definition: command_args.h:46
void loadStandardTypes(DlWrapper &dlTypesWrapper, int argc, char **argv)
Definition: g2o_common.cpp:96
int main(int argc, char **argv)
Definition: g2o_viewer.cpp:32
void param(const std::string &name, bool &p, bool defValue, const std::string &desc)
void loadStandardSolver(DlWrapper &dlSolverWrapper, int argc, char **argv)
Definition: g2o_common.cpp:133
Loading libraries during run-time.
Definition: dl_wrapper.h:44