g2o
Loading...
Searching...
No Matches
g2o
apps
g2o_viewer
gui_hyper_graph_action.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 "
gui_hyper_graph_action.h
"
20
21
#include <QApplication>
22
#include <QtGlobal>
23
24
#include "
g2o_qglviewer.h
"
25
26
namespace
g2o
{
27
28
GuiHyperGraphAction::GuiHyperGraphAction
()
29
:
HyperGraphAction
(), viewer(0), dumpScreenshots(false) {}
30
31
GuiHyperGraphAction::~GuiHyperGraphAction
() {}
32
33
HyperGraphAction
*
GuiHyperGraphAction::operator()
(
const
HyperGraph
* graph,
34
Parameters
* parameters) {
35
(void)graph;
36
if
(
viewer
) {
37
viewer
->
setUpdateDisplay
(
true
);
38
viewer
->update();
39
40
if
(
dumpScreenshots
) {
41
ParametersIteration
* p =
dynamic_cast<
ParametersIteration
*
>
(parameters);
42
if
(p) {
43
viewer
->setSnapshotFormat(QString(
"PNG"
));
44
viewer
->setSnapshotQuality(-1);
45
#if QT_VERSION < QT_VERSION_CHECK(5, 5, 0)
46
viewer
->saveSnapshot(QString().sprintf(
"g2o%.6d.png"
, p->
iteration
),
47
true
);
48
#else
49
viewer
->saveSnapshot(QString().asprintf(
"g2o%.6d.png"
, p->
iteration
),
50
true
);
51
#endif
52
}
53
}
54
55
qApp->processEvents();
56
return
this
;
57
}
58
return
0;
59
}
60
61
}
// namespace g2o
g2o::G2oQGLViewer::setUpdateDisplay
void setUpdateDisplay(bool updateDisplay)
Definition
g2o_qglviewer.cpp:172
g2o::GuiHyperGraphAction::operator()
HyperGraphAction * operator()(const HyperGraph *graph, Parameters *parameters=0)
Definition
gui_hyper_graph_action.cpp:33
g2o::GuiHyperGraphAction::viewer
G2oQGLViewer * viewer
the viewer which visualizes the graph
Definition
gui_hyper_graph_action.h:44
g2o::GuiHyperGraphAction::~GuiHyperGraphAction
~GuiHyperGraphAction()
Definition
gui_hyper_graph_action.cpp:31
g2o::GuiHyperGraphAction::dumpScreenshots
bool dumpScreenshots
Definition
gui_hyper_graph_action.h:45
g2o::GuiHyperGraphAction::GuiHyperGraphAction
GuiHyperGraphAction()
Definition
gui_hyper_graph_action.cpp:28
g2o::HyperGraphAction::ParametersIteration
Definition
hyper_graph_action.h:56
g2o::HyperGraphAction::ParametersIteration::iteration
int iteration
Definition
hyper_graph_action.h:59
g2o::HyperGraphAction::Parameters
Definition
hyper_graph_action.h:51
g2o::HyperGraphAction
Abstract action that operates on an entire graph.
Definition
hyper_graph_action.h:49
g2o::HyperGraph
Definition
hyper_graph.h:53
g2o_qglviewer.h
gui_hyper_graph_action.h
g2o
Definition
dl_wrapper.cpp:55
Generated on Tue Nov 11 2025 05:18:45 for g2o by
1.9.8