Renderable.hpp
Go to the documentation of this file.
1 
28  /*
29  * Renderable.h
30  *
31  * Created on: 26.08.2008
32  * Author: Thomas Wiemann
33  *
34  */
35 
36 #ifndef RENDERABLE_H_
37 #define RENDERABLE_H_
38 
39 #if _MSC_VER
40 #include <Windows.h>
41 #endif
42 
43 
44 #ifndef __APPLE__
45 #include <GL/gl.h>
46 #include <GL/glut.h>
47 #else
48 #include <OpenGL/gl.h>
49 #include <GLUT/glut.h>
50 #endif
51 
52 #include <string>
53 using namespace std;
54 
59 
60 #include "lvr2/io/Model.hpp"
61 
62 namespace lvr2
63 {
64 
65 class Renderable {
66 
67 public:
68 
70 
71  Renderable();
72  Renderable(const Renderable &other);
73  Renderable(string name);
74  Renderable(Matrix4<Vec> m, string name);
75 
76 
77  virtual ~Renderable();
78  virtual void render() = 0;
79 
80  void setTransformationMatrix(Matrix4<Vec> m);
81 
82  virtual void setName(string s){m_name = s;};
83  void setVisible(bool s){m_visible = s;};
84  void setRotationSpeed(float s){m_rotationSpeed = s;};
85  void setTranslationSpeed(float s){m_translationSpeed = s;};
86  void setActive(bool a){m_active = a;};
87  void setSelected(bool s) {m_selected = s;};
88 
89  bool isActive(){return m_active;}
90  bool isSelected() { return m_selected;}
91 
92  void toggle(){m_active = !m_active;}
93 
94  void moveX(bool invert = 0)
95  {invert ? m_position.x -= m_translationSpeed: m_position.x += m_translationSpeed; computeMatrix();};
96 
97  void moveY(bool invert = 0)
98  {invert ? m_position.y -= m_translationSpeed: m_position.y += m_translationSpeed; computeMatrix();};
99 
100  void moveZ(bool invert = 0)
101  {invert ? m_position.z -= m_translationSpeed: m_position.z += m_translationSpeed; computeMatrix();};
102 
103  void rotX(bool invert = 0);
104  void rotY(bool invert = 0);
105  void rotZ(bool invert = 0);
106 
107  void yaw(bool invert = 0);
108  void pitch(bool invert = 0);
109  void roll(bool invert = 0);
110 
111  void accel(bool invert = 0);
112  void lift(bool invert = 0);
113  void strafe(bool invert = 0);
114 
115  void scale(float s);
116 
117  void showAxes(bool on){ m_showAxes = on;};
118 
119  void compileAxesList();
120 
121  string Name() {return m_name;};
122  Matrix4<Vec> getTransformation(){return m_transformation;};
123 
124  BoundingBox<Vec>* boundingBox() { return m_boundingBox;};
125 
126  virtual ModelPtr model()
127  {
128  return m_model;
129  }
130 
131  void setPointSize(float size) { m_pointSize = size;}
132  void setLineWidth(float width) { m_lineWidth = width;}
133 
134  float lineWidth() { return m_lineWidth;}
135  float pointSize() { return m_pointSize;}
136 
137 protected:
138 
139  virtual void transform();
140  void computeMatrix();
141 
142  bool m_visible;
144  bool m_active;
146 
147 
151 
155 
156  string m_name;
157 
161 
163 
166 
168 
169  float m_lineWidth;
170  float m_pointSize;
171 };
172 
173 } // namespace lvr2
174 
175 #endif /* RENDERABLE_H_ */
lvr2::Renderable::lineWidth
float lineWidth()
Definition: Renderable.hpp:134
BaseVector.hpp
lvr2::Renderable::m_visible
bool m_visible
Definition: Renderable.hpp:142
lvr2::Matrix4
A 4x4 matrix class implementation for use with the provided vertex types.
Definition: Matrix4.hpp:64
lvr2::BaseVector< float >
lvr2::Renderable::setActive
void setActive(bool a)
Definition: Renderable.hpp:86
lvr2::Renderable::isActive
bool isActive()
Definition: Renderable.hpp:89
lvr2::Renderable::showAxes
void showAxes(bool on)
Definition: Renderable.hpp:117
lvr2::Renderable::m_model
ModelPtr m_model
Definition: Renderable.hpp:167
lvr2::Renderable::m_scaleFactor
float m_scaleFactor
Definition: Renderable.hpp:154
lvr2::Renderable::m_z_Axis
Normal< typename Vec::CoordType > m_z_Axis
Definition: Renderable.hpp:160
lvr2::Renderable::m_selected
bool m_selected
Definition: Renderable.hpp:145
lvr2::Renderable::moveX
void moveX(bool invert=0)
Definition: Renderable.hpp:94
lvr2::Renderable::toggle
void toggle()
Definition: Renderable.hpp:92
render
void render()
lvr2::Renderable::setVisible
void setVisible(bool s)
Definition: Renderable.hpp:83
lvr2::Renderable::setLineWidth
void setLineWidth(float width)
Definition: Renderable.hpp:132
lvr2::Renderable::getTransformation
Matrix4< Vec > getTransformation()
Definition: Renderable.hpp:122
lvr2::Renderable::setPointSize
void setPointSize(float size)
Definition: Renderable.hpp:131
lvr2::Renderable::m_name
string m_name
Definition: Renderable.hpp:156
lvr2::Renderable::setName
virtual void setName(string s)
Definition: Renderable.hpp:82
lvr2::Renderable::pointSize
float pointSize()
Definition: Renderable.hpp:135
lvr2::Renderable::setSelected
void setSelected(bool s)
Definition: Renderable.hpp:87
lvr2::Normal< typename Vec::CoordType >
lvr2::Renderable::m_boundingBox
BoundingBox< Vec > * m_boundingBox
Definition: Renderable.hpp:165
lvr2::Renderable::m_xAxis
Normal< typename Vec::CoordType > m_xAxis
Definition: Renderable.hpp:158
lvr2::Renderable::m_rotationSpeed
float m_rotationSpeed
Definition: Renderable.hpp:152
lvr2::Renderable::boundingBox
BoundingBox< Vec > * boundingBox()
Definition: Renderable.hpp:124
lvr2::Renderable::m_transformation
Matrix4< Vec > m_transformation
Definition: Renderable.hpp:164
lvr2::Renderable::setRotationSpeed
void setRotationSpeed(float s)
Definition: Renderable.hpp:84
lvr2::Renderable::m_translationSpeed
float m_translationSpeed
Definition: Renderable.hpp:153
lvr2::Renderable::m_lineWidth
float m_lineWidth
Definition: Renderable.hpp:169
lvr2::Renderable::m_axesListIndex
int m_axesListIndex
Definition: Renderable.hpp:150
lvr2::Renderable
Definition: Renderable.hpp:65
lvr2::Renderable::moveZ
void moveZ(bool invert=0)
Definition: Renderable.hpp:100
lvr2::Renderable::m_active
bool m_active
Definition: Renderable.hpp:144
lvr2::qttf::transform
PointBufferPtr transform(PointBufferPtr pc_in, const Transformd &T)
Definition: qttf.cpp:32
lvr2::Renderable::m_yAxis
Normal< typename Vec::CoordType > m_yAxis
Definition: Renderable.hpp:159
Model.hpp
lvr2::Renderable::m_showAxes
bool m_showAxes
Definition: Renderable.hpp:143
lvr2::BoundingBox
A dynamic bounding box class.
Definition: BoundingBox.hpp:49
lvr2::Renderable::Name
string Name()
Definition: Renderable.hpp:121
lvr2::Renderable::m_activeListIndex
int m_activeListIndex
Definition: Renderable.hpp:149
lvr2::Renderable::moveY
void moveY(bool invert=0)
Definition: Renderable.hpp:97
lvr2::Renderable::isSelected
bool isSelected()
Definition: Renderable.hpp:90
lvr2::Renderable::model
virtual ModelPtr model()
Definition: Renderable.hpp:126
std
Definition: HalfEdge.hpp:124
Matrix4.hpp
lvr2
Definition: BaseBufferManipulators.hpp:39
lvr2::ModelPtr
std::shared_ptr< Model > ModelPtr
Definition: Model.hpp:80
lvr2::Renderable::m_pointSize
float m_pointSize
Definition: Renderable.hpp:170
lvr2::Renderable::m_position
Vec m_position
Definition: Renderable.hpp:162
lvr2::Renderable::setTranslationSpeed
void setTranslationSpeed(float s)
Definition: Renderable.hpp:85
lvr2::Renderable::m_listIndex
int m_listIndex
Definition: Renderable.hpp:148
Quaternion.hpp
BoundingBox.hpp


lvr2
Author(s): Thomas Wiemann , Sebastian Pütz , Alexander Mock , Lars Kiesow , Lukas Kalbertodt , Tristan Igelbrink , Johan M. von Behren , Dominik Feldschnieders , Alexander Löhr
autogenerated on Wed Mar 2 2022 00:37:24