Langmuir
Simulation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
sceneobject.h
Go to the documentation of this file.
1 #ifndef SCENEOBJECT_H
2 #define SCENEOBJECT_H
3 
4 #include <QVector>
5 #include <QObject>
6 #include <QColor>
7 #include <QDebug>
8 
9 #ifdef Q_OS_MAC
10  #include <OpenGL/glu.h>
11 #else
12  #include <GL/glu.h>
13 #endif
14 
15 namespace LangmuirView {
16 
17 class LangmuirViewer;
18 
22 class SceneObject : public QObject
23 {
24  Q_OBJECT
25 public:
31  explicit SceneObject(LangmuirViewer &viewer, QObject *parent = 0);
32 
36  bool isVisible();
37 
43  void render();
44 
45 signals:
50  void visibleChanged(bool drawn);
51 
52 public slots:
56  void toggleVisible();
57 
62  void setVisible(bool draw = true);
63 
67  virtual void makeConnections();
68 
69 protected:
75  virtual void init();
76 
80  virtual void draw();
81 
85  virtual void preDraw();
86 
90  virtual void postDraw();
91 
94 
96  bool visible_;
97 };
98 
99 }
100 
101 #endif // SCENEOBJECT_H
Base class for objects in OpenGL scene.
Definition: sceneobject.h:22
virtual void preDraw()
perform OpenGL drawing operations before draw()
virtual void init()
initialize object
bool isVisible()
true if object is drawn
virtual void makeConnections()
make signal/slot connections
void render()
calls OpenGL drawing commands.
bool visible_
visibility
Definition: sceneobject.h:96
void visibleChanged(bool drawn)
signal that the visibility has changed
void setVisible(bool draw=true)
set the visibility
void toggleVisible()
toggle visibility
Definition: axis.h:6
LangmuirViewer & m_viewer
reference to OpenGL widget
Definition: sceneobject.h:93
Widget to view Langmuir Simulation in real time.
Definition: langmuirviewer.h:47
virtual void postDraw()
perform OpenGL drawing operations after draw()
virtual void draw()
perform OpenGL drawing operations
SceneObject(LangmuirViewer &viewer, QObject *parent=0)
create the SceneObject