diff -r 21a5ecbe34e4 -r 3cef3b016330 src/gl/partrenderer.h --- a/src/gl/partrenderer.h Tue Apr 11 20:27:04 2023 +0300 +++ b/src/gl/partrenderer.h Tue Apr 11 22:39:18 2023 +0300 @@ -23,7 +23,6 @@ glm::vec3 modelViewOrigin = {0, 0, 0}; QPoint lastMousePosition; int totalMouseMove = 0; - gl::RenderPreferences renderPreferences; double zoom = 1.0; bool initialized = false; bool needBuild = true; @@ -32,13 +31,16 @@ std::chrono::time_point lastClickTime; bool frozen = false; public: + static const gl::RenderPreferences default_render_preferences; + static const gl::build_preferences default_build_preferences; + const gl::RenderPreferences* render_preferences = &PartRenderer::default_render_preferences; + const gl::build_preferences* build_preferences = &PartRenderer::default_build_preferences; PartRenderer( QTextDocument* model, DocumentManager* documents, const ColorTable& colorTable, QWidget* parent = nullptr); ~PartRenderer() override; - void setRenderPreferences(const gl::RenderPreferences& newPreferences); ModelId getHighlightedObject() const; void addRenderLayer(RenderLayer* layer); void setLayerEnabled(RenderLayer* layer, bool enabled); @@ -50,11 +52,11 @@ glm::vec3 cameraVector(const QPointF& point) const; Line<3> cameraLine(const QPointF& point) const; Q_SLOT void setModelViewOrigin(const glm::vec3& newViewOrigin); + Q_SLOT void build(); Q_SIGNALS: void projectionMatrixChanged(const glm::mat4& newMatrix); void modelMatrixChanged(const glm::mat4& newMatrix); void viewMatrixChanged(const glm::mat4& newMatrix); - void renderPreferencesChanged(); void message(const Message& message); private: void initializeGL() override; @@ -70,7 +72,6 @@ void renderScene(); void updateViewMatrix(); void updateModelMatrix(); - Q_SLOT void build(); void renderVao(const gl::ArrayClass arrayClass, const GLenum glType); template void renderVao();