38 |
38 |
39 class gl::Compiler : public QObject, protected QOpenGLExtraFunctions |
39 class gl::Compiler : public QObject, protected QOpenGLExtraFunctions |
40 { |
40 { |
41 Q_OBJECT |
41 Q_OBJECT |
42 public: |
42 public: |
43 Compiler(const ldraw::ColorTable& colorTable, QObject* parent); |
43 Compiler(Model* model, const ldraw::ColorTable& colorTable, QObject* parent); |
44 ~Compiler(); |
44 ~Compiler(); |
45 void build(Model* model, DocumentManager* context, const RenderPreferences& preferences); |
45 void build(DocumentManager* context, const RenderPreferences& preferences); |
46 std::size_t vertexCount(gl::ArrayClass arrayClass) const; |
46 std::size_t vertexCount(gl::ArrayClass arrayClass) const; |
47 QColor getColorForPolygon(const gl::Polygon& polygon, const RenderPreferences& preferences); |
47 QColor getColorForPolygon(const gl::Polygon& polygon, const RenderPreferences& preferences); |
48 glm::vec3 modelCenter() const; |
48 glm::vec3 modelCenter() const; |
49 double modelDistance() const; |
49 double modelDistance() const; |
50 void initialize(); |
50 void initialize(); |
83 glm::vec3 normal; |
83 glm::vec3 normal; |
84 glm::int32 id; |
84 glm::int32 id; |
85 glm::int32 selected = 0; |
85 glm::int32 selected = 0; |
86 }; |
86 }; |
87 void buildPolygon(Polygon polygon, std::vector<Vertex>* vboData, const gl::RenderPreferences& preferences); |
87 void buildPolygon(Polygon polygon, std::vector<Vertex>* vboData, const gl::RenderPreferences& preferences); |
|
88 Model* const model; |
88 std::size_t storedVertexCounts[gl::NUM_POLYGON_TYPES] = {0}; |
89 std::size_t storedVertexCounts[gl::NUM_POLYGON_TYPES] = {0}; |
89 bool initialized = false; |
90 bool initialized = false; |
90 BoundingBox boundingBox; |
91 BoundingBox boundingBox; |
91 const ldraw::ColorTable& colorTable; |
92 const ldraw::ColorTable& colorTable; |
92 ldraw::id_t hovered = ldraw::NULL_ID; |
93 ldraw::id_t hovered = ldraw::NULL_ID; |