ViewerWidget.h
Go to the documentation of this file.
1 /*
2  * This file is part of OctoMap - An Efficient Probabilistic 3D Mapping
3  * Framework Based on Octrees
4  * http://octomap.github.io
5  *
6  * Copyright (c) 2009-2014, K.M. Wurm and A. Hornung, University of Freiburg
7  * All rights reserved. License for the viewer octovis: GNU GPL v2
8  * http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt
9  *
10  *
11  * This program is free software; you can redistribute it and/or modify
12  * it under the terms of the GNU General Public License as published by
13  * the Free Software Foundation; either version 2 of the License, or
14  * (at your option) any later version.
15  *
16  * This program is distributed in the hope that it will be useful, but
17  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
18  * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  * for more details.
20  *
21  * You should have received a copy of the GNU General Public License
22  * along with this program. If not, see http://www.gnu.org/licenses/.
23  */
24 
25 #ifndef VIEWERWIDGET_H_
26 #define VIEWERWIDGET_H_
27 
28 #include "SceneObject.h"
29 #include "SelectionBox.h"
30 #include <octomap/octomap.h>
31 #include <qglviewer.h>
32 
33 namespace octomap{
34 
35 class ViewerWidget : public QGLViewer {
36  Q_OBJECT
37 
38  public:
39 
40  ViewerWidget(QWidget* parent = NULL);
41  void clearAll();
42 
48  void addSceneObject(SceneObject* obj);
49 
56  void removeSceneObject(SceneObject* obj);
57 
58  public slots:
59  void enablePrintoutMode (bool enabled = true);
60  void enableHeightColorMode (bool enabled = true);
61  void enableSemanticColoring (bool enabled = true);
62  void enableSelectionBox (bool enabled = true);
63  void setCamPosition(double x, double y, double z, double lookX, double lookY, double lookZ);
64  void setCamPose(const octomath::Pose6D& pose);
65  virtual void setSceneBoundingBox(const qglviewer::Vec& min, const qglviewer::Vec& max);
66  void deleteCameraPath(int id);
67  void appendToCameraPath(int id, const octomath::Pose6D& pose);
68  void appendCurrentToCameraPath(int id);
69  void addCurrentToCameraPath(int id, int frame);
70  void removeFromCameraPath(int id, int frame);
71  void updateCameraPath(int id, int frame);
72  void jumpToCamFrame(int id, int frame);
73  void playCameraPath(int id, int start_frame);
74  void stopCameraPath(int id);
75  const SelectionBox& selectionBox() const { return m_selectionBox;}
76 
80  void resetView();
81 
82 private slots:
83  void cameraPathFinished();
85 
86 signals:
87  void cameraPathStopped(int id);
88  void cameraPathFrameChanged(int id, int current_camera_frame);
89 
90  protected:
91 
92  virtual void draw();
93  virtual void drawWithNames();
94  virtual void init();
98  virtual void postDraw();
99  virtual void postSelection(const QPoint&);
100  virtual QString helpString() const;
101 
103 
104  std::vector<SceneObject*> m_sceneObjects;
106 
110 
111  bool m_drawAxis; // actual state of axis (original overwritten)
112  bool m_drawGrid; // actual state of grid (original overwritten)
114 
115  double m_zMin;
116  double m_zMax;
117 
120 };
121 
122 }
123 
124 #endif /* VIEWERWIDGET_H_ */
std::vector< SceneObject * > m_sceneObjects
Definition: ViewerWidget.h:104
virtual void postSelection(const QPoint &)
virtual QString helpString() const
void addCurrentToCameraPath(int id, int frame)
virtual void setSceneBoundingBox(const qglviewer::Vec &min, const qglviewer::Vec &max)
void enablePrintoutMode(bool enabled=true)
void updateCameraPath(int id, int frame)
void enableSelectionBox(bool enabled=true)
virtual void drawWithNames()
void appendToCameraPath(int id, const octomath::Pose6D &pose)
void removeSceneObject(SceneObject *obj)
void jumpToCamFrame(int id, int frame)
void appendCurrentToCameraPath(int id)
SelectionBox m_selectionBox
Definition: ViewerWidget.h:105
virtual void init()
void enableHeightColorMode(bool enabled=true)
void setCamPosition(double x, double y, double z, double lookX, double lookY, double lookZ)
void cameraPathFrameChanged(int id, int current_camera_frame)
void enableSemanticColoring(bool enabled=true)
void deleteCameraPath(int id)
const SelectionBox & selectionBox() const
Definition: ViewerWidget.h:75
The Vec class represents 3D positions and 3D vectors.
Definition: vec.h:65
void cameraPathStopped(int id)
void addSceneObject(SceneObject *obj)
void playCameraPath(int id, int start_frame)
A versatile 3D OpenGL viewer based on QGLWidget.
Definition: qglviewer.h:62
void stopCameraPath(int id)
virtual void postDraw()
void setCamPose(const octomath::Pose6D &pose)
The Quaternion class represents 3D rotations and orientations.
Definition: quaternion.h:66
qglviewer::Quaternion poseToQGLQuaternion(const octomath::Pose6D &pose)
ViewerWidget(QWidget *parent=NULL)
void removeFromCameraPath(int id, int frame)


octovis
Author(s): Kai M. Wurm , Armin Hornung
autogenerated on Wed Jun 5 2019 19:26:39