Engauge Digitizer 2
Loading...
Searching...
No Matches
Public Slots | Public Member Functions | List of all members
TutorialStateCurveType Class Reference

Curve type state/panel lets user select the curve type (lines or points) More...

#include <TutorialStateCurveType.h>

Inheritance diagram for TutorialStateCurveType:
Inheritance graph
Collaboration diagram for TutorialStateCurveType:
Collaboration graph

Public Slots

void slotNextCurves ()
 Slot called when next button for curves is triggered.
 
void slotNextLines ()
 Slot called when next button for lines is triggered.
 
void slotPrevious ()
 Slot called to return to previous panel.
 

Public Member Functions

 TutorialStateCurveType (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 type state/panel lets user select the curve type (lines or points)

Definition at line 18 of file TutorialStateCurveType.h.

Constructor & Destructor Documentation

◆ TutorialStateCurveType()

TutorialStateCurveType::TutorialStateCurveType ( TutorialStateContext & context)

Single constructor.

Definition at line 18 of file TutorialStateCurveType.cpp.

18 :
20 m_title (nullptr),
21 m_background (nullptr),
22 m_text0 (nullptr),
23 m_text1 (nullptr),
24 m_text2 (nullptr),
25 m_previous (nullptr),
26 m_nextLines (nullptr),
27 m_nextPoints (nullptr)
28{
29 LOG4CPP_INFO_S ((*mainCat)) << "TutorialStateCurveType::TutorialStateCurveType";
30}
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 TutorialStateCurveType::begin ( )
virtual

Transition into this state.

Implements TutorialStateAbstractBase.

Definition at line 32 of file TutorialStateCurveType.cpp.

33{
34 LOG4CPP_INFO_S ((*mainCat)) << "TutorialStateCurveType::begin ()";
35
36 context().tutorialDlg().scene().clear ();
37
38 m_title = createTitle (tr ("Curve Type"));
39 m_background = createPixmapItem (":/engauge/img/panel_lines_points.png",
40 QPoint (0, 0));
41 m_text0 = createTextItem (tr ("The next steps depend on how the curves\n"
42 "are drawn, in terms of lines and points."),
43 QPoint (240, 40));
44 m_text1 = createTextItem (tr ("If the curves are drawn\n"
45 "with lines (with or without\n"
46 "points) then click on\n"
47 "Next (Lines)."),
48 QPoint (265, 110));
49 m_text2 = createTextItem (tr ("If the curves are drawn\n"
50 "without lines and only\n"
51 "with points, then click on\n"
52 "Next (Points)."),
53 QPoint (265, 270));
54
55 QSize backgroundSize = context().tutorialDlg().backgroundSize();
56
57 m_previous = new TutorialButton (tr ("Previous"),
58 context().tutorialDlg().scene());
59 m_previous->setGeometry (QPoint (buttonMargin (),
60 backgroundSize.height () - buttonMargin() - m_previous->size().height()));
61 connect (m_previous, SIGNAL (signalTriggered ()), this, SLOT (slotPrevious ()));
62
63 m_nextLines = new TutorialButton (tr ("Next (Lines)"),
64 context().tutorialDlg().scene());
65 m_nextLines->setGeometry (QPoint (qFloor (backgroundSize.width () - buttonMargin () - m_nextLines->size ().width ()),
66 qFloor (backgroundSize.height () / 3.0 - m_nextLines->size ().height () / 2.0)));
67 connect (m_nextLines, SIGNAL (signalTriggered ()), this, SLOT (slotNextCurves ()));
68
69 m_nextPoints = new TutorialButton (tr ("Next (Points)"),
70 context().tutorialDlg().scene());
71 m_nextPoints->setGeometry (QPoint (qFloor (backgroundSize.width () - buttonMargin () - m_nextPoints->size ().width ()),
72 qFloor (backgroundSize.height () * 2.0 / 3.0 - m_nextPoints->size ().height () / 2.0)));
73 connect (m_nextPoints, SIGNAL (signalTriggered ()), this, SLOT (slotNextLines ()));
74}
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 slotNextCurves()
Slot called when next button for curves is triggered.
void slotPrevious()
Slot called to return to previous panel.
void slotNextLines()
Slot called when next button for lines is triggered.

◆ end()

void TutorialStateCurveType::end ( )
virtual

Transition out of this state.

Implements TutorialStateAbstractBase.

Definition at line 76 of file TutorialStateCurveType.cpp.

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

◆ slotNextCurves

void TutorialStateCurveType::slotNextCurves ( )
slot

Slot called when next button for curves is triggered.

Definition at line 84 of file TutorialStateCurveType.cpp.

85{
86 LOG4CPP_INFO_S ((*mainCat)) << "TutorialStateCurveType::slotNextCurves";
87
89}
@ TUTORIAL_STATE_SEGMENT_FILL
void requestDelayedStateTransition(TutorialState tutorialState)
Request a transition to the specified state from the current state.

◆ slotNextLines

void TutorialStateCurveType::slotNextLines ( )
slot

Slot called when next button for lines is triggered.

Definition at line 91 of file TutorialStateCurveType.cpp.

92{
93 LOG4CPP_INFO_S ((*mainCat)) << "TutorialStateCurveType::slotNextLines";
94
96}
@ TUTORIAL_STATE_POINT_MATCH

◆ slotPrevious

void TutorialStateCurveType::slotPrevious ( )
slot

Slot called to return to previous panel.

Definition at line 98 of file TutorialStateCurveType.cpp.

99{
100 LOG4CPP_INFO_S ((*mainCat)) << "TutorialStateCurveType::slotNextCurves";
101
103}
@ TUTORIAL_STATE_CURVE_SELECTION

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