src/gl/partrenderer.cpp

changeset 77
028798a72591
parent 73
97df974b5ed5
child 78
97c3ce5aa498
child 90
e234edb5e613
equal deleted inserted replaced
76:7c4a63a02632 77:028798a72591
22 #include <QMouseEvent> 22 #include <QMouseEvent>
23 #include <QMessageBox> 23 #include <QMessageBox>
24 #include <QAbstractButton> 24 #include <QAbstractButton>
25 #include "geometry.h" 25 #include "geometry.h"
26 #include "partrenderer.h" 26 #include "partrenderer.h"
27 #include "model.h"
27 28
28 PartRenderer::PartRenderer( 29 PartRenderer::PartRenderer(
29 Model* model, 30 Model* model,
30 DocumentManager* documents, 31 DocumentManager* documents,
31 const ldraw::ColorTable& colorTable, 32 const ldraw::ColorTable& colorTable,
59 { 60 {
60 abort(); 61 abort();
61 } 62 }
62 this->compiler->initialize(); 63 this->compiler->initialize();
63 this->compiler->build(this->model, this->documents, this->renderPreferences); 64 this->compiler->build(this->model, this->documents, this->renderPreferences);
65 connect(this->model, &Model::dataChanged, [&]()
66 {
67 this->compiler->build(this->model, this->documents, this->renderPreferences);
68 });
64 this->initialized = true; 69 this->initialized = true;
65 this->modelQuaternion = glm::angleAxis(glm::radians(30.0f), glm::vec3{-1, 0, 0}); 70 this->modelQuaternion = glm::angleAxis(glm::radians(30.0f), glm::vec3{-1, 0, 0});
66 this->modelQuaternion *= glm::angleAxis(glm::radians(225.0f), glm::vec3{-0, 1, 0}); 71 this->modelQuaternion *= glm::angleAxis(glm::radians(225.0f), glm::vec3{-0, 1, 0});
67 this->setupBackgroundColor(); 72 this->setupBackgroundColor();
68 this->updateModelMatrix(); 73 this->updateModelMatrix();

mercurial