PCB Environment: /home/chr/devel/PhD/Environment/pub/PCBEnv/pcbenv/cxx/UI/RoutePainter.hpp Source File

PCB Environment 2

Loading...
Searching...
No Matches
RoutePainter.hpp
1
2#ifndef GYM_PCB_UI_ROUTEPAINTER_H
3#define GYM_PCB_UI_ROUTEPAINTER_H
4
5#include "GLContext.hpp"
6#include "Color.hpp"
7
8class PCBoard;
9class Track;
10class Camera;
11
12 class RoutePainter
13{
14public:
15 constexpr static const uint MaxLayers = 16;
16 RoutePainter();
17 ~RoutePainter();
18 void update(const PCBoard&);
19 void update(const Track&, uint zmax, Color);
20 void setLineWidth(float w) { mBaseLineWidth = w; }
21 void draw(const Camera&);
22 void drawLayer(const Camera&, uint z);
23 void setLayerColor(uint z, Color);
24 void setLayerAlpha(uint z, float);
25 void clear();
26private:
27 //uint mNumTriStrips{0};
28 uint mVertexCount{0};
29 std::vector<uint> mIndexCounts;
30 GLenum mIndexType;
31 float mBaseLineWidth{2.0f};
32 float mLayerColor[MaxLayers][4];
33
34 GLuint mVBO{0};
35 GLuint mIBO{0};
36 GLuint mCMD{0};
37 GLuint mVAO{0};
38
39 static GLuint sVP, sFP, sPP;
40 static GLint sUniformLayerColors;
41
42 void createVAO();
43 void createIBO();
44 static void createShaders();
45
46 static constexpr const GLushort RestartIndex = 0xffff;
47};
48
49#endif // GYM_PCB_UI_ROUTEPAINTER_H
Camera
Definition Camera.hpp:15
Color
Definition Color.hpp:9
PCBoard
Definition PCBoard.hpp:36
Track
Definition Track.hpp:21