SceneObject.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 SCENEOBJECT_H_
26 #define SCENEOBJECT_H_
27 
28 // fix Windows includes
29 #include <qglobal.h>
30 #ifdef Q_WS_WIN
31  #include <QtCore/qt_windows.h>
32 #endif
33 
34 #ifdef Q_WS_MAC
35  #include <OpenGL/glu.h>
36 #else
37  #include <GL/glu.h>
38 #endif
39 
40 #include <qglviewer.h>
41 #include <octomap/octomap.h>
42 
43 namespace octomap {
44 
49  class SceneObject {
50  public:
51  enum ColorMode {
57  };
58 
59  public:
60  SceneObject();
61  virtual ~SceneObject(){};
62 
66  virtual void draw() const = 0;
67 
71  virtual void clear(){};
72 
73  public:
76  inline void setColorMode(ColorMode mode) { m_colorMode = mode; }
77  inline void enablePrintoutMode(bool enabled = true) { if (enabled) m_colorMode = CM_PRINTOUT; else m_colorMode = CM_FLAT; }
78  inline void enableHeightColorMode(bool enabled = true) { if (enabled) m_colorMode = CM_COLOR_HEIGHT; else m_colorMode = CM_FLAT; }
79  inline void enableSemanticColoring(bool enabled = true) { if (enabled) m_colorMode = CM_SEMANTIC; else m_colorMode = CM_FLAT; }
80 
81  protected:
84  void heightMapColor(double h, GLfloat* glArrayPos) const;
85  void heightMapGray(double h, GLfloat* glArrayPos) const;
86  double m_zMin;
87  double m_zMax;
89  };
90 
91 
92 
93 
97  class ScanGraphDrawer : public SceneObject {
98  public:
100  virtual ~ScanGraphDrawer(){};
101 
109  virtual void setScanGraph(const octomap::ScanGraph& graph) = 0;
110  };
111 
112 }
113 
114 #endif /* SCENEOBJECT_H_ */
virtual ~SceneObject()
Definition: SceneObject.h:61
void enableHeightColorMode(bool enabled=true)
Definition: SceneObject.h:78
void enableSemanticColoring(bool enabled=true)
Definition: SceneObject.h:79
ColorMode m_colorMode
Definition: SceneObject.h:88
virtual void draw() const =0
void setColorMode(ColorMode mode)
Definition: SceneObject.h:76
void heightMapGray(double h, GLfloat *glArrayPos) const
Definition: SceneObject.cpp:92
void enablePrintoutMode(bool enabled=true)
Definition: SceneObject.h:77
void heightMapColor(double h, GLfloat *glArrayPos) const
Definition: SceneObject.cpp:38
virtual void clear()
Definition: SceneObject.h:71


octovis
Author(s): Kai M. Wurm , Armin Hornung
autogenerated on Mon Jun 10 2019 14:00:25