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 #if defined(Q_WS_WIN) || defined(Q_OS_WIN)
31  #include <QtCore/qt_windows.h>
32 #endif
33 
34 #if defined(Q_WS_MAC) || defined(Q_OS_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_ */
octomap::ScanGraphDrawer::setScanGraph
virtual void setScanGraph(const octomap::ScanGraph &graph)=0
octomap::SceneObject::m_zMax
double m_zMax
Definition: SceneObject.h:86
octomap::SceneObject::enableHeightColorMode
void enableHeightColorMode(bool enabled=true)
Definition: SceneObject.h:77
octomap::SceneObject::enableSemanticColoring
void enableSemanticColoring(bool enabled=true)
Definition: SceneObject.h:78
octomap::SceneObject
Definition: SceneObject.h:48
octomap::SceneObject::setColorMode
void setColorMode(ColorMode mode)
Definition: SceneObject.h:75
octomap::SceneObject::CM_GRAY_HEIGHT
@ CM_GRAY_HEIGHT
Definition: SceneObject.h:54
octomap::SceneObject::heightMapGray
void heightMapGray(double h, GLfloat *glArrayPos) const
Definition: SceneObject.cpp:92
octomap::ScanGraph
octomap::SceneObject::draw
virtual void draw() const =0
octomap::ScanGraphDrawer::ScanGraphDrawer
ScanGraphDrawer()
Definition: SceneObject.h:98
octomap::SceneObject::CM_SEMANTIC
@ CM_SEMANTIC
Definition: SceneObject.h:55
octomap::SceneObject::CM_FLAT
@ CM_FLAT
Definition: SceneObject.h:51
octomap::SceneObject::m_colorMode
ColorMode m_colorMode
Definition: SceneObject.h:87
octomap::SceneObject::CM_PRINTOUT
@ CM_PRINTOUT
Definition: SceneObject.h:52
octomap::ScanGraphDrawer
Definition: SceneObject.h:96
octomap::SceneObject::m_zMin
double m_zMin
Definition: SceneObject.h:85
octomap::SceneObject::SceneObject
SceneObject()
Definition: SceneObject.cpp:34
octomap::SceneObject::ColorMode
ColorMode
Definition: SceneObject.h:50
octomap::SceneObject::enablePrintoutMode
void enablePrintoutMode(bool enabled=true)
Definition: SceneObject.h:76
octomap::SceneObject::CM_COLOR_HEIGHT
@ CM_COLOR_HEIGHT
Definition: SceneObject.h:53
octomap::SceneObject::clear
virtual void clear()
Definition: SceneObject.h:70
octomap.h
octomap
octomap::SceneObject::heightMapColor
void heightMapColor(double h, GLfloat *glArrayPos) const
Definition: SceneObject.cpp:38
octomap::ScanGraphDrawer::~ScanGraphDrawer
virtual ~ScanGraphDrawer()
Definition: SceneObject.h:99
octomap::SceneObject::~SceneObject
virtual ~SceneObject()
Definition: SceneObject.h:60


octovis
Author(s): Kai M. Wurm , Armin Hornung
autogenerated on Thu Apr 3 2025 02:40:44