| 47:cd6704009eb9 | 48:3c10f0e2fbe0 |
|---|---|
| 24 #include <QMap> | 24 #include <QMap> |
| 25 #include <QSet> | 25 #include <QSet> |
| 26 #include <QOpenGLVertexArrayObject> | 26 #include <QOpenGLVertexArrayObject> |
| 27 #include <QOpenGLBuffer> | 27 #include <QOpenGLBuffer> |
| 28 #include <QOpenGLShaderProgram> | 28 #include <QOpenGLShaderProgram> |
| 29 #include <QOpenGLExtraFunctions> | |
| 29 | 30 |
| 30 class Model; | 31 class Model; |
| 31 class DocumentManager; | 32 class DocumentManager; |
| 32 | 33 |
| 33 namespace gl | 34 namespace gl |
| 37 struct Vertex | 38 struct Vertex |
| 38 { | 39 { |
| 39 glm::vec3 position; | 40 glm::vec3 position; |
| 40 glm::vec4 color; | 41 glm::vec4 color; |
| 41 glm::vec3 normal; | 42 glm::vec3 normal; |
| 42 glm::vec3 id; | 43 glm::vec3 idColor; |
| 44 glm::int32 id; | |
| 43 }; | 45 }; |
| 44 } | 46 } |
| 45 | 47 |
| 46 class gl::Compiler : public QObject, protected QOpenGLFunctions | 48 class gl::Compiler : public QObject, protected QOpenGLExtraFunctions |
| 47 { | 49 { |
| 48 Q_OBJECT | 50 Q_OBJECT |
| 49 public: | 51 public: |
| 50 Compiler(const ldraw::ColorTable& colorTable, QObject* parent); | 52 Compiler(const ldraw::ColorTable& colorTable, QObject* parent); |
| 51 ~Compiler(); | 53 ~Compiler(); |
| 85 private: | 87 private: |
| 86 std::size_t storedVertexCounts[gl::NUM_ARRAY_CLASSES] = {0_z}; | 88 std::size_t storedVertexCounts[gl::NUM_ARRAY_CLASSES] = {0_z}; |
| 87 bool initialized = false; | 89 bool initialized = false; |
| 88 BoundingBox boundingBox; | 90 BoundingBox boundingBox; |
| 89 const ldraw::ColorTable& colorTable; | 91 const ldraw::ColorTable& colorTable; |
| 92 ldraw::Id hovered = ldraw::NULL_ID; | |
| 90 struct | 93 struct |
| 91 { | 94 { |
| 92 QOpenGLShaderProgram* program = nullptr; | 95 QOpenGLShaderProgram* program = nullptr; |
| 93 QOpenGLShaderProgram* pickSceneProgram = nullptr; | 96 QOpenGLShaderProgram* pickSceneProgram = nullptr; |
| 94 QOpenGLBuffer buffer{QOpenGLBuffer::VertexBuffer}; | 97 QOpenGLBuffer buffer{QOpenGLBuffer::VertexBuffer}; |