Engauge Digitizer 2
Loading...
Searching...
No Matches
DigitizeStateEmpty Class Reference

Digitizing state before a Document has been created. In this state, the cursor is Qt::ArrowCursor. More...

#include <DigitizeStateEmpty.h>

Inheritance diagram for DigitizeStateEmpty:
Inheritance graph
Collaboration diagram for DigitizeStateEmpty:
Collaboration graph

Public Member Functions

 DigitizeStateEmpty (DigitizeStateContext &context)
 Single constructor.
virtual ~DigitizeStateEmpty ()
virtual QString activeCurve () const
 Name of the active Curve. This can include AXIS_CURVE_NAME.
virtual void begin (CmdMediator *cmdMediator, DigitizeState previousState)
 Method that is called at the exact moment a state is entered.
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 current state.
virtual QCursor cursor (CmdMediator *cmdMediator) const
 Returns the state-specific cursor shape.
virtual void end ()
 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
 Enable/disable guidelines according to state.
virtual void handleCurveChange (CmdMediator *cmdMediator)
 Handle the selection of a new curve. At a minimum, DigitizeStateSegment will generate a new set of Segments.
virtual void handleContextMenuEventAxis (CmdMediator *cmdMediator, const QString &pointIdentifier)
 Handle a right click, on an axis point, that was intercepted earlier.
virtual void handleContextMenuEventGraph (CmdMediator *cmdMediator, const QStringList &pointIdentifiers)
 Handle a right click, on a graph point, that was intercepted earlier.
virtual void handleKeyPress (CmdMediator *cmdMediator, Qt::Key key, bool atLeastOneSelectedItem)
 Handle a key press that was intercepted earlier.
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 mode is worthwhile.
virtual void handleMousePress (CmdMediator *cmdMediator, QPointF posScreen)
 Handle a mouse press that was intercepted earlier.
virtual void handleMouseRelease (CmdMediator *cmdMediator, QPointF posScreen)
 Handle a mouse release that was intercepted earlier.
virtual QString state () const
 State name for debugging.
virtual void updateAfterPointAddition ()
 Update graphics attributes after possible new points. This is useful for highlight opacity.
virtual void updateModelDigitizeCurve (CmdMediator *cmdMediator, const DocumentModelDigitizeCurve &modelDigitizeCurve)
 Update the digitize curve settings.
virtual void updateModelSegments (const DocumentModelSegments &modelSegments)
 Update the segments given the new settings.
Public Member Functions inherited from DigitizeStateAbstractBase
 DigitizeStateAbstractBase (DigitizeStateContext &context)
 Single constructor.
virtual ~DigitizeStateAbstractBase ()
DigitizeStateContextcontext ()
 Reference to the DigitizeStateContext that contains all the DigitizeStateAbstractBase subclasses, without const.
const DigitizeStateContextcontext () const
 Reference to the DigitizeStateContext that contains all the DigitizeStateAbstractBase subclasses, without const.
void setCursor (CmdMediator *cmdMediator)
 Update the cursor according to the current state.

Additional Inherited Members

Protected Member Functions inherited from DigitizeStateAbstractBase
bool canPasteProtected (const Transformation &transformation, const QSize &viewSize) const
 Protected version of canPaste method. Some, but not all, leaf classes use this method.
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.

Detailed Description

Digitizing state before a Document has been created. In this state, the cursor is Qt::ArrowCursor.

Definition at line 15 of file DigitizeStateEmpty.h.

Constructor & Destructor Documentation

◆ DigitizeStateEmpty()

DigitizeStateEmpty::DigitizeStateEmpty ( DigitizeStateContext & context)

Single constructor.

Definition at line 15 of file DigitizeStateEmpty.cpp.

15 :
17{
18}
DigitizeStateAbstractBase(DigitizeStateContext &context)
Single constructor.
DigitizeStateContext & context()
Reference to the DigitizeStateContext that contains all the DigitizeStateAbstractBase subclasses,...

◆ ~DigitizeStateEmpty()

DigitizeStateEmpty::~DigitizeStateEmpty ( )
virtual

Definition at line 20 of file DigitizeStateEmpty.cpp.

21{
22}

