ViewerWidget.h
Go to the documentation of this file.
00001 /*
00002  * OctoMap - An Efficient Probabilistic 3D Mapping Framework Based on Octrees
00003  * http://octomap.github.com/
00004  *
00005  * Copyright (c) 2009-2013, K.M. Wurm and A. Hornung, University of Freiburg
00006  * All rights reserved.
00007  * License (octovis): GNU GPL v2
00008  * http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt
00009  *
00010  *
00011  * This program is free software; you can redistribute it and/or modify
00012  * it under the terms of the GNU General Public License as published by
00013  * the Free Software Foundation; either version 2 of the License, or
00014  * (at your option) any later version.
00015  *
00016  * This program is distributed in the hope that it will be useful, but
00017  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
00018  * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
00019  * for more details.
00020  *
00021  * You should have received a copy of the GNU General Public License along
00022  * with this program; if not, write to the Free Software Foundation, Inc.,
00023  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
00024  */
00025 
00026 #ifndef VIEWERWIDGET_H_
00027 #define VIEWERWIDGET_H_
00028 
00029 #include "SceneObject.h"
00030 #include "SelectionBox.h"
00031 #include <octomap/octomap.h>
00032 #include <qglviewer.h>
00033 
00034 namespace octomap{
00035 
00036 class ViewerWidget : public QGLViewer {
00037   Q_OBJECT
00038 
00039  public:
00040 
00041   ViewerWidget(QWidget* parent = NULL);
00042   void clearAll();
00043 
00049   void addSceneObject(SceneObject* obj);
00050 
00057   void removeSceneObject(SceneObject* obj);
00058 
00059  public slots:
00060   void enablePrintoutMode (bool enabled = true);
00061   void enableHeightColorMode (bool enabled = true);
00062   void enableSemanticColoring (bool enabled = true);
00063   void enableSelectionBox (bool enabled = true);
00064   void setCamPosition(double x, double y, double z, double lookX, double lookY, double lookZ);
00065   void setCamPose(const octomath::Pose6D& pose);
00066   virtual void setSceneBoundingBox(const qglviewer::Vec& min, const qglviewer::Vec& max);
00067   void deleteCameraPath(int id);
00068   void appendToCameraPath(int id, const octomath::Pose6D& pose);
00069   void appendCurrentToCameraPath(int id);
00070   void addCurrentToCameraPath(int id, int frame);
00071   void removeFromCameraPath(int id, int frame);
00072   void updateCameraPath(int id, int frame);
00073   void jumpToCamFrame(int id, int frame);
00074   void playCameraPath(int id, int start_frame);
00075   void stopCameraPath(int id);
00076   const SelectionBox& selectionBox() const { return m_selectionBox;}
00077 
00081   void resetView();
00082 
00083 private slots:
00084    void cameraPathFinished();
00085    void cameraPathInterpolated();
00086 
00087 signals:
00088    void cameraPathStopped(int id);
00089    void cameraPathFrameChanged(int id, int current_camera_frame);
00090 
00091  protected:
00092 
00093   virtual void draw();
00094   virtual void drawWithNames();
00095   virtual void init();
00099   virtual void postDraw();
00100   virtual void postSelection(const QPoint&);
00101   virtual QString helpString() const;
00102 
00103   qglviewer::Quaternion poseToQGLQuaternion(const octomath::Pose6D& pose);
00104 
00105   std::vector<SceneObject*> m_sceneObjects;
00106   SelectionBox m_selectionBox;
00107 
00108   bool m_printoutMode;
00109   bool m_heightColorMode;
00110   bool m_semantic_coloring;
00111 
00112   bool m_drawAxis; // actual state of axis (original overwritten)
00113   bool m_drawGrid; // actual state of grid (original overwritten)
00114   bool m_drawSelectionBox;
00115 
00116   double m_zMin;
00117   double m_zMax;
00118 
00119   int m_current_camera_path;
00120   int m_current_camera_frame;
00121 };
00122 
00123 }
00124 
00125 #endif /* VIEWERWIDGET_H_ */


octovis
Author(s): Kai M. Wurm , Armin Hornung
autogenerated on Thu Jun 6 2019 17:31:58