Tulip  4.0.0
Better Visualization Through Research
 All Classes 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 #include <tulip/tulipconf.h>
27 #include <tulip/ScrollPopupButton.h>
28 #include <tulip/CaptionItem.h>
29 
30 namespace Ui {
31 class QuickAccessBar;
32 }
33 
34 namespace tlp {
35 class GlMainView;
36 class GlGraphRenderingParameters;
37 class GlGraphInputData;
38 class GlScene;
39 
40 class QuickAccessBar : public QWidget {
41  Q_OBJECT
42 
43  Ui::QuickAccessBar* _ui;
44  QGraphicsItem *_quickAccessBarItem;
45  tlp::GlMainView* _mainView;
46  bool _resetting;
47  tlp::GlGraphInputData* inputData() const;
48  tlp::GlGraphRenderingParameters* renderingParameters() const;
49  tlp::GlScene* scene() const;
50  double _oldFontScale;
51  double _oldNodeScale;
52  bool _captionsInitialized;
53  CaptionItem *_captions[4];
54  void updateFontButtonStyle();
55  void showHideCaption(CaptionItem::CaptionType captionType);
56 
57 public:
58  explicit QuickAccessBar(QGraphicsItem *quickAccessBarItem,QWidget *parent = 0);
59  virtual ~QuickAccessBar();
60 
61 public slots:
62  void setGlMainView(tlp::GlMainView*);
63  void reset();
64 
65  void setBackgroundColor(const QColor&);
66  void setColorInterpolation(bool);
67  void setLabelColor(const QColor&);
68  void setNodeColor(const QColor&);
69  void showHideNodesColorCaption();
70  void showHideNodesSizeCaption();
71  void showHideEdgesColorCaption();
72  void showHideEdgesSizeCaption();
73  void takeSnapshot();
74  void setEdgesVisible(bool);
75  void setLabelsVisible(bool);
76  void selectFont();
77 
78 signals:
79  void settingsChanged();
80 };
81 }
82 
83 #endif // QUICKACCESSBAR_H
84 ///@endcond