00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef _LAYER_TREE_H_
00018 #define _LAYER_TREE_H_
00019
00020 #include <QAbstractItemModel>
00021
00022 #include <set>
00023
00024 class PaneStack;
00025 class View;
00026 class Pane;
00027 class Layer;
00028 class PropertyContainer;
00029 class Model;
00030
00031 class ModelDataModel : public QAbstractItemModel
00032 {
00033 Q_OBJECT
00034
00035 public:
00036 ModelDataModel(PaneStack *stack, bool waveModelsOnly, QObject *parent = 0);
00037 virtual ~ModelDataModel();
00038
00039 QVariant data(const QModelIndex &index, int role) const;
00040
00041 bool setData(const QModelIndex &index, const QVariant &value, int role);
00042
00043 Qt::ItemFlags flags(const QModelIndex &index) const;
00044
00045 QVariant headerData(int section, Qt::Orientation orientation,
00046 int role = Qt::DisplayRole) const;
00047
00048 QModelIndex index(int row, int column,
00049 const QModelIndex &parent = QModelIndex()) const;
00050
00051 QModelIndex parent(const QModelIndex &index) const;
00052
00053 int rowCount(const QModelIndex &parent = QModelIndex()) const;
00054 int columnCount(const QModelIndex &parent = QModelIndex()) const;
00055
00056 protected slots:
00057 void paneAdded();
00058 void paneDeleted();
00059 void propertyContainerAdded(PropertyContainer *);
00060 void propertyContainerRemoved(PropertyContainer *);
00061 void propertyContainerSelected(PropertyContainer *);
00062 void propertyContainerPropertyChanged(PropertyContainer *);
00063 void playParametersAudibilityChanged(bool);
00064 void paneLayerModelChanged();
00065 void rebuildModelSet();
00066
00067 protected:
00068 PaneStack *m_stack;
00069 bool m_waveModelsOnly;
00070 int m_modelTypeColumn;
00071 int m_modelNameColumn;
00072 int m_modelMakerColumn;
00073 int m_modelSourceColumn;
00074 int m_columnCount;
00075
00076 std::set<Model *> m_models;
00077 };
00078
00079 class LayerTreeModel : public QAbstractItemModel
00080 {
00081 Q_OBJECT
00082
00083 public:
00084 LayerTreeModel(PaneStack *stack, QObject *parent = 0);
00085 virtual ~LayerTreeModel();
00086
00087 QVariant data(const QModelIndex &index, int role) const;
00088
00089 bool setData(const QModelIndex &index, const QVariant &value, int role);
00090
00091 Qt::ItemFlags flags(const QModelIndex &index) const;
00092
00093 QVariant headerData(int section, Qt::Orientation orientation,
00094 int role = Qt::DisplayRole) const;
00095
00096 QModelIndex index(int row, int column,
00097 const QModelIndex &parent = QModelIndex()) const;
00098
00099 QModelIndex parent(const QModelIndex &index) const;
00100
00101 int rowCount(const QModelIndex &parent = QModelIndex()) const;
00102 int columnCount(const QModelIndex &parent = QModelIndex()) const;
00103
00104 protected slots:
00105 void paneAdded();
00106 void paneAboutToBeDeleted(Pane *);
00107 void propertyContainerAdded(PropertyContainer *);
00108 void propertyContainerRemoved(PropertyContainer *);
00109 void propertyContainerSelected(PropertyContainer *);
00110 void propertyContainerPropertyChanged(PropertyContainer *);
00111 void paneLayerModelChanged();
00112 void playParametersAudibilityChanged(bool);
00113
00114 protected:
00115 PaneStack *m_stack;
00116 std::set<QObject *> m_deletedPanes;
00117 int m_layerNameColumn;
00118 int m_layerVisibleColumn;
00119 int m_layerPlayedColumn;
00120 int m_modelNameColumn;
00121 int m_columnCount;
00122 };
00123
00124 #endif