Engauge Digitizer  2
Public Slots | Public Member Functions | List of all members
TutorialStatePointMatch Class Reference

Point match panel discusses the matching of points in curves without lines. More...

#include <TutorialStatePointMatch.h>

Inheritance diagram for TutorialStatePointMatch:
Inheritance graph
Collaboration diagram for TutorialStatePointMatch:
Collaboration graph

Public Slots

void slotNext ()
 Slot called when next button is triggered. More...
 
void slotPrevious ()
 Slot called to return to previous panel. More...
 

Public Member Functions

 TutorialStatePointMatch (TutorialStateContext &context)
 Single constructor. More...
 
virtual void begin ()
 Transition into this state. More...
 
virtual void end ()
 Transition out of this state. More...
 
- Public Member Functions inherited from TutorialStateAbstractBase
 TutorialStateAbstractBase (TutorialStateContext &context)
 Single constructor. More...
 
virtual ~TutorialStateAbstractBase ()
 

Additional Inherited Members

- Protected Member Functions inherited from TutorialStateAbstractBase
int buttonMargin () const
 Buttons are placed up against bottom side, and left or right side, separated by this margin. More...
 
TutorialStateContextcontext ()
 Context class for the tutorial state machine. More...
 
QGraphicsPixmapItem * createPixmapItem (const QString &resource, const QPoint &pos)
 Factory method for pixmap items. More...
 
QGraphicsTextItem * createTextItem (const QString &text, const QPoint &pos)
 Factory method for text items. More...
 
QGraphicsTextItem * createTitle (const QString &text)
 Factory method for title items. More...
 

Detailed Description

Point match panel discusses the matching of points in curves without lines.

Definition at line 17 of file TutorialStatePointMatch.h.

Constructor & Destructor Documentation

◆ TutorialStatePointMatch()

TutorialStatePointMatch::TutorialStatePointMatch ( TutorialStateContext context)

Single constructor.

Definition at line 16 of file TutorialStatePointMatch.cpp.

