goat3d

diff 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 diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/goatview/src/scenemodel.h	Wed May 14 05:34:38 2014 +0300
     1.3 @@ -0,0 +1,39 @@
     1.4 +#ifndef SCENEMODEL_H_
     1.5 +#define SCENEMODEL_H_
     1.6 +
     1.7 +#include <map>
     1.8 +#include <QtCore/QAbstractItemModel>
     1.9 +#include "goat3d.h"
    1.10 +
    1.11 +struct SceneNodeData {
    1.12 +	bool visible;
    1.13 +};
    1.14 +
    1.15 +class SceneModel : public QAbstractItemModel {
    1.16 +private:
    1.17 +	Q_OBJECT
    1.18 +
    1.19 +	goat3d *scn;
    1.20 +	std::map<goat3d_node*, SceneNodeData> node_data;
    1.21 +
    1.22 +public:
    1.23 +	SceneModel();
    1.24 +	~SceneModel();
    1.25 +
    1.26 +	void set_scene(goat3d *scn);
    1.27 +	void clear_scene();
    1.28 +
    1.29 +	SceneNodeData *get_node_data(goat3d_node *node) const;
    1.30 +
    1.31 +	Qt::ItemFlags flags(const QModelIndex &index) const;
    1.32 +	QVariant data(const QModelIndex &index, int role) const;
    1.33 +	bool setData(const QModelIndex &index, const QVariant &value, int role);
    1.34 +	QVariant headerData(int section, Qt::Orientation orient, int role) const;
    1.35 +	int rowCount(const QModelIndex &parent) const;
    1.36 +	int columnCount(const QModelIndex &parent) const;
    1.37 +	bool hasChildren(const QModelIndex &parent) const;
    1.38 +	QModelIndex index(int row, int column, const QModelIndex &parent) const;
    1.39 +	QModelIndex parent(const QModelIndex &index) const;
    1.40 +};
    1.41 +
    1.42 +#endif	// SCENEMODEL_H_