Tulip  4.2.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 <QtGui/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 
42 class TLP_QT_SCOPE QuickAccessBar : public QWidget {
43  Q_OBJECT
44 
45  Ui::QuickAccessBar* _ui;
46  QGraphicsItem *_quickAccessBarItem;
47  tlp::GlMainView* _mainView;
48  bool _resetting;
49  tlp::GlGraphInputData* inputData() const;
50  tlp::GlGraphRenderingParameters* renderingParameters() const;
51  tlp::GlScene* scene() const;
52  double _oldFontScale;
53  double _oldNodeScale;
54  bool _captionsInitialized;
55  CaptionItem *_captions[4];
56  void updateFontButtonStyle();
57  void showHideCaption(CaptionItem::CaptionType captionType);
58 
59 public:
60  explicit QuickAccessBar(QGraphicsItem *quickAccessBarItem,QWidget *parent = 0);
61  virtual ~QuickAccessBar();
62 
63 public slots:
64  void setGlMainView(tlp::GlMainView*);
65  void reset();
66 
67  void setBackgroundColor(const QColor&);
68  void setColorInterpolation(bool);
69  void setLabelColor(const QColor&);
70  void setNodeColor(const QColor&);
71  void showHideNodesColorCaption();
72  void showHideNodesSizeCaption();
73  void showHideEdgesColorCaption();
74  void showHideEdgesSizeCaption();
75  void takeSnapshot();
76  void setEdgesVisible(bool);
77  void setLabelsVisible(bool);
78  void selectFont();
79 
80 signals:
81  void settingsChanged();
82 };
83 }
84 
85 #endif // QUICKACCESSBAR_H
86 ///@endcond