Tulip  4.6.0
Better Visualization Through Research
library/tulip-gui/include/tulip/QuickAccessBar.h
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 
00022 #ifndef QUICKACCESSBAR_H
00023 #define QUICKACCESSBAR_H
00024 
00025 #include <QWidget>
00026 
00027 #include <tulip/CaptionItem.h>
00028 #include <tulip/tulipconf.h>
00029 
00030 class QGraphicsItem;
00031 
00032 namespace Ui {
00033 class QuickAccessBar;
00034 }
00035 
00036 namespace tlp {
00037 class GlMainView;
00038 class GlGraphRenderingParameters;
00039 class GlGraphInputData;
00040 class GlScene;
00041 class TulipItemDelegate;
00042 class ColorProperty;
00043 class Color;
00044 class PropertyInterface;
00045 
00046 class TLP_QT_SCOPE QuickAccessBar : public QWidget {
00047   Q_OBJECT
00048 
00049   Ui::QuickAccessBar* _ui;
00050   QGraphicsItem *_quickAccessBarItem;
00051   GlMainView* _mainView;
00052   TulipItemDelegate* delegate;
00053   bool _resetting;
00054   GlGraphInputData* inputData() const;
00055   GlGraphRenderingParameters* renderingParameters() const;
00056   GlScene* scene() const;
00057   double _oldFontScale;
00058   double _oldNodeScale;
00059   bool _captionsInitialized;
00060   CaptionItem *_captions[4];
00061   void updateFontButtonStyle();
00062   void showHideCaption(CaptionItem::CaptionType captionType);
00063   void setAllValues(unsigned int eltType, PropertyInterface* prop);
00064   void setAllColorValues(unsigned int eltType, ColorProperty* prop,
00065                          const Color &color);
00066 
00067 public:
00068   explicit QuickAccessBar(QGraphicsItem *quickAccessBarItem,QWidget *parent = 0);
00069   virtual ~QuickAccessBar();
00070 
00071 public slots:
00072   void setGlMainView(tlp::GlMainView*);
00073   void reset();
00074 
00075   void setBackgroundColor(const QColor&);
00076   void setColorInterpolation(bool);
00077   void setLabelColor(const QColor&);
00078   void setNodeColor(const QColor&);
00079   void setNodeBorderColor(const QColor&);
00080   void setEdgeColor(const QColor&);
00081   void setEdgeBorderColor(const QColor&);
00082   void setNodeShape();
00083   void setEdgeShape();
00084   void setNodeSize();
00085   void setEdgeSize();
00086   void setSizeInterpolation(bool);
00087   void showHideNodesColorCaption();
00088   void showHideNodesSizeCaption();
00089   void showHideEdgesColorCaption();
00090   void showHideEdgesSizeCaption();
00091   void takeSnapshot();
00092   void setEdgesVisible(bool);
00093   void setLabelsVisible(bool);
00094   void setLabelsScaled(bool);
00095   void selectFont();
00096   void setNodeLabelPosition();
00097 
00098 signals:
00099   void settingsChanged();
00100 };
00101 }
00102 
00103 #endif // QUICKACCESSBAR_H
00104 ///@endcond
 All Classes Files Functions Variables Enumerations Enumerator Properties