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

Curve selection panel discusses how to select a curve, and perform setup on the selected curve. More...

#include <TutorialStateCurveSelection.h>

Inheritance diagram for TutorialStateCurveSelection:
Inheritance graph
Collaboration diagram for TutorialStateCurveSelection:
Collaboration graph

Public Slots

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

Public Member Functions

 TutorialStateCurveSelection (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

Curve selection panel discusses how to select a curve, and perform setup on the selected curve.

Definition at line 17 of file TutorialStateCurveSelection.h.

Constructor & Destructor Documentation

◆ TutorialStateCurveSelection()

TutorialStateCurveSelection::TutorialStateCurveSelection ( TutorialStateContext context)

Single constructor.

Definition at line 17 of file TutorialStateCurveSelection.cpp.

18  :
20  m_title (nullptr),
21  m_background (nullptr),
22  m_text0 (nullptr),
23  m_text1 (nullptr),
24  m_text2 (nullptr),
25  m_text3 (nullptr),
26  m_previous (nullptr),
27  m_colorFilter (nullptr),
28  m_next (nullptr)
29 {
30  LOG4CPP_INFO_S ((*mainCat)) << "TutorialStateCurveSelection::TutorialStateCurveSelection";

Member Function Documentation

◆ begin()

void TutorialStateCurveSelection::begin ( )
virtual

Transition into this state.

Implements TutorialStateAbstractBase.

Definition at line 32 of file TutorialStateCurveSelection.cpp.

34 {
35  LOG4CPP_INFO_S ((*mainCat)) << "TutorialStateCurveSelection::begin ()";
36 
37  context().tutorialDlg().scene().clear ();
38 
39  m_title = createTitle ("Curve Selection");
40  m_background = createPixmapItem (":/engauge/img/panel_curve_selection.png",
41  QPoint (0, 30));
42  m_text0 = createTextItem (tr ("After the axis points have been created, a\n"
43  "curve is selected to receive curve points.\n"
44  "Step 1 - click on Curve, Point Match, Color\n"
45  "Picker or Segment Fill buttons."),
46  QPoint (250, 40));
47  m_text1 = createTextItem (tr ("Step 2 - Select the desired curve name. If\n"
48  "that curve name has not been created yet,\n"
49  "use the menu option Settings / Curve Names\n"
50  "to create it."),
51  QPoint (250, 120));
52  m_text2 = createTextItem (tr ("Step 3 - Change the background from the\n"
53  "original image to the filtered image\n"
54  "produced for the current curve, using the\n"
55  "menu option View / Background / Filtered\n"
56  "Image. This filtering enables the powerful\n"
57  "automated algorithms discussed later in\n"
58  "the tutorial."),
59  QPoint (250, 200));
60  m_text3 = createTextItem (tr ("If the current curve is no longer visible\n"
61  "in the filtered image, then change the\n"
62  "current Color Filter settings. In the figure,\n"
63  "the orange points have disappeared."),
64  QPoint (250, 330));
65 
66  QSize backgroundSize = context().tutorialDlg().backgroundSize();
67 
68  m_previous = new TutorialButton (tr ("Previous"),
69  context().tutorialDlg().scene());
70  m_previous->setGeometry (QPoint (buttonMargin (),
71  backgroundSize.height() - buttonMargin() - m_previous->size().height()));
72  connect (m_previous, SIGNAL (signalTriggered ()), this, SLOT (slotPrevious ()));
73 
74  m_colorFilter = new TutorialButton (tr ("Color Filter Settings"),
75  context().tutorialDlg().scene());
76  m_colorFilter->setGeometry (QPoint (qFloor (backgroundSize.width () / 2.0 - m_colorFilter->size ().width () / 2),
77  qFloor (backgroundSize.height () - buttonMargin () - m_colorFilter->size ().height ())));
78  connect (m_colorFilter, SIGNAL (signalTriggered ()), this, SLOT (slotColorFilter ()));
79 
80  m_next = new TutorialButton (tr ("Next"),
81  context().tutorialDlg().scene());
82  m_next->setGeometry (QPoint (backgroundSize.width () - buttonMargin () - m_next->size ().width (),
83  backgroundSize.height () - buttonMargin () - m_next->size ().height ()));
84  connect (m_next, SIGNAL (signalTriggered ()), this, SLOT (slotNext ()));

◆ end()

void TutorialStateCurveSelection::end ( )
virtual

Transition out of this state.

Implements TutorialStateAbstractBase.

Definition at line 86 of file TutorialStateCurveSelection.cpp.

88 {
89  LOG4CPP_INFO_S ((*mainCat)) << "TutorialStateCurveSelection::end ()";
90 
91  // It is not safe to remove and deallocate items here since an active TutorialButton
92  // may be on the stack. So we clear the scene as the first step in the next begin()

◆ slotColorFilter

void TutorialStateCurveSelection::slotColorFilter ( )
slot

Slot called when settings button is triggered.

Definition at line 94 of file TutorialStateCurveSelection.cpp.

96 {
97  LOG4CPP_INFO_S ((*mainCat)) << "TutorialStateCurveSelection::slotColorFilter";
98 

◆ slotNext

void TutorialStateCurveSelection::slotNext ( )
slot

Slot called when next button is triggered.

Definition at line 101 of file TutorialStateCurveSelection.cpp.

103 {
104  LOG4CPP_INFO_S ((*mainCat)) << "TutorialStateCurveSelection::slotNextCurves";
105 

◆ slotPrevious

void TutorialStateCurveSelection::slotPrevious ( )
slot

Slot called to return to previous panel.

Definition at line 108 of file TutorialStateCurveSelection.cpp.

110 {
111  LOG4CPP_INFO_S ((*mainCat)) << "TutorialStateCurveSelection::slotPrevious";
112 

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
TUTORIAL_STATE_AXIS_POINTS
Definition: TutorialStateAbstractBase.h:15
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
TutorialStateContext::requestDelayedStateTransition
void requestDelayedStateTransition(TutorialState tutorialState)
Request a transition to the specified state from the current state.
Definition: TutorialStateContext.cpp:86
TutorialStateCurveSelection::slotNext
void slotNext()
Slot called when next button is triggered.
Definition: TutorialStateCurveSelection.cpp:101
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
TutorialStateCurveSelection::slotPrevious
void slotPrevious()
Slot called to return to previous panel.
Definition: TutorialStateCurveSelection.cpp:108
TutorialStateContext::tutorialDlg
TutorialDlg & tutorialDlg()
Access to tutorial dialogs and its scene.
Definition: TutorialStateContext.cpp:109
TutorialButton::size
QSize size() const
Size of this button.
Definition: TutorialButton.cpp:62
TUTORIAL_STATE_COLOR_FILTER
Definition: TutorialStateAbstractBase.h:18
TutorialStateCurveSelection::slotColorFilter
void slotColorFilter()
Slot called when settings button is triggered.
Definition: TutorialStateCurveSelection.cpp:94