/usr/include/tulip/CaptionGraphicsSubItems.h is in libtulip-dev 4.4.0dfsg2-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 | /*
*
* This file is part of Tulip (www.tulip-software.org)
*
* Authors: David Auber and the Tulip development Team
* from LaBRI, University of Bordeaux 1 and Inria Bordeaux - Sud Ouest
*
* Tulip is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation, either version 3
* of the License, or (at your option) any later version.
*
* Tulip is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*
*/
///@cond DOXYGEN_HIDDEN
#ifndef CAPTIONGRAPHICSSUBITEMS_H
#define CAPTIONGRAPHICSSUBITEMS_H
#include <QGraphicsPixmapItem>
#include <QObject>
class QGradient;
namespace tlp {
class ConfigurationIconItem : public QObject, public QGraphicsPixmapItem {
Q_OBJECT
public :
ConfigurationIconItem() {
}
signals :
void configurationIconPressed();
protected :
void mousePressEvent( QGraphicsSceneMouseEvent *) {
emit configurationIconPressed();
}
};
class SelectionArrowItem : public QObject, public QGraphicsPathItem {
Q_OBJECT
public :
SelectionArrowItem(float initRangePos,const QPoint &initPos);
bool sceneEvent ( QEvent * event );
signals :
void circleMoved();
protected :
int yPos;
QPoint initPos;
};
class SelectionTextItem : public QGraphicsTextItem {
public :
SelectionTextItem();
protected :
bool sceneEvent ( QEvent * event ) {
return ((SelectionArrowItem*)parentItem())->sceneEvent(event);
}
};
class MovableRectItem : public QObject, public QGraphicsRectItem {
Q_OBJECT
public :
MovableRectItem(const QRectF &rect,const QRectF &size,SelectionArrowItem *topCircle, SelectionArrowItem *bottomCircle);
void setInternalRect(const QRectF &rect);
signals :
// begin and end in 0,1 range
void moved(float begin, float end);
protected :
bool sceneEvent ( QEvent * event );
QRectF _currentRect;
QPoint _initPos;
SelectionArrowItem *_topCircle;
SelectionArrowItem *_bottomCircle;
};
class MovablePathItem : public QObject, public QGraphicsPathItem {
Q_OBJECT
public :
MovablePathItem(const QRectF &rect, QGraphicsPathItem *topPathItem, QGraphicsPathItem *bottomPathItem,SelectionArrowItem *topCircle, SelectionArrowItem *bottomCircle);
void setDataToPath(const std::vector< std::pair< double,float > > &metricToSizeFilteredList, double minMetric, double maxMetric);
void setRect(const QRectF &rect);
signals :
// begin and end in 0,1 range
void moved(float begin, float end);
protected :
void updatePath();
bool sceneEvent ( QEvent * event );
std::vector<std::pair <double, float> > _metricToSizeFilteredList;
double _minMetric;
double _maxMetric;
QRectF _currentRect;
QGraphicsPathItem *_topPathItem;
QGraphicsPathItem *_bottomPathItem;
SelectionArrowItem *_topCircle;
SelectionArrowItem *_bottomCircle;
};
class CaptionGraphicsBackgroundItem : public QObject, public QGraphicsRectItem {
Q_OBJECT
public :
CaptionGraphicsBackgroundItem(const QRect &rect);
void generateColorCaption(const QGradient &activeGradient, const QGradient &hideGradient, const std::string &propertyName, double minValue, double maxValue);
void generateSizeCaption(const std::vector< std::pair< double,float > > &metricToSizeFilteredList, const std::string &propertyName, double minValue, double maxValue);
public slots :
void updateCaption();
// begin and end in 0,1 range
void updateCaption(float begin, float end);
void configurationIconPressedSlot();
void activateInteractions();
void removeInteractions();
signals :
void filterChanged(float begin, float end);
void configurationIconPressed();
void interactionsActivated();
void interactionsRemoved();
protected :
void activateInteractions(bool);
bool sceneEvent ( QEvent * event );
void updateSelectionText(float begin, float end);
bool _interactionsActivated;
float _beginBackup;
float _endBackup;
QPoint _captionContentPos;
double _minValue;
double _maxValue;
// Global Items
QGraphicsTextItem *_minTextItem;
QGraphicsTextItem *_maxTextItem;
QGraphicsTextItem *_min2TextItem;
QGraphicsTextItem *_max2TextItem;
QGraphicsLineItem *_min2LineItem;
QGraphicsLineItem *_max2LineItem;
QGraphicsRectItem *_captionRectBorder;
SelectionArrowItem *_rangeSelector1Item;
SelectionArrowItem *_rangeSelector2Item;
SelectionTextItem *_rangeSelector1TextItem;
SelectionTextItem *_rangeSelector2TextItem;
// Color caption Items
QGraphicsRectItem *_topCaptionRectItem;
MovableRectItem *_middleCaptionRectItem;
QGraphicsRectItem *_bottomCaptionRectItem;
// Size caption Items
//MovableRectItem *_selectionSizeRectItem;
MovablePathItem *_sizeCaptionPathItem;
QGraphicsPathItem *_topSizeCaptionPathItem;
QGraphicsPathItem *_bottomSizeCaptionPathItem;
};
}
#endif // CAPTIONGRAPHICSSUB_H
///@endcond
|