Tulip  4.10.0
Better Visualization Through Research
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
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 protected:
50  GlMainView* _mainView;
51  GlScene* scene() const;
52 
53 public:
54  QuickAccessBar(QWidget *parent=0);
55 
56 public slots:
57  void setGlMainView(tlp::GlMainView*);
58  virtual void reset()=0;
59 
60 signals:
61  void settingsChanged();
62 };
63 
64 class TLP_QT_SCOPE QuickAccessBarImpl : public QuickAccessBar {
65  Q_OBJECT
66 
67  Ui::QuickAccessBar* _ui;
68  QGraphicsItem *_quickAccessBarItem;
69 
70  TulipItemDelegate* delegate;
71  bool _resetting;
72  GlGraphInputData* inputData() const;
73  GlGraphRenderingParameters* renderingParameters() const;
74  double _oldFontScale;
75  double _oldNodeScale;
76  bool _captionsInitialized;
77  CaptionItem *_captions[4];
78  void updateFontButtonStyle();
79  void showHideCaption(CaptionItem::CaptionType captionType);
80  void setAllValues(unsigned int eltType, PropertyInterface* prop);
81  void setAllColorValues(unsigned int eltType, ColorProperty* prop,
82  const Color &color);
83 
84 public:
85  explicit QuickAccessBarImpl(QGraphicsItem *quickAccessBarItem,QWidget *parent = 0);
86  virtual ~QuickAccessBarImpl();
87 
88 public slots:
89  void reset();
90 
91  void setBackgroundColor(const QColor&);
92  void setColorInterpolation(bool);
93  void setLabelColor(const QColor&);
94  void setNodeColor(const QColor&);
95  void setNodeBorderColor(const QColor&);
96  void setEdgeColor(const QColor&);
97  void setEdgeBorderColor(const QColor&);
98  void setNodeShape();
99  void setEdgeShape();
100  void setNodeSize();
101  void setEdgeSize();
102  void setSizeInterpolation(bool);
103  void showHideNodesColorCaption();
104  void showHideNodesSizeCaption();
105  void showHideEdgesColorCaption();
106  void showHideEdgesSizeCaption();
107  void takeSnapshot();
108  void setEdgesVisible(bool);
109  void setLabelsVisible(bool);
110  void setLabelsScaled(bool);
111  void selectFont();
112  void setNodeLabelPosition();
113 };
114 }
115 
116 #endif // QUICKACCESSBAR_H
117 ///@endcond
An abstract view that displays a GlMainWidget as its central widget.
Definition: GlMainView.h:62