Member Function Documentation

◆ activeCurve()

QString DigitizeStateEmpty::activeCurve ( ) const
virtual

Name of the active Curve. This can include AXIS_CURVE_NAME.

Implements DigitizeStateAbstractBase.

Definition at line 24 of file DigitizeStateEmpty.cpp.

25{
26 return "";
27}

◆ begin()

void DigitizeStateEmpty::begin ( CmdMediator * cmdMediator,
DigitizeState previousState )
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

Implements DigitizeStateAbstractBase.

Definition at line 29 of file DigitizeStateEmpty.cpp.

31{
32 LOG4CPP_INFO_S ((*mainCat)) << "DigitizeStateEmpty::begin";
33
34 setCursor(cmdMediator);
37}
log4cpp::Category * mainCat
Definition Logger.cpp:14
void setCursor(CmdMediator *cmdMediator)
Update the cursor according to the current state.
MainWindow & mainWindow()
Reference to the MainWindow, without const.
virtual QString activeCurve() const
Name of the active Curve. This can include AXIS_CURVE_NAME.
void updateViewsOfSettings(const QString &activeCurve)
Update curve-specific view of settings. Private version gets active curve name from DigitizeStateCont...
void handleGuidelinesActiveChange(bool active)
Handle Guidelines active status toggle.
#define LOG4CPP_INFO_S(logger)
Definition convenience.h:18

◆ canPaste()

bool DigitizeStateEmpty::canPaste ( const Transformation & transformation,
const QSize & viewSize ) const
virtual

Return true if there is good data in the clipboard for pasting, and that is compatible with the current state.

Implements DigitizeStateAbstractBase.

Definition at line 39 of file DigitizeStateEmpty.cpp.

41{
42 return false;
43}

◆ cursor()

QCursor DigitizeStateEmpty::cursor ( CmdMediator * cmdMediator) const
virtual

Returns the state-specific cursor shape.

Implements DigitizeStateAbstractBase.

Definition at line 45 of file DigitizeStateEmpty.cpp.

46{
47 LOG4CPP_DEBUG_S ((*mainCat)) << "DigitizeStateEmpty::cursor";
48
49 return QCursor (Qt::ArrowCursor);
50}
#define LOG4CPP_DEBUG_S(logger)
Definition convenience.h:20

◆ end()

void DigitizeStateEmpty::end ( )
virtual

Method that is called at the exact moment a state is exited. Typically called just before begin for the next state.

Implements DigitizeStateAbstractBase.

Definition at line 52 of file DigitizeStateEmpty.cpp.

53{
54 LOG4CPP_INFO_S ((*mainCat)) << "DigitizeStateEmpty::end";
55}

◆ guidelinesAreSelectable()

bool DigitizeStateEmpty::guidelinesAreSelectable ( ) const
virtual

Enable/disable guidelines according to state.

Implements DigitizeStateAbstractBase.

Definition at line 57 of file DigitizeStateEmpty.cpp.

58{
59 return false;
60}

◆ handleContextMenuEventAxis()

void DigitizeStateEmpty::handleContextMenuEventAxis ( CmdMediator * cmdMediator,
const QString & pointIdentifier )
virtual

Handle a right click, on an axis point, that was intercepted earlier.

Implements DigitizeStateAbstractBase.

Definition at line 62 of file DigitizeStateEmpty.cpp.

64{
65 LOG4CPP_INFO_S ((*mainCat)) << "DigitizeStateEmpty::handleContextMenuEventAxis "
66 << " point=" << pointIdentifier.toLatin1 ().data ();
67}

◆ handleContextMenuEventGraph()

void DigitizeStateEmpty::handleContextMenuEventGraph ( CmdMediator * cmdMediator,
const QStringList & pointIdentifiers )
virtual

Handle a right click, on a graph point, that was intercepted earlier.

Implements DigitizeStateAbstractBase.

Definition at line 69 of file DigitizeStateEmpty.cpp.

71{
72 LOG4CPP_INFO_S ((*mainCat)) << "DigitizeStateEmpty ::handleContextMenuEventGraph "
73 << "points=" << pointIdentifiers.join(",").toLatin1 ().data ();
74}

