Tulip  4.0.0
Better Visualization Through Research
 All Classes Files Functions Variables Enumerations Enumerator Properties Groups Pages
NodeLinkDiagramComponent.h
1 /*
2  *
3  * This file is part of Tulip (www.tulip-software.org)
4  *
5  * Authors: David Auber and the Tulip development Team
6  * from LaBRI, University of Bordeaux 1 and Inria Bordeaux - Sud Ouest
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 _Tulip_NODELINKDIAGRAMCOMPONENT_H
22 #define _Tulip_NODELINKDIAGRAMCOMPONENT_H
23 
24 #include <tulip/GlMainView.h>
25 #include <tulip/GlCompositeHierarchyManager.h>
26 
27 class QDialog;
28 
29 namespace tlp {
30 class GlGrid;
31 
32 class TLP_QT_SCOPE NodeLinkDiagramComponent: public tlp::GlMainView {
33  Q_OBJECT
34 
35  tlp::GlGrid* _grid;
36  QDialog* _gridOptions;
37  GlCompositeHierarchyManager* manager;
38  bool _hasHulls;
39 
40  bool isNode;
41  unsigned int itemId;
42 
43  void registerTriggers();
44  void updateGrid();
45 public:
46  PLUGININFORMATIONS("Node Link Diagram view", "Tulip Team", "16/04/2008",
47  "The Node Link Diagram view is the standard representation of relational data, where entities are represented as nodes, and their relation as edges."
48  "This view allows you to change the glyph used to represent nodes (e.g. square, round, donut), as well as the shape of the arrows indicating the direction of the relationship.",
49  "1.0", "relational")
50 
51  NodeLinkDiagramComponent(const tlp::PluginContext* context = NULL);
52 
53  void setState(const tlp::DataSet &);
54  tlp::DataSet state() const;
55 
56 public slots:
57  void draw(PluginProgress *pluginProgress);
58  void requestChangeGraph(Graph *graph);
59 
60 protected slots:
61  void addRemoveItemToSelection();
62  void selectItem();
63  void deleteItem();
64  void goInsideItem();
65  void ungroupItem();
66  void setZOrdering(bool);
67  void showGridControl();
68  void fillContextMenu(QMenu *menu,const QPointF &point);
69 
70 protected:
71  void graphChanged(tlp::Graph *);
72 
73  void createScene(Graph *graph,DataSet dataSet);
74  DataSet sceneData() const;
75  void loadGraphOnScene(Graph *graph);
76  void useHulls(bool hasHulls);
77  bool hasHulls() const;
78 
79 };
80 }
81 
82 #endif /* NODELINKDIAGRAMCOMPONENT_H_ */
83 
84 
85 
86 
87 
88 
89 ///@endcond