g2o
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
g2o::GuiHyperGraphAction Class Reference

action which calls an GUI update after each iteration More...

#include <gui_hyper_graph_action.h>

Inheritance diagram for g2o::GuiHyperGraphAction:
Inheritance graph
[legend]
Collaboration diagram for g2o::GuiHyperGraphAction:
Collaboration graph
[legend]

Public Member Functions

 GuiHyperGraphAction ()
 
 ~GuiHyperGraphAction ()
 
HyperGraphActionoperator() (const HyperGraph *graph, Parameters *parameters=0)
 
- Public Member Functions inherited from g2o::HyperGraphAction
virtual ~HyperGraphAction ()
 

Public Attributes

G2oQGLViewerviewer
 the viewer which visualizes the graph
 
bool dumpScreenshots
 

Detailed Description

action which calls an GUI update after each iteration

Definition at line 32 of file gui_hyper_graph_action.h.

Constructor & Destructor Documentation

◆ GuiHyperGraphAction()

g2o::GuiHyperGraphAction::GuiHyperGraphAction ( )

Definition at line 28 of file gui_hyper_graph_action.cpp.

29 : HyperGraphAction(), viewer(0), dumpScreenshots(false) {}
G2oQGLViewer * viewer
the viewer which visualizes the graph

◆ ~GuiHyperGraphAction()

g2o::GuiHyperGraphAction::~GuiHyperGraphAction ( )

Definition at line 31 of file gui_hyper_graph_action.cpp.

31{}

Member Function Documentation

◆ operator()()

HyperGraphAction * g2o::GuiHyperGraphAction::operator() ( const HyperGraph graph,
Parameters parameters = 0 
)
virtual

calling updateGL, processEvents to visualize the current state after each iteration

Reimplemented from g2o::HyperGraphAction.

Definition at line 33 of file gui_hyper_graph_action.cpp.

34 {
35 (void)graph;
36 if (viewer) {
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}
void setUpdateDisplay(bool updateDisplay)

References dumpScreenshots, g2o::HyperGraphAction::ParametersIteration::iteration, g2o::G2oQGLViewer::setUpdateDisplay(), and viewer.

Member Data Documentation

◆ dumpScreenshots

bool g2o::GuiHyperGraphAction::dumpScreenshots

Definition at line 45 of file gui_hyper_graph_action.h.

Referenced by operator()(), and g2o::RunG2OViewer::run().

◆ viewer

G2oQGLViewer* g2o::GuiHyperGraphAction::viewer

the viewer which visualizes the graph

Definition at line 44 of file gui_hyper_graph_action.h.

Referenced by operator()(), and g2o::RunG2OViewer::run().


The documentation for this class was generated from the following files: