Engauge Digitizer 2
|
Base class for all digitizing states. This serves as an interface to DigitizeStateContext. More...
#include <DigitizeStateAbstractBase.h>
Public Member Functions | |
DigitizeStateAbstractBase (DigitizeStateContext &context) | |
Single constructor. | |
virtual | ~DigitizeStateAbstractBase () |
virtual QString | activeCurve () const =0 |
Name of the active Curve. This can include AXIS_CURVE_NAME. | |
virtual void | begin (CmdMediator *cmdMediator, DigitizeState previousState)=0 |
Method that is called at the exact moment a state is entered. | |
virtual bool | canPaste (const Transformation &transformation, const QSize &viewSize) const =0 |
Return true if there is good data in the clipboard for pasting, and that is compatible with the current state. | |
DigitizeStateContext & | context () |
Reference to the DigitizeStateContext that contains all the DigitizeStateAbstractBase subclasses, without const. | |
const DigitizeStateContext & | context () const |
Reference to the DigitizeStateContext that contains all the DigitizeStateAbstractBase subclasses, without const. | |
virtual void | end ()=0 |
Method that is called at the exact moment a state is exited. Typically called just before begin for the next state. | |
virtual bool | guidelinesAreSelectable () const =0 |
Enable/disable guidelines according to state. | |
virtual void | handleContextMenuEventAxis (CmdMediator *cmdMediator, const QString &pointIdentifier)=0 |
Handle a right click, on an axis point, that was intercepted earlier. | |
virtual void | handleContextMenuEventGraph (CmdMediator *cmdMediator, const QStringList &pointIdentifiers)=0 |
Handle a right click, on a graph point, that was intercepted earlier. | |
virtual void | handleCurveChange (CmdMediator *cmdMediator)=0 |
Handle the selection of a new curve. At a minimum, DigitizeStateSegment will generate a new set of Segments. | |
virtual void | handleKeyPress (CmdMediator *cmdMediator, Qt::Key key, bool atLeastOneSelectedItem)=0 |
Handle a key press that was intercepted earlier. | |
virtual void | handleMouseMove (CmdMediator *cmdMediator, QPointF posScreen)=0 |
Handle a mouse move. This is part of an experiment to see if augmenting the cursor in Point Match mode is worthwhile. | |
virtual void | handleMousePress (CmdMediator *cmdMediator, QPointF pos)=0 |
Handle a mouse press that was intercepted earlier. | |
virtual void | handleMouseRelease (CmdMediator *cmdMediator, QPointF pos)=0 |
Handle a mouse release that was intercepted earlier. | |
void | setCursor (CmdMediator *cmdMediator) |
Update the cursor according to the current state. | |
virtual QString | state () const =0 |
State name for debugging. | |
virtual void | updateAfterPointAddition ()=0 |
Update graphics attributes after possible new points. This is useful for highlight opacity. | |
virtual void | updateModelDigitizeCurve (CmdMediator *cmdMediator, const DocumentModelDigitizeCurve &modelDigitizeCurve)=0 |
Update the digitize curve settings. | |
virtual void | updateModelSegments (const DocumentModelSegments &modelSegments)=0 |
Update the segments given the new settings. |
Protected Member Functions | |
bool | canPasteProtected (const Transformation &transformation, const QSize &viewSize) const |
Protected version of canPaste method. Some, but not all, leaf classes use this method. | |
virtual QCursor | cursor (CmdMediator *cmdMediator) const =0 |
Returns the state-specific cursor shape. | |
virtual void | handleKeyPressArrow (CmdMediator *cmdMediator, Qt::Key key, bool atLeastOneSelectedItem) |
If the key is an arrow (left, right, up, down) then move currently selected items. | |
QString | moveTextDown () const |
Display text for down arrow. | |
QString | moveTextLeft () const |
Display text for left arrow. | |
QString | moveTextRight () const |
Display text for right arrow. | |
QString | moveTextUp () const |
Display text for up arrow. |
Base class for all digitizing states. This serves as an interface to DigitizeStateContext.
Definition at line 24 of file DigitizeStateAbstractBase.h.
DigitizeStateAbstractBase::DigitizeStateAbstractBase | ( | DigitizeStateContext & | context | ) |
Single constructor.
Definition at line 34 of file DigitizeStateAbstractBase.cpp.
|
virtual |
Definition at line 39 of file DigitizeStateAbstractBase.cpp.
|
pure virtual |
Name of the active Curve. This can include AXIS_CURVE_NAME.
Implemented in DigitizeStateAxis, DigitizeStateColorPicker, DigitizeStateCurve, DigitizeStateEmpty, DigitizeStateGuideline, DigitizeStatePointMatch, DigitizeStateScale, DigitizeStateSegment, and DigitizeStateSelect.
|
pure virtual |
Method that is called at the exact moment a state is entered.
Typically called just after end for the previous state. The previousState value is used by DigitizeStateColorPicker to return to the previous state
Implemented in DigitizeStateAxis, DigitizeStateColorPicker, DigitizeStateCurve, DigitizeStateEmpty, DigitizeStateGuideline, DigitizeStatePointMatch, DigitizeStateScale, DigitizeStateSegment, and DigitizeStateSelect.
|
pure virtual |
Return true if there is good data in the clipboard for pasting, and that is compatible with the current state.
Implemented in DigitizeStateAxis, DigitizeStateColorPicker, DigitizeStateCurve, DigitizeStateEmpty, DigitizeStateGuideline, DigitizeStatePointMatch, DigitizeStateScale, DigitizeStateSegment, and DigitizeStateSelect.
|
protected |
Protected version of canPaste method. Some, but not all, leaf classes use this method.
Definition at line 43 of file DigitizeStateAbstractBase.cpp.
DigitizeStateContext & DigitizeStateAbstractBase::context | ( | ) |
Reference to the DigitizeStateContext that contains all the DigitizeStateAbstractBase subclasses, without const.
Definition at line 52 of file DigitizeStateAbstractBase.cpp.
const DigitizeStateContext & DigitizeStateAbstractBase::context | ( | ) | const |
Reference to the DigitizeStateContext that contains all the DigitizeStateAbstractBase subclasses, without const.
Definition at line 57 of file DigitizeStateAbstractBase.cpp.
|
protectedpure virtual |
Returns the state-specific cursor shape.
Implemented in DigitizeStateAxis, DigitizeStateColorPicker, DigitizeStateCurve, DigitizeStateEmpty, DigitizeStateGuideline, DigitizeStatePointMatch, DigitizeStateScale, DigitizeStateSegment, and DigitizeStateSelect.
|
pure virtual |
Method that is called at the exact moment a state is exited. Typically called just before begin for the next state.
Implemented in DigitizeStateAxis, DigitizeStateColorPicker, DigitizeStateCurve, DigitizeStateEmpty, DigitizeStateGuideline, DigitizeStatePointMatch, DigitizeStateScale, DigitizeStateSegment, and DigitizeStateSelect.
|
pure virtual |
Enable/disable guidelines according to state.
Implemented in DigitizeStateAxis, DigitizeStateColorPicker, DigitizeStateCurve, DigitizeStateEmpty, DigitizeStateGuideline, DigitizeStatePointMatch, DigitizeStateScale, DigitizeStateSegment, and DigitizeStateSelect.
|
pure virtual |
Handle a right click, on an axis point, that was intercepted earlier.
Implemented in DigitizeStateAxis, DigitizeStateColorPicker, DigitizeStateCurve, DigitizeStateEmpty, DigitizeStateGuideline, DigitizeStatePointMatch, DigitizeStateScale, DigitizeStateSegment, and DigitizeStateSelect.
|
pure virtual |
Handle a right click, on a graph point, that was intercepted earlier.
Implemented in DigitizeStateAxis, DigitizeStateColorPicker, DigitizeStateCurve, DigitizeStateEmpty, DigitizeStateGuideline, DigitizeStatePointMatch, DigitizeStateScale, DigitizeStateSegment, and DigitizeStateSelect.
|
pure virtual |
Handle the selection of a new curve. At a minimum, DigitizeStateSegment will generate a new set of Segments.
Implemented in DigitizeStateAxis, DigitizeStateColorPicker, DigitizeStateCurve, DigitizeStateEmpty, DigitizeStateGuideline, DigitizeStatePointMatch, DigitizeStateScale, DigitizeStateSegment, and DigitizeStateSelect.
|
pure virtual |
Handle a key press that was intercepted earlier.
Implemented in DigitizeStateAxis, DigitizeStateColorPicker, DigitizeStateCurve, DigitizeStateEmpty, DigitizeStateGuideline, DigitizeStatePointMatch, DigitizeStateScale, DigitizeStateSegment, and DigitizeStateSelect.
|
protectedvirtual |
If the key is an arrow (left, right, up, down) then move currently selected items.
Definition at line 62 of file DigitizeStateAbstractBase.cpp.
|
pure virtual |
Handle a mouse move. This is part of an experiment to see if augmenting the cursor in Point Match mode is worthwhile.
Implemented in DigitizeStateAxis, DigitizeStateColorPicker, DigitizeStateCurve, DigitizeStateEmpty, DigitizeStateGuideline, DigitizeStatePointMatch, DigitizeStateScale, DigitizeStateSegment, and DigitizeStateSelect.
|
pure virtual |
Handle a mouse press that was intercepted earlier.
Implemented in DigitizeStateAxis, DigitizeStateColorPicker, DigitizeStateCurve, DigitizeStateEmpty, DigitizeStateGuideline, DigitizeStatePointMatch, DigitizeStateScale, DigitizeStateSegment, and DigitizeStateSelect.
|
pure virtual |
Handle a mouse release that was intercepted earlier.
Implemented in DigitizeStateAxis, DigitizeStateColorPicker, DigitizeStateCurve, DigitizeStateEmpty, DigitizeStateGuideline, DigitizeStatePointMatch, DigitizeStateScale, DigitizeStateSegment, and DigitizeStateSelect.
|
protected |
Display text for down arrow.
Definition at line 125 of file DigitizeStateAbstractBase.cpp.
|
protected |
Display text for left arrow.
Definition at line 130 of file DigitizeStateAbstractBase.cpp.
|
protected |
Display text for right arrow.
Definition at line 135 of file DigitizeStateAbstractBase.cpp.
|
protected |
Display text for up arrow.
Definition at line 140 of file DigitizeStateAbstractBase.cpp.
void DigitizeStateAbstractBase::setCursor | ( | CmdMediator * | cmdMediator | ) |
Update the cursor according to the current state.
Definition at line 145 of file DigitizeStateAbstractBase.cpp.
|
pure virtual |
State name for debugging.
Implemented in DigitizeStateAxis, DigitizeStateColorPicker, DigitizeStateCurve, DigitizeStateEmpty, DigitizeStateGuideline, DigitizeStatePointMatch, DigitizeStateScale, DigitizeStateSegment, and DigitizeStateSelect.
|
pure virtual |
Update graphics attributes after possible new points. This is useful for highlight opacity.
Implemented in DigitizeStateAxis, DigitizeStateColorPicker, DigitizeStateCurve, DigitizeStateEmpty, DigitizeStateGuideline, DigitizeStatePointMatch, DigitizeStateScale, DigitizeStateSegment, and DigitizeStateSelect.
|
pure virtual |
Update the digitize curve settings.
Implemented in DigitizeStateAxis, DigitizeStateColorPicker, DigitizeStateCurve, DigitizeStateEmpty, DigitizeStateGuideline, DigitizeStatePointMatch, DigitizeStateScale, DigitizeStateSegment, and DigitizeStateSelect.
|
pure virtual |
Update the segments given the new settings.
Implemented in DigitizeStateAxis, DigitizeStateColorPicker, DigitizeStateCurve, DigitizeStateEmpty, DigitizeStateGuideline, DigitizeStatePointMatch, DigitizeStateScale, DigitizeStateSegment, and DigitizeStateSelect.