forked from BioroboticsLab/biotracker_sampletracker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTrackedElementView.h
More file actions
47 lines (35 loc) · 1.22 KB
/
Copy pathTrackedElementView.h
File metadata and controls
47 lines (35 loc) · 1.22 KB
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
#ifndef TRACKEDELEMENTVIEW_H
#define TRACKEDELEMENTVIEW_H
#include "Interfaces/IView/IViewTrackedComponent.h"
/**
* This class is an example of how a TrackedElementView could be visualized.
* This class inherits from the IViewTrackedComponent class and is therefor part of the Composite Pattern.
*/
class TrackedElementView : public IViewTrackedComponent
{
Q_OBJECT
public:
TrackedElementView(QGraphicsItem *parent = 0, IController *controller = 0, IModel *model = 0);
// QGraphicsItem interface
public:
QRectF boundingRect() const override;
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override;
// IViewTrackedComponent interface
public Q_SLOTS:
void getNotified() override;
void rcvDimensionUpdate(int x, int y);
public Q_SIGNAL:
void emitUpdateCornersChanged(int id, int relX, int relY);
private:
QRectF m_boundingRect;
QGraphicsItem *_selectorBase;
QPointF _selectorRecStart;
QPointF _selectorRecEnd;
bool _showSelectorRec;
std::shared_ptr<QGraphicsRectItem> ri;
// QGraphicsItem interface
protected:
bool sceneEventFilter(QGraphicsItem * watched, QEvent * event) override;
bool eventFilter(QObject * target, QEvent * event) override;
};
#endif // TRACKEDELEMENTVIEW_H