◆ handleCurveChange()

void DigitizeStateEmpty::handleCurveChange ( CmdMediator * cmdMediator)
virtual

Handle the selection of a new curve. At a minimum, DigitizeStateSegment will generate a new set of Segments.

Implements DigitizeStateAbstractBase.

Definition at line 76 of file DigitizeStateEmpty.cpp.

77{
78 LOG4CPP_INFO_S ((*mainCat)) << "DigitizeStateEmpty::handleCurveChange";
79}

◆ handleKeyPress()

void DigitizeStateEmpty::handleKeyPress ( CmdMediator * cmdMediator,
Qt::Key key,
bool atLeastOneSelectedItem )
virtual

Handle a key press that was intercepted earlier.

Implements DigitizeStateAbstractBase.

Definition at line 81 of file DigitizeStateEmpty.cpp.

84{
85 LOG4CPP_INFO_S ((*mainCat)) << "DigitizeStateEmpty::handleKeyPress"
86 << " key=" << QKeySequence (key).toString ().toLatin1 ().data ();
87}

◆ handleMouseMove()

void DigitizeStateEmpty::handleMouseMove ( CmdMediator * cmdMediator,
QPointF posScreen )
virtual

Handle a mouse move. This is part of an experiment to see if augmenting the cursor in Point Match mode is worthwhile.

Implements DigitizeStateAbstractBase.

Definition at line 89 of file DigitizeStateEmpty.cpp.

91{
92// LOG4CPP_DEBUG_S ((*mainCat)) << "DigitizeStateEmpty::handleMouseMove";
93}

◆ handleMousePress()

void DigitizeStateEmpty::handleMousePress ( CmdMediator * cmdMediator,
QPointF pos )
virtual

Handle a mouse press that was intercepted earlier.

Implements DigitizeStateAbstractBase.

Definition at line 95 of file DigitizeStateEmpty.cpp.

97{
98 LOG4CPP_INFO_S ((*mainCat)) << "DigitizeStateEmpty::handleMousePress";
99}

◆ handleMouseRelease()

void DigitizeStateEmpty::handleMouseRelease ( CmdMediator * cmdMediator,
QPointF pos )
virtual

Handle a mouse release that was intercepted earlier.

Implements DigitizeStateAbstractBase.

Definition at line 101 of file DigitizeStateEmpty.cpp.

103{
104 LOG4CPP_INFO_S ((*mainCat)) << "DigitizeStateEmpty::handleMouseRelease";
105}

◆ state()

QString DigitizeStateEmpty::state ( ) const
virtual

State name for debugging.

Implements DigitizeStateAbstractBase.

Definition at line 107 of file DigitizeStateEmpty.cpp.

108{
109 return "DigitizeStateEmpty";
110}

◆ updateAfterPointAddition()

void DigitizeStateEmpty::updateAfterPointAddition ( )
virtual

Update graphics attributes after possible new points. This is useful for highlight opacity.

Implements DigitizeStateAbstractBase.

Definition at line 112 of file DigitizeStateEmpty.cpp.

113{
114 LOG4CPP_INFO_S ((*mainCat)) << "DigitizeStateEmpty::updateAfterPointAddition";
115}

◆ updateModelDigitizeCurve()

void DigitizeStateEmpty::updateModelDigitizeCurve ( CmdMediator * cmdMediator,
const DocumentModelDigitizeCurve & modelDigitizeCurve )
virtual

Update the digitize curve settings.

Implements DigitizeStateAbstractBase.

Definition at line 117 of file DigitizeStateEmpty.cpp.

119{
120 LOG4CPP_INFO_S ((*mainCat)) << "DigitizeStateEmpty::updateModelDigitizeCurve";
121}

◆ updateModelSegments()

void DigitizeStateEmpty::updateModelSegments ( const DocumentModelSegments & modelSegments)
virtual

Update the segments given the new settings.

Implements DigitizeStateAbstractBase.

Definition at line 123 of file DigitizeStateEmpty.cpp.

124{
125 LOG4CPP_INFO_S ((*mainCat)) << "DigitizeStateEmpty::updateModelSegments";
126}

The documentation for this class was generated from the following files: