Tulip  5.2.0
Large graphs analysis and drawing
SceneLayersModel.h
1 /*
2  *
3  * This file is part of Tulip (http://tulip.labri.fr)
4  *
5  * Authors: David Auber and the Tulip development Team
6  * from LaBRI, University of Bordeaux
7  *
8  * Tulip is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU Lesser General Public License
10  * as published by the Free Software Foundation, either version 3
11  * of the License, or (at your option) any later version.
12  *
13  * Tulip is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
16  * See the GNU General Public License for more details.
17  *
18  */
19 ///@cond DOXYGEN_HIDDEN
20 
21 #ifndef SCENELAYERSMODEL_H
22 #define SCENELAYERSMODEL_H
23 
24 #include <tulip/tulipconf.h>
25 #include <tulip/Observable.h>
26 #include <tulip/TulipModel.h>
27 
28 /**
29  @brief Oh, you know, just a model for a GlScene entities
30  */
31 namespace tlp {
32 class GlScene;
33 
34 class TLP_QT_SCOPE SceneLayersModel : public TulipModel, tlp::Observable {
35  Q_OBJECT
36 
37  tlp::GlScene *_scene;
38 
39  QModelIndex graphCompositeIndex() const;
40 
41 public:
42  explicit SceneLayersModel(tlp::GlScene *scene, QObject *parent = nullptr);
43 
44  QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const override;
45  QModelIndex parent(const QModelIndex &child) const override;
46  int rowCount(const QModelIndex &parent = QModelIndex()) const override;
47  int columnCount(const QModelIndex &parent = QModelIndex()) const override;
48  QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
49  bool setData(const QModelIndex &index, const QVariant &value, int role) override;
50  Qt::ItemFlags flags(const QModelIndex &index) const override;
51  QVariant headerData(int section, Qt::Orientation orientation, int role) const override;
52 
53  void treatEvent(const tlp::Event &) override;
54 
55 signals:
56  void drawNeeded(tlp::GlScene *);
57 };
58 }
59 
60 #endif // SCENELAYERSMODEL_H
61 ///@endcond
Tulip scene class.
Definition: GlScene.h:160
Event is the base class for all events used in the Observation mechanism.
Definition: Observable.h:51
The Observable class is the base of Tulip&#39;s observation system.
Definition: Observable.h:141