tools
DatabaseViewer
tools/DatabaseViewer/main.cpp
Go to the documentation of this file.
1
/*
2
Copyright (c) 2010-2016, Mathieu Labbe - IntRoLab - Universite de Sherbrooke
3
All rights reserved.
4
5
Redistribution and use in source and binary forms, with or without
6
modification, are permitted provided that the following conditions are met:
7
* Redistributions of source code must retain the above copyright
8
notice, this list of conditions and the following disclaimer.
9
* Redistributions in binary form must reproduce the above copyright
10
notice, this list of conditions and the following disclaimer in the
11
documentation and/or other materials provided with the distribution.
12
* Neither the name of the Universite de Sherbrooke nor the
13
names of its contributors may be used to endorse or promote products
14
derived from this software without specific prior written permission.
15
16
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
17
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
20
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26
*/
27
28
#include <QApplication>
29
#include "
rtabmap/gui/DatabaseViewer.h
"
30
#include "
rtabmap/utilite/ULogger.h
"
31
#ifdef RTABMAP_PYTHON
32
#include <
rtabmap/core/PythonInterface.h
>
33
#endif
34
35
#include <vtkObject.h>
36
#include <vtkVersionMacros.h>
37
38
#if VTK_MAJOR_VERSION > 9 || (VTK_MAJOR_VERSION==9 && VTK_MINOR_VERSION >= 1)
39
#include <QVTKRenderWidget.h>
40
#endif
41
42
int
main
(
int
argc,
char
*
argv
[])
43
{
44
ULogger::setType
(
ULogger::kTypeConsole
);
45
ULogger::setLevel
(
ULogger::kInfo
);
46
47
#ifdef WIN32
48
CoInitialize(
nullptr
);
49
#endif
50
51
#if VTK_MAJOR_VERSION > 9 || (VTK_MAJOR_VERSION==9 && VTK_MINOR_VERSION >= 1)
52
// needed to ensure appropriate OpenGL context is created for VTK rendering.
53
QSurfaceFormat::setDefaultFormat(QVTKRenderWidget::defaultFormat());
54
#endif
55
56
#ifdef RTABMAP_PYTHON
57
rtabmap::PythonInterface
pythonInterface;
58
#endif
59
60
QApplication *
app
=
new
QApplication(argc,
argv
);
61
rtabmap::DatabaseViewer
* mainWindow =
new
rtabmap::DatabaseViewer
();
62
63
mainWindow->showNormal();
64
65
if
(argc >= 2)
66
{
67
mainWindow->
openDatabase
(
argv
[argc-1],
rtabmap::Parameters::parseArguments
(argc,
argv
,
true
));
68
}
69
70
// Now wait for application to finish
71
app
->connect(
app
, SIGNAL( lastWindowClosed() ),
72
app
, SLOT( quit() ) );
73
app
->exec();
// MUST be called by the Main Thread
74
75
delete
mainWindow;
76
delete
app
;
77
UINFO
(
"All done! closing..."
);
78
79
return
0;
80
}
rtabmap::DatabaseViewer
Definition:
DatabaseViewer.h:68
UINFO
#define UINFO(...)
rtabmap::Parameters::parseArguments
static ParametersMap parseArguments(int argc, char *argv[], bool onlyParameters=false)
Definition:
Parameters.cpp:599
ULogger::kTypeConsole
@ kTypeConsole
Definition:
ULogger.h:244
ULogger::setLevel
static void setLevel(ULogger::Level level)
Definition:
ULogger.h:339
app
QApplication * app
Definition:
tools/DataRecorder/main.cpp:59
rtabmap::PythonInterface
Definition:
PythonInterface.h:26
ULogger::kInfo
@ kInfo
Definition:
ULogger.h:252
rtabmap_netvlad.argv
argv
Definition:
rtabmap_netvlad.py:15
ULogger::setType
static void setType(Type type, const std::string &fileName=kDefaultLogFileName, bool append=true)
Definition:
ULogger.cpp:176
PythonInterface.h
ULogger.h
ULogger class and convenient macros.
rtabmap::DatabaseViewer::openDatabase
bool openDatabase(const QString &path, const ParametersMap &overridenParameters=ParametersMap())
Definition:
DatabaseViewer.cpp:820
DatabaseViewer.h
main
int main(int argc, char *argv[])
Definition:
tools/DatabaseViewer/main.cpp:42
rtabmap
Author(s): Mathieu Labbe
autogenerated on Thu Jul 25 2024 02:50:12