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 <octomap/octomap.h>
41 
42 namespace octomap {
43 
48  class SceneObject {
49  public:
50  enum ColorMode {
56  };
57 
58  public:
59  SceneObject();
60  virtual ~SceneObject(){};
61 
65  virtual void draw() const = 0;
66 
70  virtual void clear(){};
71 
72  public:
75  inline void setColorMode(ColorMode mode) { m_colorMode = mode; }
76  inline void enablePrintoutMode(bool enabled = true) { if (enabled) m_colorMode = CM_PRINTOUT; else m_colorMode = CM_FLAT; }
77  inline void enableHeightColorMode(bool enabled = true) { if (enabled) m_colorMode = CM_COLOR_HEIGHT; else m_colorMode = CM_FLAT; }
78  inline void enableSemanticColoring(bool enabled = true) { if (enabled) m_colorMode = CM_SEMANTIC; else m_colorMode = CM_FLAT; }
79 
80  protected:
83  void heightMapColor(double h, GLfloat* glArrayPos) const;
84  void heightMapGray(double h, GLfloat* glArrayPos) const;
85  double m_zMin;
86  double m_zMax;
88  };
89 
90 
91 
92 
96  class ScanGraphDrawer : public SceneObject {
97  public:
99  virtual ~ScanGraphDrawer(){};
100 
108  virtual void setScanGraph(const octomap::ScanGraph& graph) = 0;
109  };
110 
111 }
112 
113 #endif /* SCENEOBJECT_H_ */
virtual ~SceneObject()
Definition: SceneObject.h:60
void enableHeightColorMode(bool enabled=true)
Definition: SceneObject.h:77
void enableSemanticColoring(bool enabled=true)
Definition: SceneObject.h:78
ColorMode m_colorMode
Definition: SceneObject.h:87
virtual void draw() const =0
void setColorMode(ColorMode mode)
Definition: SceneObject.h:75
void heightMapGray(double h, GLfloat *glArrayPos) const
Definition: SceneObject.cpp:92
void enablePrintoutMode(bool enabled=true)
Definition: SceneObject.h:76
void heightMapColor(double h, GLfloat *glArrayPos) const
Definition: SceneObject.cpp:38
virtual void clear()
Definition: SceneObject.h:70


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