21 #ifndef CAPTIONGRAPHICSSUBITEMS_H
22 #define CAPTIONGRAPHICSSUBITEMS_H
25 #include <QtGui/QGraphicsItemGroup>
26 #include <QtGui/QComboBox>
27 #include <QtOpenGL/QGLFramebufferObject>
28 #include <tulip/View.h>
29 #include <tulip/Color.h>
32 #include <QtGui/QGraphicsSceneMouseEvent>
36 class ConfigurationIconItem :
public QObject,
public QGraphicsPixmapItem {
42 ConfigurationIconItem() {
48 void configurationIconPressed();
52 void mousePressEvent( QGraphicsSceneMouseEvent *) {
53 emit configurationIconPressed();
57 class SelectionArrowItem :
public QObject,
public QGraphicsPathItem {
63 SelectionArrowItem(
float initRangePos,
const QPoint &initPos);
65 bool sceneEvent ( QEvent * event );
77 class SelectionTextItem :
public QGraphicsTextItem {
89 bool sceneEvent ( QEvent * event ) {
90 return ((SelectionArrowItem*)parentItem())->sceneEvent(event);
95 class MovableRectItem :
public QObject,
public QGraphicsRectItem {
101 MovableRectItem(
const QRectF &rect,
const QRectF &size,SelectionArrowItem *topCircle, SelectionArrowItem *bottomCircle);
103 void setInternalRect(
const QRectF &rect);
108 void moved(
float begin,
float end);
112 bool sceneEvent ( QEvent * event );
116 SelectionArrowItem *_topCircle;
117 SelectionArrowItem *_bottomCircle;
120 class MovablePathItem :
public QObject,
public QGraphicsPathItem {
126 MovablePathItem(
const QRectF &rect, QGraphicsPathItem *topPathItem, QGraphicsPathItem *bottomPathItem,SelectionArrowItem *topCircle, SelectionArrowItem *bottomCircle);
128 void setDataToPath(
const std::vector< std::pair< double,float > > &metricToSizeFilteredList,
double minMetric,
double maxMetric);
130 void setRect(
const QRectF &rect);
135 void moved(
float begin,
float end);
141 bool sceneEvent ( QEvent * event );
143 std::vector<std::pair <double, float> > _metricToSizeFilteredList;
148 QGraphicsPathItem *_topPathItem;
149 QGraphicsPathItem *_bottomPathItem;
150 SelectionArrowItem *_topCircle;
151 SelectionArrowItem *_bottomCircle;
154 class CaptionGraphicsBackgroundItem :
public QObject,
public QGraphicsRectItem {
160 CaptionGraphicsBackgroundItem(
const QRect &rect);
162 void generateColorCaption(
const QGradient &activeGradient,
const QGradient &hideGradient,
const std::string &propertyName,
double minValue,
double maxValue);
164 void generateSizeCaption(
const std::vector< std::pair< double,float > > &metricToSizeFilteredList,
const std::string &propertyName,
double minValue,
double maxValue);
168 void updateCaption();
170 void updateCaption(
float begin,
float end);
171 void configurationIconPressedSlot();
173 void activateInteractions();
174 void removeInteractions();
178 void filterChanged(
float begin,
float end);
179 void configurationIconPressed();
181 void interactionsActivated();
182 void interactionsRemoved();
186 void activateInteractions(
bool);
188 bool sceneEvent ( QEvent * event );
189 void updateSelectionText(
float begin,
float end);
191 bool _interactionsActivated;
194 QPoint _captionContentPos;
200 QGraphicsTextItem *_minTextItem;
201 QGraphicsTextItem *_maxTextItem;
202 QGraphicsTextItem *_min2TextItem;
203 QGraphicsTextItem *_max2TextItem;
204 QGraphicsLineItem *_min2LineItem;
205 QGraphicsLineItem *_max2LineItem;
206 QGraphicsRectItem *_captionRectBorder;
207 SelectionArrowItem *_rangeSelector1Item;
208 SelectionArrowItem *_rangeSelector2Item;
209 SelectionTextItem *_rangeSelector1TextItem;
210 SelectionTextItem *_rangeSelector2TextItem;
213 QGraphicsRectItem *_topCaptionRectItem;
214 MovableRectItem *_middleCaptionRectItem;
215 QGraphicsRectItem *_bottomCaptionRectItem;
219 MovablePathItem *_sizeCaptionPathItem;
220 QGraphicsPathItem *_topSizeCaptionPathItem;
221 QGraphicsPathItem *_bottomSizeCaptionPathItem;
228 #endif // CAPTIONGRAPHICSSUB_H