Engauge Digitizer  2
DigitizeStateSegment.h
1 #ifndef DIGITIZE_STATE_SEGMENT_H
2 #define DIGITIZE_STATE_SEGMENT_H
3 
4 #include "DigitizeStateAbstractBase.h"
5 #include <QList>
6 #include <QObject>
7 
8 class Segment;
9 
11 class DigitizeStateSegment : public QObject, public DigitizeStateAbstractBase
12 {
13  Q_OBJECT;
14 
15 public:
18  virtual ~DigitizeStateSegment();
19 
20  virtual QString activeCurve () const;
21  virtual void begin(DigitizeState previousState);
22  virtual QCursor cursor () const;
23  virtual void end();
24  virtual void handleCurveChange();
25  virtual void handleKeyPress (Qt::Key key,
26  bool atLeastOneSelectedItem);
27  virtual void handleMouseMove (QPointF posScreen);
28  virtual void handleMousePress (QPointF posScreen);
29  virtual void handleMouseRelease (QPointF posScreen);
30  virtual QString state() const;
31  virtual void updateModelDigitizeCurve (const DocumentModelDigitizeCurve &modelDigitizeCurve);
32  virtual void updateModelSegments(const DocumentModelSegments &modelSegments);
33 
34 public slots:
36  void slotMouseClickOnSegment(QPointF);
37 
38 private:
40 
41  // Identify which Segment owns the SegmentLine that was clicked on
42  Segment *segmentFromSegmentStart (const QPointF &posSegmentStart) const;
43 
44  QList<Segment*> m_segments;
45 };
46 
47 #endif // DIGITIZE_STATE_SEGMENT_H
virtual QString state() const
State name for debugging.
virtual void handleCurveChange()
Handle the selection of a new curve. At a minimum, DigitizeStateSegment will generate a new set of Se...
virtual void handleMouseRelease(QPointF posScreen)
Handle a mouse release that was intercepted earlier.
virtual void begin(DigitizeState previousState)
Method that is called at the exact moment a state is entered.
virtual void updateModelSegments(const DocumentModelSegments &modelSegments)
Update the segments given the new settings.
DigitizeStateContext & context()
Reference to the DigitizeStateContext that contains all the DigitizeStateAbstractBase subclasses...
virtual void handleMousePress(QPointF posScreen)
Handle a mouse press that was intercepted earlier.
Model for DlgSettingsDigitizeCurve and CmdSettingsDigitizeCurve.
virtual void handleMouseMove(QPointF posScreen)
Handle a mouse move. This is part of an experiment to see if augmenting the cursor in Point Match mod...
Container for all DigitizeStateAbstractBase subclasses. This functions as the context class in a stan...
virtual void end()
Method that is called at the exact moment a state is exited. Typically called just before begin for t...
virtual void updateModelDigitizeCurve(const DocumentModelDigitizeCurve &modelDigitizeCurve)
Update the digitize curve settings.
Selectable piecewise-defined line that follows a filtered line in the image.
Definition: Segment.h:15
void slotMouseClickOnSegment(QPointF)
Receive signal from Segment that has been clicked on.
Model for DlgSettingsSegments and CmdSettingsSegments.
virtual void handleKeyPress(Qt::Key key, bool atLeastOneSelectedItem)
Handle a key press that was intercepted earlier.
virtual QCursor cursor() const
Returns the state-specific cursor shape.
Base class for all digitizing states. This serves as an interface to DigitizeStateContext.
virtual QString activeCurve() const
Name of the active Curve. This can include AXIS_CURVE_NAME.
Digitizing state for creating multiple Points along a highlighted segment.