59 double modelDistance() const; |
59 double modelDistance() const; |
60 void initialize(); |
60 void initialize(); |
61 void bindVertexArray(gl::ArrayClass arrayClass); |
61 void bindVertexArray(gl::ArrayClass arrayClass); |
62 void releaseVertexArray(gl::ArrayClass arrayClass); |
62 void releaseVertexArray(gl::ArrayClass arrayClass); |
63 void buildShaders(int arrayId); |
63 void buildShaders(int arrayId); |
64 void setSelectedObjects(const QSet<ldraw::Id> ids); |
64 void setSelectedObjects(const QSet<ldraw::id_t> ids); |
65 |
65 |
66 static ldraw::Id idFromColor(const std::array<GLbyte, 3>& data); |
66 static ldraw::id_t idFromColor(const std::array<GLbyte, 3>& data); |
67 |
67 |
68 template<typename T> |
68 template<typename T> |
69 void setUniform(const char* uniformName, T&& value) |
69 void setUniform(const char* uniformName, T&& value) |
70 { |
70 { |
71 Q_ASSERT(this->initialized); |
71 Q_ASSERT(this->initialized); |
88 private: |
88 private: |
89 std::size_t storedVertexCounts[gl::NUM_ARRAY_CLASSES] = {0_z}; |
89 std::size_t storedVertexCounts[gl::NUM_ARRAY_CLASSES] = {0_z}; |
90 bool initialized = false; |
90 bool initialized = false; |
91 BoundingBox boundingBox; |
91 BoundingBox boundingBox; |
92 const ldraw::ColorTable& colorTable; |
92 const ldraw::ColorTable& colorTable; |
93 ldraw::Id hovered = ldraw::NULL_ID; |
93 ldraw::id_t hovered = ldraw::NULL_ID; |
94 struct |
94 struct |
95 { |
95 { |
96 QOpenGLShaderProgram* program = nullptr; |
96 QOpenGLShaderProgram* program = nullptr; |
97 QOpenGLShaderProgram* pickSceneProgram = nullptr; |
97 QOpenGLShaderProgram* pickSceneProgram = nullptr; |
98 QOpenGLBuffer buffer{QOpenGLBuffer::VertexBuffer}; |
98 QOpenGLBuffer buffer{QOpenGLBuffer::VertexBuffer}; |