DISPLACE  1.0
A spatial model of fisheries to help sustainable fishing and maritime spatial planning
layerentity.h
Go to the documentation of this file.
1 /* --------------------------------------------------------------------------
2  * DISPLACE: DYNAMIC INDIVIDUAL VESSEL-BASED SPATIAL PLANNING
3  * AND EFFORT DISPLACEMENT
4  * Copyright (c) 2012, 2013, 2014 Francois Bastardie <fba@aqua.dtu.dk>
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License along
17  * with this program; if not, write to the Free Software Foundation, Inc.,
18  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19  * --------------------------------------------------------------------------
20  */
21 #ifndef LAYERENTITY_H
22 #define LAYERENTITY_H
23 
25 
26 namespace objecttree {
27 
33 class LayerEntity : public QObject, public ObjectTreeEntity
34 {
35  Q_OBJECT
36 
37 private:
38  int mLayerEntityIndex;
39  ObjectTreeModel::Category mLayerEntityType;
40 
41 public:
42  LayerEntity(ObjectTreeModel::Category type, ObjectTreeModel *_model, int LayerEntity_idx = -1);
43  virtual ~LayerEntity();
44 
46  return mLayerEntityType;
47  }
48 
49  virtual QModelIndex parent (const QModelIndex &parent) const;
50  virtual QModelIndex index (int row, int column, const QModelIndex &parent) const;
51  virtual int rowCount() const;
52  virtual int columnCount() const;
53  virtual QVariant data(const QModelIndex &index, int role) const;
54  virtual Qt::ItemFlags flags(Qt::ItemFlags defflags, const QModelIndex &index) const;
55  virtual bool setData(const QModelIndex &index, const QVariant &value, int role);
56 
57  int layerEntityIndex() const { return mLayerEntityIndex; }
58  ObjectTreeModel::Category layerEntityType() const { return mLayerEntityType; }
59 };
60 
61 }
62 
63 #endif // LAYERENTITY_H
Definition: benthosentity.cpp:27
virtual QModelIndex index(int row, int column, const QModelIndex &parent) const
Definition: layerentity.cpp:48
virtual ObjectTreeModel::Category getCategory() const
Definition: layerentity.h:45
LayerEntity(ObjectTreeModel::Category type, ObjectTreeModel *_model, int LayerEntity_idx=-1)
Definition: layerentity.cpp:30
virtual QModelIndex parent(const QModelIndex &parent) const
Definition: layerentity.cpp:42
Definition: objecttreeentity.h:32
virtual Qt::ItemFlags flags(Qt::ItemFlags defflags, const QModelIndex &index) const
Definition: layerentity.cpp:84
virtual ~LayerEntity()
Definition: layerentity.cpp:37
Definition: objecttreemodel.h:39
virtual int rowCount() const
Definition: layerentity.cpp:56
int layerEntityIndex() const
Definition: layerentity.h:57
std::pair< box, unsigned > value
Definition: diffusion.cpp:30
ObjectTreeModel::Category layerEntityType() const
Definition: layerentity.h:58
Category
Definition: objecttreemodel.h:44
virtual bool setData(const QModelIndex &index, const QVariant &value, int role)
Definition: layerentity.cpp:90
Generic Entity for layer management.
Definition: layerentity.h:33
virtual QVariant data(const QModelIndex &index, int role) const
Definition: layerentity.cpp:69
virtual int columnCount() const
Definition: layerentity.cpp:64