21 #ifndef CAPTIONGRAPHICSSUBITEMS_H
22 #define CAPTIONGRAPHICSSUBITEMS_H
24 #include <QGraphicsPixmapItem>
31 class ConfigurationIconItem :
public QObject,
public QGraphicsPixmapItem {
37 ConfigurationIconItem() {
43 void configurationIconPressed();
47 void mousePressEvent( QGraphicsSceneMouseEvent *) {
48 emit configurationIconPressed();
52 class SelectionArrowItem :
public QObject,
public QGraphicsPathItem {
58 SelectionArrowItem(
float initRangePos,
const QPoint &initPos);
60 bool sceneEvent ( QEvent * event );
72 class SelectionTextItem :
public QGraphicsTextItem {
80 bool sceneEvent ( QEvent * event ) {
81 return ((SelectionArrowItem*)parentItem())->sceneEvent(event);
86 class MovableRectItem :
public QObject,
public QGraphicsRectItem {
92 MovableRectItem(
const QRectF &rect,
const QRectF &size,SelectionArrowItem *topCircle, SelectionArrowItem *bottomCircle);
94 void setInternalRect(
const QRectF &rect);
99 void moved(
float begin,
float end);
103 bool sceneEvent ( QEvent * event );
107 SelectionArrowItem *_topCircle;
108 SelectionArrowItem *_bottomCircle;
111 class MovablePathItem :
public QObject,
public QGraphicsPathItem {
117 MovablePathItem(
const QRectF &rect, QGraphicsPathItem *topPathItem, QGraphicsPathItem *bottomPathItem,SelectionArrowItem *topCircle, SelectionArrowItem *bottomCircle);
119 void setDataToPath(
const std::vector< std::pair< double,float > > &metricToSizeFilteredList,
double minMetric,
double maxMetric);
121 void setRect(
const QRectF &rect);
126 void moved(
float begin,
float end);
132 bool sceneEvent ( QEvent * event );
134 std::vector<std::pair <double, float> > _metricToSizeFilteredList;
139 QGraphicsPathItem *_topPathItem;
140 QGraphicsPathItem *_bottomPathItem;
141 SelectionArrowItem *_topCircle;
142 SelectionArrowItem *_bottomCircle;
145 class CaptionGraphicsBackgroundItem :
public QObject,
public QGraphicsRectItem {
151 CaptionGraphicsBackgroundItem(
const QRect &rect);
153 void generateColorCaption(
const QGradient &activeGradient,
const QGradient &hideGradient,
const std::string &propertyName,
double minValue,
double maxValue);
155 void generateSizeCaption(
const std::vector< std::pair< double,float > > &metricToSizeFilteredList,
const std::string &propertyName,
double minValue,
double maxValue);
159 void updateCaption();
161 void updateCaption(
float begin,
float end);
162 void configurationIconPressedSlot();
164 void activateInteractions();
165 void removeInteractions();
169 void filterChanged(
float begin,
float end);
170 void configurationIconPressed();
172 void interactionsActivated();
173 void interactionsRemoved();
177 void activateInteractions(
bool);
179 bool sceneEvent ( QEvent * event );
180 void updateSelectionText(
float begin,
float end);
182 bool _interactionsActivated;
185 QPoint _captionContentPos;
191 QGraphicsTextItem *_minTextItem;
192 QGraphicsTextItem *_maxTextItem;
193 QGraphicsTextItem *_min2TextItem;
194 QGraphicsTextItem *_max2TextItem;
195 QGraphicsLineItem *_min2LineItem;
196 QGraphicsLineItem *_max2LineItem;
197 QGraphicsRectItem *_captionRectBorder;
198 SelectionArrowItem *_rangeSelector1Item;
199 SelectionArrowItem *_rangeSelector2Item;
200 SelectionTextItem *_rangeSelector1TextItem;
201 SelectionTextItem *_rangeSelector2TextItem;
204 QGraphicsRectItem *_topCaptionRectItem;
205 MovableRectItem *_middleCaptionRectItem;
206 QGraphicsRectItem *_bottomCaptionRectItem;
210 MovablePathItem *_sizeCaptionPathItem;
211 QGraphicsPathItem *_topSizeCaptionPathItem;
212 QGraphicsPathItem *_bottomSizeCaptionPathItem;
219 #endif // CAPTIONGRAPHICSSUB_H