Engauge Digitizer 2
Loading...
Searching...
No Matches
SegmentLine.h
Go to the documentation of this file.
1/******************************************************************************************************
2 * (C) 2014 markummitchell@github.com. This file is part of Engauge Digitizer, which is released *
3 * under GNU General Public License version 2 (GPLv2) or (at your option) any later version. See file *
4 * LICENSE or go to gnu.org/licenses for details. Distribution requires prior written permission. *
5 ******************************************************************************************************/
6
7#ifndef SEGMENT_LINE_H
8#define SEGMENT_LINE_H
9
11#include <QGraphicsLineItem>
12
13class QGraphicsScene;
14class Segment;
15
17class SegmentLine : public QObject, public QGraphicsLineItem
18{
19 Q_OBJECT;
20
21public:
23 SegmentLine(QGraphicsScene &scene,
24 const DocumentModelSegments &modelSegments,
27
29 virtual void hoverEnterEvent(QGraphicsSceneHoverEvent *event);
30
32 virtual void hoverLeaveEvent(QGraphicsSceneHoverEvent *event);
33
35 virtual void mousePressEvent(QGraphicsSceneMouseEvent *event);
36
38 Segment *segment() const;
39
41 void setHover (bool hover);
42
44 void updateModelSegment(const DocumentModelSegments &modelSegments);
45
46signals:
48 void signalHover (bool);
49
50private:
52
53 DocumentModelSegments m_modelSegments;
54 Segment *m_segment;
55};
56
57#endif // SEGMENT_LINE_H
Model for DlgSettingsSegments and CmdSettingsSegments.
virtual void mousePressEvent(QGraphicsSceneMouseEvent *event)
Create points along this curve.
void signalHover(bool)
Pass hover enter/leave events to Segment that owns this.
SegmentLine(QGraphicsScene &scene, const DocumentModelSegments &modelSegments, Segment *segment)
Single constructor.
void setHover(bool hover)
Apply/remove highlighting triggered by hover enter/leave.
Segment * segment() const
Segment that owns this line.
void updateModelSegment(const DocumentModelSegments &modelSegments)
Update this segment line with new settings.
virtual void hoverEnterEvent(QGraphicsSceneHoverEvent *event)
Highlight this and all other SegmentLines belonging to the same Segment upon hover enter.
virtual void hoverLeaveEvent(QGraphicsSceneHoverEvent *event)
Unset highlighting triggered by hover enter.
Selectable piecewise-defined line that follows a filtered line in the image.
Definition Segment.h:22