17  :
19  m_title (nullptr),
20  m_background (nullptr),
21  m_text0 (nullptr),
22  m_text1 (nullptr),
23  m_text2 (nullptr),
24  m_text3 (nullptr),
25  m_previous (nullptr),
26  m_next (nullptr)
27 {
28  LOG4CPP_INFO_S ((*mainCat)) << "TutorialStatePointMatch::TutorialStatePointMatch";

Member Function Documentation

◆ begin()

void TutorialStatePointMatch::begin ( )
virtual

Transition into this state.

Implements TutorialStateAbstractBase.

Definition at line 30 of file TutorialStatePointMatch.cpp.

32 {
33  LOG4CPP_INFO_S ((*mainCat)) << "TutorialStatePointMatch::begin ()";
34 
35  context().tutorialDlg().scene().clear ();
36 
37  m_title = createTitle (tr ("Point Match"));
38  m_background = createPixmapItem (":/engauge/img/panel_point_match.png",
39  QPoint (0, 30));
40  m_text0 = createTextItem (tr ("In Point Match mode, you pick\n"
41  "one sample point, and Engauge\n"
42  "then finds all matching points.\n\n"
43  "Step 1 - Click on Point Match mode."),
44  QPoint (300, 40));
45  m_text1 = createTextItem (tr ("Step 2 - Select the curve the new\n"
46  "points will belong to."),
47  QPoint (320, 140));
48  m_text2 = createTextItem (tr ("Step 3 - Click on a typical point.\n"
49  "The circle turns green when it\n"
50  "contains what may be a point."),
51  QPoint (320, 200));
52  m_text3 = createTextItem (tr ("Step 4 - Engauge will show a\n"
53  "matched point with a yellow cross.\n"
54  "Press the Right Arrow key to accept\n"
55  "the matched point. Repeat this step\n"
56  "until there are no more points."),
57  QPoint (320, 270));
58 
59  QSize backgroundSize = context().tutorialDlg().backgroundSize();
60 
61  m_previous = new TutorialButton (tr ("Previous"),
62  context().tutorialDlg().scene());
63  m_previous->setGeometry (QPoint (buttonMargin (),
64  backgroundSize.height() - buttonMargin() - m_previous->size().height()));
65  connect (m_previous, SIGNAL (signalTriggered ()), this, SLOT (slotPrevious ()));
66 
67  m_next = new TutorialButton (tr ("Next"),
68  context().tutorialDlg().scene());
69  m_next->setGeometry (QPoint (backgroundSize.width () - buttonMargin () - m_next->size ().width (),
70  backgroundSize.height () - buttonMargin () - m_next->size ().height ()));
71  connect (m_next, SIGNAL (signalTriggered ()), this, SLOT (slotNext ()));

◆ end()

void TutorialStatePointMatch::end ( )
virtual

Transition out of this state.

Implements TutorialStateAbstractBase.

Definition at line 73 of file TutorialStatePointMatch.cpp.

75 {
76  LOG4CPP_INFO_S ((*mainCat)) << "TutorialStatePointMatch::end ()";
77 
78  // It is not safe to remove and deallocate items here since an active TutorialButton
79  // may be on the stack. So we clear the scene as the first step in the next begin()

◆ slotNext

void TutorialStatePointMatch::slotNext ( )
slot

Slot called when next button is triggered.

Definition at line 81 of file TutorialStatePointMatch.cpp.

83 {
84  LOG4CPP_INFO_S ((*mainCat)) << "TutorialStatePointMatch::slotNext";
85 

◆ slotPrevious

void TutorialStatePointMatch::slotPrevious ( )
slot

Slot called to return to previous panel.

Definition at line 88 of file TutorialStatePointMatch.cpp.

90 {
91  LOG4CPP_INFO_S ((*mainCat)) << "TutorialStatePointMatch::slotPrevious";
92 

The documentation for this class was generated from the following files:
TutorialStateAbstractBase::context
TutorialStateContext & context()
Context class for the tutorial state machine.
Definition: TutorialStateAbstractBase.cpp:31
TUTORIAL_STATE_CURVE_TYPE
Definition: TutorialStateAbstractBase.h:20
TutorialStateAbstractBase::createTextItem
QGraphicsTextItem * createTextItem(const QString &text, const QPoint &pos)
Factory method for text items.
Definition: TutorialStateAbstractBase.cpp:46
TutorialButton::setGeometry
void setGeometry(const QPoint &pos)
Set the position. This is called after creation so screen extent is available for positioning calcula...
Definition: TutorialButton.cpp:77
TutorialButton
Show a button with text for clicking ion. The button is implemented using layering of two graphics it...
Definition: TutorialButton.h:19
TutorialDlg::scene
QGraphicsScene & scene()
Single scene the covers the entire tutorial dialog.
Definition: TutorialDlg.cpp:76
TutorialStateAbstractBase
One state manages one panel of the tutorial.
Definition: TutorialStateAbstractBase.h:29
TutorialStateAbstractBase::buttonMargin
int buttonMargin() const
Buttons are placed up against bottom side, and left or right side, separated by this margin.
Definition: TutorialStateAbstractBase.cpp:26
LOG4CPP_INFO_S
#define LOG4CPP_INFO_S(logger)
Definition: convenience.h:18
TUTORIAL_STATE_CHECKLIST_WIZARD_POINTS
Definition: TutorialStateAbstractBase.h:17
TutorialStateContext::requestDelayedStateTransition
void requestDelayedStateTransition(TutorialState tutorialState)
Request a transition to the specified state from the current state.
Definition: TutorialStateContext.cpp:86
mainCat
log4cpp::Category * mainCat
Definition: Logger.cpp:14
TutorialStateAbstractBase::createTitle
QGraphicsTextItem * createTitle(const QString &text)
Factory method for title items.
Definition: TutorialStateAbstractBase.cpp:56
TutorialDlg::backgroundSize
QSize backgroundSize() const
Make geometry available for layout.
Definition: TutorialDlg.cpp:44
TutorialStateAbstractBase::createPixmapItem
QGraphicsPixmapItem * createPixmapItem(const QString &resource, const QPoint &pos)
Factory method for pixmap items.
Definition: TutorialStateAbstractBase.cpp:36
TutorialStateContext::tutorialDlg
TutorialDlg & tutorialDlg()
Access to tutorial dialogs and its scene.
Definition: TutorialStateContext.cpp:109
TutorialStatePointMatch::slotPrevious
void slotPrevious()
Slot called to return to previous panel.
Definition: TutorialStatePointMatch.cpp:88
TutorialStatePointMatch::slotNext
void slotNext()
Slot called when next button is triggered.
Definition: TutorialStatePointMatch.cpp:81
TutorialButton::size
QSize size() const
Size of this button.
Definition: TutorialButton.cpp:62