Tulip  4.3.0
Better Visualization Through Research
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Properties Groups Pages
QuickAccessBar.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 
22 #ifndef QUICKACCESSBAR_H
23 #define QUICKACCESSBAR_H
24 
25 #include <QWidget>
26 
27 #include <tulip/CaptionItem.h>
28 #include <tulip/tulipconf.h>
29 
30 class QGraphicsItem;
31 
32 namespace Ui {
33 class QuickAccessBar;
34 }
35 
36 namespace tlp {
37 class GlMainView;
38 class GlGraphRenderingParameters;
39 class GlGraphInputData;
40 class GlScene;
41 class TulipItemDelegate;
42 class ColorProperty;
43 class Color;
44 class PropertyInterface;
45 
46 class TLP_QT_SCOPE QuickAccessBar : public QWidget {
47  Q_OBJECT
48 
49  Ui::QuickAccessBar* _ui;
50  QGraphicsItem *_quickAccessBarItem;
51  GlMainView* _mainView;
52  TulipItemDelegate* delegate;
53  bool _resetting;
54  GlGraphInputData* inputData() const;
55  GlGraphRenderingParameters* renderingParameters() const;
56  GlScene* scene() const;
57  double _oldFontScale;
58  double _oldNodeScale;
59  bool _captionsInitialized;
60  CaptionItem *_captions[4];
61  void updateFontButtonStyle();
62  void showHideCaption(CaptionItem::CaptionType captionType);
63  void setAllValues(unsigned int eltType, PropertyInterface* prop);
64  void setAllColorValues(unsigned int eltType, ColorProperty* prop,
65  const Color &color);
66 
67 public:
68  explicit QuickAccessBar(QGraphicsItem *quickAccessBarItem,QWidget *parent = 0);
69  virtual ~QuickAccessBar();
70 
71 public slots:
72  void setGlMainView(tlp::GlMainView*);
73  void reset();
74 
75  void setBackgroundColor(const QColor&);
76  void setColorInterpolation(bool);
77  void setLabelColor(const QColor&);
78  void setNodeColor(const QColor&);
79  void setNodeBorderColor(const QColor&);
80  void setEdgeColor(const QColor&);
81  void setEdgeBorderColor(const QColor&);
82  void setNodeShape();
83  void setEdgeShape();
84  void setNodeSize();
85  void setEdgeSize();
86  void setSizeInterpolation(bool);
87  void showHideNodesColorCaption();
88  void showHideNodesSizeCaption();
89  void showHideEdgesColorCaption();
90  void showHideEdgesSizeCaption();
91  void takeSnapshot();
92  void setEdgesVisible(bool);
93  void setLabelsVisible(bool);
94  void setLabelsScaled(bool);
95  void selectFont();
96  void setNodeLabelPosition();
97 
98 signals:
99  void settingsChanged();
100 };
101 }
102 
103 #endif // QUICKACCESSBAR_H
104 ///@endcond