DISPLACE  1.0
A spatial model of fisheries to help sustainable fishing and maritime spatial planning
objecttreeentity.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 OBJECTTREEENTITY_H
22 #define OBJECTTREEENTITY_H
23 
24 #include <QModelIndex>
25 #include <objecttreemodel.h>
26 
27 class ObjectTreeModel;
28 class QMenu;
29 
30 namespace objecttree {
31 
33 {
34 protected:
36 
37 public:
39  virtual ~ObjectTreeEntity();
40 
41  virtual ObjectTreeModel::Category getCategory() const = 0;
42 
43  virtual QModelIndex parent (const QModelIndex &parent) const = 0;
44  virtual QModelIndex index (int row, int column, const QModelIndex &parent) const = 0;
45  virtual int rowCount() const = 0;
46  virtual int columnCount() const = 0;
47  virtual QVariant data(const QModelIndex &index, int role) const = 0;
48 
49  virtual Qt::ItemFlags flags(Qt::ItemFlags defFlags, const QModelIndex &index) const;
50  virtual bool setData(const QModelIndex &index, const QVariant &value, int role);
51 
52  virtual QMenu *contextMenu() const;
53 
54  virtual void modelChanged(int) {}
55 };
56 
57 }
58 
59 #endif // OBJECTTREEENTITY_H
virtual bool setData(const QModelIndex &index, const QVariant &value, int role)
Definition: objecttreeentity.cpp:42
Definition: benthosentity.cpp:27
virtual QModelIndex parent(const QModelIndex &parent) const =0
virtual QModelIndex index(int row, int column, const QModelIndex &parent) const =0
virtual QVariant data(const QModelIndex &index, int role) const =0
ObjectTreeEntity(ObjectTreeModel *_model)
Definition: objecttreeentity.cpp:25
virtual int columnCount() const =0
Definition: objecttreeentity.h:32
Definition: objecttreemodel.h:39
virtual ~ObjectTreeEntity()
Definition: objecttreeentity.cpp:30
virtual Qt::ItemFlags flags(Qt::ItemFlags defFlags, const QModelIndex &index) const
Definition: objecttreeentity.cpp:35
std::pair< box, unsigned > value
Definition: diffusion.cpp:30
Category
Definition: objecttreemodel.h:44
virtual QMenu * contextMenu() const
Definition: objecttreeentity.cpp:51
virtual ObjectTreeModel::Category getCategory() const =0
virtual void modelChanged(int)
Definition: objecttreeentity.h:54
ObjectTreeModel * model
Definition: objecttreeentity.h:35
virtual int rowCount() const =0