21 #ifndef CAPTIONGRAPHICSSUBITEMS_H 22 #define CAPTIONGRAPHICSSUBITEMS_H 24 #include <QGraphicsPixmapItem> 31 class ConfigurationIconItem :
public QObject,
public QGraphicsPixmapItem {
36 ConfigurationIconItem() {}
40 void configurationIconPressed();
43 void mousePressEvent(QGraphicsSceneMouseEvent *)
override {
44 emit configurationIconPressed();
48 class SelectionArrowItem :
public QObject,
public QGraphicsPathItem {
53 SelectionArrowItem(
float initRangePos,
const QPoint &initPos);
55 bool sceneEvent(QEvent *event)
override;
66 class SelectionTextItem :
public QGraphicsTextItem {
72 bool sceneEvent(QEvent *event)
override {
73 return static_cast<SelectionArrowItem *
>(parentItem())->sceneEvent(event);
77 class MovableRectItem :
public QObject,
public QGraphicsRectItem {
82 MovableRectItem(
const QRectF &rect,
const QRectF &size, SelectionArrowItem *topCircle,
83 SelectionArrowItem *bottomCircle);
85 void setInternalRect(
const QRectF &rect);
90 void moved(
float begin,
float end);
93 bool sceneEvent(QEvent *event)
override;
97 SelectionArrowItem *_topCircle;
98 SelectionArrowItem *_bottomCircle;
101 class MovablePathItem :
public QObject,
public QGraphicsPathItem {
106 MovablePathItem(
const QRectF &rect, QGraphicsPathItem *topPathItem,
107 QGraphicsPathItem *bottomPathItem, SelectionArrowItem *topCircle,
108 SelectionArrowItem *bottomCircle);
110 void setDataToPath(
const std::vector<std::pair<double, float>> &metricToSizeFilteredList,
111 double minMetric,
double maxMetric);
113 void setRect(
const QRectF &rect);
118 void moved(
float begin,
float end);
123 bool sceneEvent(QEvent *event)
override;
125 std::vector<std::pair<double, float>> _metricToSizeFilteredList;
130 QGraphicsPathItem *_topPathItem;
131 QGraphicsPathItem *_bottomPathItem;
132 SelectionArrowItem *_topCircle;
133 SelectionArrowItem *_bottomCircle;
136 class CaptionGraphicsBackgroundItem :
public QObject,
public QGraphicsRectItem {
141 CaptionGraphicsBackgroundItem(
const QRect &rect);
143 void generateColorCaption(
const QGradient &activeGradient,
const QGradient &hideGradient,
144 const std::string &propertyName,
double minValue,
double maxValue);
146 void generateSizeCaption(
const std::vector<std::pair<double, float>> &metricToSizeFilteredList,
147 const std::string &propertyName,
double minValue,
double maxValue);
151 void updateCaption();
153 void updateCaption(
float begin,
float end);
154 void configurationIconPressedSlot();
156 void activateInteractions();
157 void removeInteractions();
161 void filterChanged(
float begin,
float end);
162 void configurationIconPressed();
164 void interactionsActivated();
165 void interactionsRemoved();
168 void activateInteractions(
bool);
170 bool sceneEvent(QEvent *event)
override;
171 void updateSelectionText(
float begin,
float end);
173 bool _interactionsActivated;
176 QPoint _captionContentPos;
182 QGraphicsTextItem *_minTextItem;
183 QGraphicsTextItem *_maxTextItem;
184 QGraphicsTextItem *_min2TextItem;
185 QGraphicsTextItem *_max2TextItem;
186 QGraphicsLineItem *_min2LineItem;
187 QGraphicsLineItem *_max2LineItem;
188 QGraphicsRectItem *_captionRectBorder;
189 SelectionArrowItem *_rangeSelector1Item;
190 SelectionArrowItem *_rangeSelector2Item;
191 SelectionTextItem *_rangeSelector1TextItem;
192 SelectionTextItem *_rangeSelector2TextItem;
195 QGraphicsRectItem *_topCaptionRectItem;
196 MovableRectItem *_middleCaptionRectItem;
197 QGraphicsRectItem *_bottomCaptionRectItem;
201 MovablePathItem *_sizeCaptionPathItem;
202 QGraphicsPathItem *_topSizeCaptionPathItem;
203 QGraphicsPathItem *_bottomSizeCaptionPathItem;
207 #endif // CAPTIONGRAPHICSSUB_H