Langmuir
Simulation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
grid.h
Go to the documentation of this file.
1 #ifndef GRID_H
2 #define GRID_H
3 
4 #include "sceneobject.h"
5 
6 #include <QOpenGLShaderProgram>
7 #include <QOpenGLShader>
8 #include <QOpenGLBuffer>
9 #include <QMatrix4x4>
10 #include <QVector>
11 
12 namespace LangmuirView {
13 
17 class Grid : public SceneObject
18 {
19  Q_OBJECT
20 public:
26  explicit Grid(LangmuirViewer &viewer, QObject *parent = 0);
27 
31  ~Grid();
32 
36  const QColor& getColor() const;
37 
38 signals:
43  void colorChanged(QColor color);
44 
48  void gridChanged();
49 
50 public slots:
54  virtual void makeConnections();
55 
62  void setDimensions(int xsize, int ysize, int zsize);
63 
68  void setColor(QColor color);
69 
70 protected:
74  virtual void init();
75 
79  virtual void draw();
80 
84  void initShaders();
85 
87  void drawFallback();
88 
90  void drawGrid();
91 
93  QOpenGLShaderProgram m_shader1; // lines pipeline
94 
96  QOpenGLBuffer *m_verticesVBO;
97 
99  unsigned int m_numPoints;
100 
102  QColor m_color;
103 
106 };
107 
108 }
109 
110 #endif // GRID_H
Base class for objects in OpenGL scene.
Definition: sceneobject.h:22
void initShaders()
load the shaders
void setColor(QColor color)
set the color
QColor m_color
color of grid
Definition: grid.h:102
void colorChanged(QColor color)
signal that the color of has changed
const QColor & getColor() const
get color
virtual void draw()
perform OpenGL drawing operations
~Grid()
destroy the Grid
Definition: axis.h:6
void drawFallback()
render function
bool m_shader1OK
shader1 ok to use
Definition: grid.h:105
Widget to view Langmuir Simulation in real time.
Definition: langmuirviewer.h:47
Grid(LangmuirViewer &viewer, QObject *parent=0)
create the Grid
void gridChanged()
signal that the grid has changed
QOpenGLBuffer * m_verticesVBO
vertices buffer
Definition: grid.h:96
A class to represent simulation grid.
Definition: grid.h:17
QOpenGLShaderProgram m_shader1
OpenGL shading pipeline.
Definition: grid.h:93
void setDimensions(int xsize, int ysize, int zsize)
create the grid using dimensions
virtual void init()
initialize object
unsigned int m_numPoints
total number of points (# vertices / 3)
Definition: grid.h:99
virtual void makeConnections()
make signal/slot connections
void drawGrid()
render function