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

Context class for tutorial state machine. More...

#include <TutorialStateContext.h>

Inheritance diagram for TutorialStateContext:
Inheritance graph
Collaboration diagram for TutorialStateContext:
Collaboration graph

Public Member Functions

 TutorialStateContext (TutorialDlg &tutorialDlg)
 Single constructor.
 ~TutorialStateContext ()
 Destructor deallocates memory.
void requestDelayedStateTransition (TutorialState tutorialState)
 Request a transition to the specified state from the current state.
void requestImmediateStateTransition (TutorialState tutorialState)
 Request a transition to the specified state from the current state.
TutorialDlgtutorialDlg ()
 Access to tutorial dialogs and its scene.

Detailed Description

Context class for tutorial state machine.

Each state represents one panel in the tutorial Tutorial assumptions:

  1. Dealing with multiple curves is postponed until the end of the tutorial.

Definition at line 20 of file TutorialStateContext.h.

Constructor & Destructor Documentation

◆ TutorialStateContext()

TutorialStateContext::TutorialStateContext ( TutorialDlg & tutorialDlg)

Single constructor.

Definition at line 25 of file TutorialStateContext.cpp.

25 :
26 m_tutorialDlg (tutorialDlg)
27{
28 createStates ();
29 createTimer ();
30}
TutorialDlg & tutorialDlg()
Access to tutorial dialogs and its scene.

◆ ~TutorialStateContext()

TutorialStateContext::~TutorialStateContext ( )

Destructor deallocates memory.

Definition at line 32 of file TutorialStateContext.cpp.

33{
34 qDeleteAll (m_states);
35}

Member Function Documentation

◆ requestDelayedStateTransition()

void TutorialStateContext::requestDelayedStateTransition ( TutorialState tutorialState)

Request a transition to the specified state from the current state.

A timer is used. This assumes TutorialStateContext is NOT on the stack - probably since an external event (mouse click, ...) resulted in a callback to the current state

Definition at line 86 of file TutorialStateContext.cpp.

87{
88 LOG4CPP_INFO_S ((*mainCat)) << "TutorialStateContext::requestDelayedStateTransition";
89
90 m_requestedState = tutorialState;
91
92 m_timer->start ();
93}
log4cpp::Category * mainCat
Definition Logger.cpp:14
#define LOG4CPP_INFO_S(logger)
Definition convenience.h:18

◆ requestImmediateStateTransition()

void TutorialStateContext::requestImmediateStateTransition ( TutorialState tutorialState)

Request a transition to the specified state from the current state.

The transition is delayed until the current state is off the stack to prevent stack corruption errors. This assumes TutorialStateContext is on the stack to finish the transition after execution returns from the state

Definition at line 95 of file TutorialStateContext.cpp.

96{
97 LOG4CPP_INFO_S ((*mainCat)) << "TutorialStateContext::requestImmediateStateTransition";
98
99 m_requestedState = tutorialState;
100}

◆ tutorialDlg()

TutorialDlg & TutorialStateContext::tutorialDlg ( )

Access to tutorial dialogs and its scene.

Definition at line 109 of file TutorialStateContext.cpp.

110{
111 return m_tutorialDlg;
112}

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