![]() |
Tulip
4.6.0
Better Visualization Through Research
|
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 #ifndef CAPTIONGRAPHICSITEM_H 00022 #define CAPTIONGRAPHICSITEM_H 00023 00024 #include <QObject> 00025 00026 #include <vector> 00027 #include <string> 00028 00029 class QGradient; 00030 class QGraphicsProxyWidget; 00031 class QGraphicsSimpleTextItem; 00032 class QPushButton; 00033 00034 namespace tlp { 00035 00036 class GlMainView; 00037 class View; 00038 class CaptionGraphicsBackgroundItem; 00039 00040 class CaptionGraphicsItem : public QObject { 00041 00042 Q_OBJECT 00043 00044 public: 00045 00046 CaptionGraphicsItem(View *view); 00047 ~CaptionGraphicsItem(); 00048 00049 void setType(unsigned int type); 00050 00051 void loadConfiguration(); 00052 00053 void generateColorCaption(const QGradient &activeGradient, const QGradient &hideGradient, const std::string &propertyName, double minValue, double maxValue); 00054 00055 void generateSizeCaption(const std::vector< std::pair <double,float> > &metricToSizeFilteredList,const std::string &propertyName, double minValue, double maxValue); 00056 00057 CaptionGraphicsBackgroundItem *getCaptionItem() const { 00058 return _rondedRectItem; 00059 } 00060 00061 std::string usedProperty(); 00062 00063 signals : 00064 00065 void filterChanged(float begin, float end); 00066 void selectedPropertyChanged(std::string propertyName); 00067 00068 protected slots : 00069 00070 void filterChangedSlot(float begin, float end); 00071 void selectPropertyButtonClicked(); 00072 void propertySelectedSlot(); 00073 00074 private : 00075 QString wrappedPropName(const QString& originalName) const; 00076 00077 void constructConfigWidget(); 00078 00079 View *_view; 00080 00081 CaptionGraphicsBackgroundItem *_rondedRectItem; 00082 00083 QGraphicsProxyWidget *_confPropertySelectionItem; 00084 QGraphicsSimpleTextItem *_nodesEdgesTextItem; 00085 QPushButton* _confPropertySelectionWidget; 00086 }; 00087 00088 } 00089 00090 #endif // CAPTIONGRAPHICSITEM_H 00091 ///@endcond