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

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. More...
 

Detailed Description

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

Definition at line 12 of file DigitizeStateEmpty.h.

Constructor & Destructor Documentation

◆ DigitizeStateEmpty()

DigitizeStateEmpty::DigitizeStateEmpty ( DigitizeStateContext context)

Single constructor.

Definition at line 14 of file DigitizeStateEmpty.cpp.

15  :
17 {

◆ ~DigitizeStateEmpty()

DigitizeStateEmpty::~DigitizeStateEmpty ( )
virtual

Definition at line 19 of file DigitizeStateEmpty.cpp.

21 {

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 23 of file DigitizeStateEmpty.cpp.

25 {
26  return "";

◆ 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 28 of file DigitizeStateEmpty.cpp.

31 {
32  LOG4CPP_INFO_S ((*mainCat)) << "DigitizeStateEmpty::begin";
33 
34  setCursor(cmdMediator);

◆ 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 37 of file DigitizeStateEmpty.cpp.

40 {
41  return false;

◆ cursor()

QCursor DigitizeStateEmpty::cursor ( CmdMediator cmdMediator) const
virtual

Returns the state-specific cursor shape.

Implements DigitizeStateAbstractBase.

Definition at line 43 of file DigitizeStateEmpty.cpp.

45 {
46  LOG4CPP_DEBUG_S ((*mainCat)) << "DigitizeStateEmpty::cursor";
47 
48  return QCursor (Qt::ArrowCursor);

◆ 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 50 of file DigitizeStateEmpty.cpp.

52 {
53  LOG4CPP_INFO_S ((*mainCat)) << "DigitizeStateEmpty::end";

◆ 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 55 of file DigitizeStateEmpty.cpp.

58 {
59  LOG4CPP_INFO_S ((*mainCat)) << "DigitizeStateEmpty::handleContextMenuEventAxis "
60  << " point=" << pointIdentifier.toLatin1 ().data ();

◆ 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 62 of file DigitizeStateEmpty.cpp.

65 {
66  LOG4CPP_INFO_S ((*mainCat)) << "DigitizeStateEmpty ::handleContextMenuEventGraph "
67  << "points=" << pointIdentifiers.join(",").toLatin1 ().data ();

◆ 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 69 of file DigitizeStateEmpty.cpp.

71 {
72  LOG4CPP_INFO_S ((*mainCat)) << "DigitizeStateEmpty::handleCurveChange";

◆ 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 74 of file DigitizeStateEmpty.cpp.

78 {
79  LOG4CPP_INFO_S ((*mainCat)) << "DigitizeStateEmpty::handleKeyPress"
80  << " key=" << QKeySequence (key).toString ().toLatin1 ().data ();

◆ 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 82 of file DigitizeStateEmpty.cpp.

85 {
86 // LOG4CPP_DEBUG_S ((*mainCat)) << "DigitizeStateEmpty::handleMouseMove";

◆ handleMousePress()

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

Handle a mouse press that was intercepted earlier.

Implements DigitizeStateAbstractBase.

Definition at line 88 of file DigitizeStateEmpty.cpp.

91 {
92  LOG4CPP_INFO_S ((*mainCat)) << "DigitizeStateEmpty::handleMousePress";

◆ handleMouseRelease()

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

Handle a mouse release that was intercepted earlier.

Implements DigitizeStateAbstractBase.

Definition at line 94 of file DigitizeStateEmpty.cpp.

97 {
98  LOG4CPP_INFO_S ((*mainCat)) << "DigitizeStateEmpty::handleMouseRelease";

◆ state()

QString DigitizeStateEmpty::state ( ) const
virtual

State name for debugging.

Implements DigitizeStateAbstractBase.

Definition at line 100 of file DigitizeStateEmpty.cpp.

102 {
103  return "DigitizeStateEmpty";

◆ updateAfterPointAddition()

void DigitizeStateEmpty::updateAfterPointAddition ( )
virtual

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

Implements DigitizeStateAbstractBase.

Definition at line 105 of file DigitizeStateEmpty.cpp.

107 {
108  LOG4CPP_INFO_S ((*mainCat)) << "DigitizeStateEmpty::updateAfterPointAddition";

◆ updateModelDigitizeCurve()

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

Update the digitize curve settings.

Implements DigitizeStateAbstractBase.

Definition at line 110 of file DigitizeStateEmpty.cpp.

113 {
114  LOG4CPP_INFO_S ((*mainCat)) << "DigitizeStateEmpty::updateModelDigitizeCurve";

◆ updateModelSegments()

void DigitizeStateEmpty::updateModelSegments ( const DocumentModelSegments modelSegments)
virtual

Update the segments given the new settings.

Implements DigitizeStateAbstractBase.

Definition at line 116 of file DigitizeStateEmpty.cpp.

118 {
119  LOG4CPP_INFO_S ((*mainCat)) << "DigitizeStateEmpty::updateModelSegments";

The documentation for this class was generated from the following files:
DigitizeStateAbstractBase::context
DigitizeStateContext & context()
Reference to the DigitizeStateContext that contains all the DigitizeStateAbstractBase subclasses,...
Definition: DigitizeStateAbstractBase.cpp:41
DigitizeStateEmpty::activeCurve
virtual QString activeCurve() const
Name of the active Curve. This can include AXIS_CURVE_NAME.
Definition: DigitizeStateEmpty.cpp:23
DigitizeStateContext::mainWindow
MainWindow & mainWindow()
Reference to the MainWindow, without const.
Definition: DigitizeStateContext.cpp:168
LOG4CPP_INFO_S
#define LOG4CPP_INFO_S(logger)
Definition: convenience.h:18
DigitizeStateAbstractBase::setCursor
void setCursor(CmdMediator *cmdMediator)
Update the cursor according to the current state.
Definition: DigitizeStateAbstractBase.cpp:51
mainCat
log4cpp::Category * mainCat
Definition: Logger.cpp:14
LOG4CPP_DEBUG_S
#define LOG4CPP_DEBUG_S(logger)
Definition: convenience.h:20
DigitizeStateAbstractBase
Base class for all digitizing states. This serves as an interface to DigitizeStateContext.
Definition: DigitizeStateAbstractBase.h:36
MainWindow::updateViewsOfSettings
void updateViewsOfSettings(const QString &activeCurve)
Update curve-specific view of settings. Private version gets active curve name from DigitizeStateCont...
Definition: MainWindow.cpp:3797