53 void build(Model* model, DocumentManager* context, const RenderPreferences& preferences); |
54 void build(Model* model, DocumentManager* context, const RenderPreferences& preferences); |
54 void buildPolygon(Polygon polygon, std::vector<Vertex>* vboData, const gl::RenderPreferences& preferences); |
55 void buildPolygon(Polygon polygon, std::vector<Vertex>* vboData, const gl::RenderPreferences& preferences); |
55 std::size_t vertexCount(gl::ArrayClass arrayClass) const; |
56 std::size_t vertexCount(gl::ArrayClass arrayClass) const; |
56 QColor getColorForPolygon(const gl::Polygon& polygon, const RenderPreferences& preferences); |
57 QColor getColorForPolygon(const gl::Polygon& polygon, const RenderPreferences& preferences); |
57 glm::vec3 modelCenter() const; |
58 glm::vec3 modelCenter() const; |
58 float modelDistance() const; |
59 double modelDistance() const; |
59 void initialize(); |
60 void initialize(); |
60 void bindVertexArray(gl::ArrayClass arrayClass); |
61 void bindVertexArray(gl::ArrayClass arrayClass); |
61 void releaseVertexArray(gl::ArrayClass arrayClass); |
62 void releaseVertexArray(gl::ArrayClass arrayClass); |
62 void buildShaders(int arrayId); |
63 void buildShaders(int arrayId); |
|
64 void setSelectedObjects(const QSet<ldraw::Id> ids); |
63 |
65 |
64 static ldraw::Id idFromColor(const std::array<GLbyte, 3>& data); |
66 static ldraw::Id idFromColor(const std::array<GLbyte, 3>& data); |
65 |
67 |
66 template<typename T> |
68 template<typename T> |
67 void setUniform(const char* uniformName, T&& value) |
69 void setUniform(const char* uniformName, T&& value) |
93 { |
95 { |
94 QOpenGLShaderProgram* program = nullptr; |
96 QOpenGLShaderProgram* program = nullptr; |
95 QOpenGLShaderProgram* pickSceneProgram = nullptr; |
97 QOpenGLShaderProgram* pickSceneProgram = nullptr; |
96 QOpenGLBuffer buffer{QOpenGLBuffer::VertexBuffer}; |
98 QOpenGLBuffer buffer{QOpenGLBuffer::VertexBuffer}; |
97 QOpenGLVertexArrayObject vertexArray; |
99 QOpenGLVertexArrayObject vertexArray; |
|
100 std::vector<gl::Vertex> cachedData; |
98 } glObjects[gl::NUM_ARRAY_CLASSES]; |
101 } glObjects[gl::NUM_ARRAY_CLASSES]; |
99 }; |
102 }; |
100 |
103 |
101 #define CHECK_GL_ERROR() { checkGLError(__FILE__, __LINE__); } |
104 #define CHECK_GL_ERROR() { checkGLError(__FILE__, __LINE__); } |
102 void checkGLError (QString file, int line); |
105 void checkGLError (QString file, int line); |