![]() |
Tulip
4.6.0
Better Visualization Through Research
|
00001 /* 00002 * 00003 * This file is part of Tulip (www.tulip-software.org) 00004 * 00005 * Authors: David Auber and the Tulip development Team 00006 * from LaBRI, University of Bordeaux 00007 * 00008 * Tulip is free software; you can redistribute it and/or modify 00009 * it under the terms of the GNU Lesser General Public License 00010 * as published by the Free Software Foundation, either version 3 00011 * of the License, or (at your option) any later version. 00012 * 00013 * Tulip is distributed in the hope that it will be useful, 00014 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 00016 * See the GNU General Public License for more details. 00017 * 00018 */ 00019 ///@cond DOXYGEN_HIDDEN 00020 00021 #ifndef _Tulip_NODELINKDIAGRAMCOMPONENT_H 00022 #define _Tulip_NODELINKDIAGRAMCOMPONENT_H 00023 00024 #include <tulip/GlMainView.h> 00025 #include <tulip/Camera.h> 00026 00027 namespace Ui { 00028 class GridOptionsWidget; 00029 } 00030 00031 class QDialog; 00032 00033 namespace tlp { 00034 class GlGrid; 00035 class GlCompositeHierarchyManager; 00036 00037 class TLP_QT_SCOPE NodeLinkDiagramComponent: public tlp::GlMainView { 00038 Q_OBJECT 00039 00040 GlGrid* _grid; 00041 QDialog* _gridOptions; 00042 GlCompositeHierarchyManager* manager; 00043 bool _hasHulls; 00044 00045 void registerTriggers(); 00046 void updateGrid(); 00047 00048 bool _tooltips; 00049 00050 Ui::GridOptionsWidget* grid_ui; 00051 00052 public: 00053 static const std::string viewName; 00054 PLUGININFORMATION(NodeLinkDiagramComponent::viewName, "Tulip Team", "16/04/2008", 00055 "The Node Link Diagram view is the standard representation of relational data, where entities are represented as nodes, and their relation as edges.<br>" 00056 "This view allows you to change the glyph used to represent nodes (e.g. square, round, cross, ...), as well as the shape of the arrows indicating the direction of the relationship.", 00057 "1.0", "relational") 00058 00059 NodeLinkDiagramComponent(const tlp::PluginContext* context = NULL); 00060 virtual ~NodeLinkDiagramComponent(); 00061 std::string icon() const { 00062 return ":/tulip/gui/icons/32/node_link_diagram_view.png"; 00063 } 00064 void setState(const tlp::DataSet &); 00065 tlp::DataSet state() const; 00066 00067 public slots: 00068 void draw(); 00069 void requestChangeGraph(Graph *graph); 00070 const Camera& goInsideItem(node meta); 00071 00072 protected slots: 00073 void addRemoveItemToSelection(); 00074 void selectItem(); 00075 void deleteItem(); 00076 void editColor(); 00077 void editLabel(); 00078 void editShape(); 00079 void editSize(); 00080 void goInsideItem(); 00081 void ungroupItem(); 00082 void setZOrdering(bool); 00083 void showGridControl(); 00084 void fillContextMenu(QMenu *menu,const QPointF &point); 00085 void displayToolTips(bool display); 00086 00087 protected: 00088 bool isNode; 00089 unsigned int itemId; 00090 00091 void graphChanged(tlp::Graph *); 00092 00093 void createScene(Graph *graph,DataSet dataSet); 00094 DataSet sceneData() const; 00095 void loadGraphOnScene(Graph *graph); 00096 void useHulls(bool hasHulls); 00097 bool hasHulls() const; 00098 void setupWidget(); 00099 bool eventFilter(QObject *,QEvent *e); 00100 void editValue(PropertyInterface* pi); 00101 }; 00102 } 00103 00104 #endif /* NODELINKDIAGRAMCOMPONENT_H_ */ 00105 00106 00107 00108 00109 00110 00111 ///@endcond