marker.h 968 Bytes
Newer Older
1
2
3
4
5
6
7
#ifndef MARKER_H
#define MARKER_H

#include "globalDefinitions.h"

#include <QGraphicsEllipseItem>

8
#define MARKER_DIAMETER        20 * FROM_MILIMETERS_TO_UNITS
9
10
11
12

#define HIGHLIGHT_DIAMETER     20
#define HIGHLIGHT_WIDTH         5

13

14
15
16
class Marker : public QGraphicsEllipseItem
{
public:
17
    explicit Marker(QPointF p, QGraphicsItem *parent = 0);
18
    ~Marker();
19
20
21
22
23
24

    void setHighlighted(void);

    void clearHighlighted(void);

    bool getHighlighted(void);
25
26
27

    void setPosMarker(QPointF new_p);

28
private:
29
    // properties of marker itself
30
    qreal _diameter;
31
    qreal _x;                   // coordinates of top-left corner of marker
32
33
    qreal _y;

34
35
36
    qreal _center_x;              // coordinates of center of marker
    qreal _center_y;

37
38
39
40
    bool _highlighted;
    QGraphicsEllipseItem* _highlight_circle;

    qreal _highlight_diameter;
41
    qreal _x_highlight;         // coordinates of highlighting circle's top-left corner
42
43
44
45
46
    qreal _y_highlight;
};


#endif