src/glcompiler.h

changeset 1246
0054d13ed614
parent 1245
338d66111168
child 1247
7e1ce2fc066b
equal deleted inserted replaced
1245:338d66111168 1246:0054d13ed614
36 36
37 void initialize(); 37 void initialize();
38 void prepareVBO (int vbonum); 38 void prepareVBO (int vbonum);
39 GLuint vbo (int vbonum) const; 39 GLuint vbo (int vbonum) const;
40 int vboSize (int vbonum) const; 40 int vboSize (int vbonum) const;
41 void setSelectionModel(QItemSelectionModel* selectionModel);
41 42
42 static int vboNumber (VboClass surface, VboSubclass complement); 43 static int vboNumber (VboClass surface, VboSubclass complement);
44
45 public slots:
46 void selectionChanged(const QItemSelection& selected, const QItemSelection& deselected);
43 47
44 private: 48 private:
45 struct ObjectVboData 49 struct ObjectVboData
46 { 50 {
47 QVector<GLfloat> data[NumVbos]; 51 QVector<GLfloat> data[NumVbos];
48 }; 52 };
49 53
50 void compileStaged(); 54 void compileStaged();
51 void compilePolygon (LDPolygon& poly, LDObject* polygonOwner, ObjectVboData& objectInfo); 55 void compilePolygon(
52 Q_SLOT void compileObject (QModelIndex index); 56 LDPolygon& poly,
53 QColor getColorForPolygon (LDPolygon& poly, LDObject* topobj, VboSubclass complement); 57 const QModelIndex& polygonOwnerIndex,
58 ObjectVboData& objectInfo
59 );
60 Q_SLOT void compileObject (const QModelIndex &index);
61 QColor getColorForPolygon(
62 LDPolygon& poly,
63 const QModelIndex& polygonOwnerIndex,
64 VboSubclass complement
65 );
54 QColor indexColorForID (qint32 id) const; 66 QColor indexColorForID (qint32 id) const;
55 void needMerge(); 67 void needMerge();
56 Q_SLOT void recompile(); 68 Q_SLOT void recompile();
57 void dropObjectInfo (const QModelIndex &index); 69 void dropObjectInfo (const QModelIndex &index);
58 Q_SLOT void forgetObject(QModelIndex index); 70 Q_SLOT void forgetObject(QModelIndex index);
63 QSet<QPersistentModelIndex> m_staged; // Objects that need to be compiled 75 QSet<QPersistentModelIndex> m_staged; // Objects that need to be compiled
64 GLuint m_vbo[NumVbos]; 76 GLuint m_vbo[NumVbos];
65 bool m_vboChanged[NumVbos] = {true}; 77 bool m_vboChanged[NumVbos] = {true};
66 int m_vboSizes[NumVbos] = {0}; 78 int m_vboSizes[NumVbos] = {0};
67 GLRenderer* m_renderer; 79 GLRenderer* m_renderer;
80 QItemSelectionModel* selectionModel = nullptr;
68 81
69 private slots: 82 private slots:
70 void handleRowInsertion(const QModelIndex&, int first, int last); 83 void handleRowInsertion(const QModelIndex&, int first, int last);
71 void handleRowRemoval(const QModelIndex&, int first, int last); 84 void handleRowRemoval(const QModelIndex&, int first, int last);
72 void handleDataChange(const QModelIndex& topLeft, const QModelIndex &bottomRight); 85 void handleDataChange(const QModelIndex& topLeft, const QModelIndex &bottomRight);
86 void clearSelectionModel();
73 }; 87 };
74 88
75 #define CHECK_GL_ERROR() { checkGLError(this, __FILE__, __LINE__); } 89 #define CHECK_GL_ERROR() { checkGLError(this, __FILE__, __LINE__); }
76 void checkGLError (HierarchyElement* element, QString file, int line); 90 void checkGLError (HierarchyElement* element, QString file, int line);

mercurial