Engauge Digitizer 2
Loading...
Searching...
No Matches
DigitizeStateSegment.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 DIGITIZE_STATE_SEGMENT_H
8#define DIGITIZE_STATE_SEGMENT_H
9
11#include <QList>
12#include <QObject>
13
14class Segment;
15
17class DigitizeStateSegment : public QObject, public DigitizeStateAbstractBase
18{
19 Q_OBJECT;
20
21public:
24 virtual ~DigitizeStateSegment();
25
26 virtual QString activeCurve () const;
27 virtual void begin(CmdMediator *cmdMediator,
28 DigitizeState previousState);
29 virtual bool canPaste (const Transformation &transformation,
30 const QSize &viewSize) const;
31 virtual QCursor cursor (CmdMediator *cmdMediator) const;
32 virtual void end();
33 virtual void handleContextMenuEventAxis (CmdMediator *cmdMediator,
34 const QString &pointIdentifier);
35 virtual void handleContextMenuEventGraph (CmdMediator *cmdMediator,
36 const QStringList &pointIdentifiers);
37 virtual void handleCurveChange(CmdMediator *cmdMediator);
38 virtual void handleKeyPress (CmdMediator *cmdMediator,
39 Qt::Key key,
40 bool atLeastOneSelectedItem);
41 virtual void handleMouseMove (CmdMediator *cmdMediator,
42 QPointF posScreen);
43 virtual void handleMousePress (CmdMediator *cmdMediator,
44 QPointF posScreen);
45 virtual void handleMouseRelease (CmdMediator *cmdMediator,
46 QPointF posScreen);
47 virtual QString state() const;
48 virtual void updateAfterPointAddition ();
49 virtual void updateModelDigitizeCurve (CmdMediator *cmdMediator,
50 const DocumentModelDigitizeCurve &modelDigitizeCurve);
51 virtual void updateModelSegments(const DocumentModelSegments &modelSegments);
52
53public slots:
55 void slotMouseClickOnSegment(QPointF);
56
57private:
59
60 // Identify which Segment owns the SegmentLine that was clicked on
61 Segment *segmentFromSegmentStart (const QPointF &posSegmentStart) const;
62
63 QList<Segment*> m_segments;
64 CmdMediator *m_cmdMediator;
65};
66
67#endif // DIGITIZE_STATE_SEGMENT_H
DigitizeState
Set of possible states of Digitize toolbar.
Command queue stack.
Definition CmdMediator.h:24
Base class for all digitizing states. This serves as an interface to DigitizeStateContext.
DigitizeStateContext & context()
Reference to the DigitizeStateContext that contains all the DigitizeStateAbstractBase subclasses,...
Container for all DigitizeStateAbstractBase subclasses. This functions as the context class in a stan...
Digitizing state for creating multiple Points along a highlighted segment.
virtual QString state() const
State name for debugging.
virtual void handleMousePress(CmdMediator *cmdMediator, QPointF posScreen)
Handle a mouse press that was intercepted earlier.
virtual void handleContextMenuEventAxis(CmdMediator *cmdMediator, const QString &pointIdentifier)
Handle a right click, on an axis point, that was intercepted earlier.
virtual void begin(CmdMediator *cmdMediator, DigitizeState previousState)
Method that is called at the exact moment a state is entered.
virtual QString activeCurve() const
Name of the active Curve. This can include AXIS_CURVE_NAME.
virtual void handleKeyPress(CmdMediator *cmdMediator, Qt::Key key, bool atLeastOneSelectedItem)
Handle a key press that was intercepted earlier.
void slotMouseClickOnSegment(QPointF)
Receive signal from Segment that has been clicked on. The CmdMediator from the begin method will be u...
virtual void handleCurveChange(CmdMediator *cmdMediator)
Handle the selection of a new curve. At a minimum, DigitizeStateSegment will generate a new set of Se...
virtual void handleContextMenuEventGraph(CmdMediator *cmdMediator, const QStringList &pointIdentifiers)
Handle a right click, on a graph point, that was intercepted earlier.
virtual QCursor cursor(CmdMediator *cmdMediator) const
Returns the state-specific cursor shape.
virtual void updateModelDigitizeCurve(CmdMediator *cmdMediator, const DocumentModelDigitizeCurve &modelDigitizeCurve)
Update the digitize curve settings.
virtual bool canPaste(const Transformation &transformation, const QSize &viewSize) const
Return true if there is good data in the clipboard for pasting, and that is compatible with the curre...
virtual void end()
Method that is called at the exact moment a state is exited. Typically called just before begin for t...
virtual void updateAfterPointAddition()
Update graphics attributes after possible new points. This is useful for highlight opacity.
virtual void updateModelSegments(const DocumentModelSegments &modelSegments)
Update the segments given the new settings.
virtual void handleMouseMove(CmdMediator *cmdMediator, QPointF posScreen)
Handle a mouse move. This is part of an experiment to see if augmenting the cursor in Point Match mod...
virtual void handleMouseRelease(CmdMediator *cmdMediator, QPointF posScreen)
Handle a mouse release that was intercepted earlier.
Model for DlgSettingsDigitizeCurve and CmdSettingsDigitizeCurve.
Model for DlgSettingsSegments and CmdSettingsSegments.
Selectable piecewise-defined line that follows a filtered line in the image.
Definition Segment.h:22
Affine transformation between screen and graph coordinates, based on digitized axis points.