openPSTD  2.0
Open source simulation for sound propagation in urban environments
SceneLayer.h
1 // This file is part of openPSTD. //
3 // //
4 // openPSTD is free software: you can redistribute it and/or modify //
5 // it under the terms of the GNU General Public License as published by //
6 // the Free Software Foundation, either version 3 of the License, or //
7 // (at your option) any later version. //
8 // //
9 // openPSTD is distributed in the hope that it will be useful, //
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of //
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
12 // GNU General Public License for more details. //
13 // //
14 // You should have received a copy of the GNU General Public License //
15 // along with openPSTD. If not, see <http://www.gnu.org/licenses/>. //
16 // //
18 
20 //
21 // Date: 26-8-2015
22 //
23 //
24 // Authors: M. R. Fortuin
25 //
26 //
27 // Purpose:
28 //
29 //
31 
32 #ifndef OPENPSTD_SCENELAYER_H
33 #define OPENPSTD_SCENELAYER_H
34 
35 #include "Viewer2D.h"
36 #include <vector>
37 #include <tuple>
38 #include "Edges.h"
39 
40 namespace OpenPSTD
41 {
42  namespace GUI
43  {
44 
45  class SceneLayer : public Layer
46  {
47  private:
48  std::unique_ptr<QOpenGLShaderProgram> program;
49  unsigned int positionsBuffer;
50  unsigned int valuesBuffer;
51  GLuint textureID;
52  int lines;
53  float lineWidth;
54 
55  void CreateColormap(std::shared_ptr<Model> const &m,
56  std::unique_ptr<QOpenGLFunctions, void (*)(void *)> const &f);
57 
58  std::unique_ptr<std::vector<Edge>> GetAllEdges(std::shared_ptr<Model> const &m);
59 
60  std::unique_ptr<std::vector<Edge>> RemoveDuplicateEdges(std::unique_ptr<std::vector<Edge>> edges);
61 
62  public:
63  SceneLayer();
64 
65  virtual void InitializeGL(QObject *context, std::unique_ptr<QOpenGLFunctions, void (*)(void *)> const &f);
66 
67  virtual void PaintGL(QObject *context, std::unique_ptr<QOpenGLFunctions, void (*)(void *)> const &f);
68 
69  virtual void UpdateScene(std::shared_ptr<Model> const &m,
70  std::unique_ptr<QOpenGLFunctions, void (*)(void *)> const &f);
71 
72  virtual MinMaxValue GetMinMax();
73  };
74 
75  }
76 }
77 
78 #endif //OPENPSTD_SCENELAYER_H
This is the general namespace of the OpenPSTD application.
Definition: Boundary.cpp:33
Definition: SceneLayer.h:45
Definition: Viewer2D.h:115
Definition: Viewer2D.h:57