Engauge Digitizer 2
Loading...
Searching...
No Matches
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.
 
void slotNext ()
 Slot called when next button is triggered.
 
void slotPrevious ()
 Slot called to return to previous panel.
 

Public Member Functions

 TutorialStateCurveSelection (TutorialStateContext &context)
 Single constructor.
 
virtual void begin ()
 Transition into this state.
 
virtual void end ()
 Transition out of this state.
 
- Public Member Functions inherited from TutorialStateAbstractBase
 TutorialStateAbstractBase (TutorialStateContext &context)
 Single constructor.
 
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.
 
TutorialStateContextcontext ()
 Context class for the tutorial state machine.
 
QGraphicsPixmapItemcreatePixmapItem (const QString &resource, const QPoint &pos)
 Factory method for pixmap items.
 
QGraphicsTextItem * createTextItem (const QString &text, const QPoint &pos)
 Factory method for text items.
 
QGraphicsTextItem * createTitle (const QString &text)
 Factory method for title items.
 

Detailed Description

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

Definition at line 18 of file TutorialStateCurveSelection.h.

Constructor & Destructor Documentation

◆ TutorialStateCurveSelection()

TutorialStateCurveSelection::TutorialStateCurveSelection ( TutorialStateContext & context)

Single constructor.

Definition at line 18 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";
31}
log4cpp::Category * mainCat
Definition Logger.cpp:14
One state manages one panel of the tutorial.
TutorialStateContext & context()
Context class for the tutorial state machine.
#define LOG4CPP_INFO_S(logger)
Definition convenience.h:18

Member Function Documentation

◆ begin()

void TutorialStateCurveSelection::begin ( )
virtual

Transition into this state.

Implements TutorialStateAbstractBase.

Definition at line 33 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 ()));
85}
const int INNER_RADIUS_MIN
Show a button with text for clicking ion. The button is implemented using layering of two graphics it...
QSize size() const
Size of this button.
void setGeometry(const QPoint &pos)
Set the position. This is called after creation so screen extent is available for positioning calcula...
QGraphicsScene & scene()
Single scene the covers the entire tutorial dialog.
QSize backgroundSize() const
Make geometry available for layout.
QGraphicsTextItem * createTitle(const QString &text)
Factory method for title items.
QGraphicsTextItem * createTextItem(const QString &text, const QPoint &pos)
Factory method for text items.
QGraphicsPixmapItem * createPixmapItem(const QString &resource, const QPoint &pos)
Factory method for pixmap items.
int buttonMargin() const
Buttons are placed up against bottom side, and left or right side, separated by this margin.
TutorialDlg & tutorialDlg()
Access to tutorial dialogs and its scene.
void slotNext()
Slot called when next button is triggered.
void slotPrevious()
Slot called to return to previous panel.
void slotColorFilter()
Slot called when settings button is triggered.

◆ end()

void TutorialStateCurveSelection::end ( )
virtual

Transition out of this state.

Implements TutorialStateAbstractBase.

Definition at line 87 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()
93}

◆ slotColorFilter

void TutorialStateCurveSelection::slotColorFilter ( )
slot

Slot called when settings button is triggered.

Definition at line 95 of file TutorialStateCurveSelection.cpp.

96{
97 LOG4CPP_INFO_S ((*mainCat)) << "TutorialStateCurveSelection::slotColorFilter";
98
100}
@ TUTORIAL_STATE_COLOR_FILTER
void requestDelayedStateTransition(TutorialState tutorialState)
Request a transition to the specified state from the current state.

◆ slotNext

void TutorialStateCurveSelection::slotNext ( )
slot

Slot called when next button is triggered.

Definition at line 102 of file TutorialStateCurveSelection.cpp.

103{
104 LOG4CPP_INFO_S ((*mainCat)) << "TutorialStateCurveSelection::slotNextCurves";
105
107}
@ TUTORIAL_STATE_CURVE_TYPE

◆ slotPrevious

void TutorialStateCurveSelection::slotPrevious ( )
slot

Slot called to return to previous panel.

Definition at line 109 of file TutorialStateCurveSelection.cpp.

110{
111 LOG4CPP_INFO_S ((*mainCat)) << "TutorialStateCurveSelection::slotPrevious";
112
114}
@ TUTORIAL_STATE_AXIS_POINTS

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