goat3d
view goatview/src/scenemodel.h @ 86:6d04caf510ab
forgot to add the new source files
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Wed, 14 May 2014 05:34:38 +0300 |
parents | |
children | 7941e89798e5 |
line source
1 #ifndef SCENEMODEL_H_
2 #define SCENEMODEL_H_
4 #include <map>
5 #include <QtCore/QAbstractItemModel>
6 #include "goat3d.h"
8 struct SceneNodeData {
9 bool visible;
10 };
12 class SceneModel : public QAbstractItemModel {
13 private:
14 Q_OBJECT
16 goat3d *scn;
17 std::map<goat3d_node*, SceneNodeData> node_data;
19 public:
20 SceneModel();
21 ~SceneModel();
23 void set_scene(goat3d *scn);
24 void clear_scene();
26 SceneNodeData *get_node_data(goat3d_node *node) const;
28 Qt::ItemFlags flags(const QModelIndex &index) const;
29 QVariant data(const QModelIndex &index, int role) const;
30 bool setData(const QModelIndex &index, const QVariant &value, int role);
31 QVariant headerData(int section, Qt::Orientation orient, int role) const;
32 int rowCount(const QModelIndex &parent) const;
33 int columnCount(const QModelIndex &parent) const;
34 bool hasChildren(const QModelIndex &parent) const;
35 QModelIndex index(int row, int column, const QModelIndex &parent) const;
36 QModelIndex parent(const QModelIndex &index) const;
37 };
39 #endif // SCENEMODEL_H_