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

Segment fill panel discusses the digitization of points along curve lines. More...

#include <TutorialStateSegmentFill.h>

Inheritance diagram for TutorialStateSegmentFill:
Inheritance graph
Collaboration diagram for TutorialStateSegmentFill:
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

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

Segment fill panel discusses the digitization of points along curve lines.

Definition at line 18 of file TutorialStateSegmentFill.h.

Constructor & Destructor Documentation

◆ TutorialStateSegmentFill()

TutorialStateSegmentFill::TutorialStateSegmentFill ( TutorialStateContext context)

Single constructor.

Definition at line 17 of file TutorialStateSegmentFill.cpp.

17  :
19  m_title (nullptr),
20  m_background (nullptr),
21  m_text0 (nullptr),
22  m_text1 (nullptr),
23  m_text2 (nullptr),
24  m_previous (nullptr),
25  m_next (nullptr)
26 {
27  LOG4CPP_INFO_S ((*mainCat)) << "TutorialStateSegmentFill::TutorialStateSegmentFill";
28 }
One state manages one panel of the tutorial.
#define LOG4CPP_INFO_S(logger)
Definition: convenience.h:18
TutorialStateContext & context()
Context class for the tutorial state machine.
log4cpp::Category * mainCat
Definition: Logger.cpp:14

Member Function Documentation

◆ begin()

void TutorialStateSegmentFill::begin ( )
virtual

Transition into this state.

Implements TutorialStateAbstractBase.

Definition at line 30 of file TutorialStateSegmentFill.cpp.

31 {
32  LOG4CPP_INFO_S ((*mainCat)) << "TutorialStateSegmentFill::begin ()";
33 
34  context().tutorialDlg().scene().clear ();
35 
36  m_title = createTitle (tr ("Segment Fill"));
37  m_background = createPixmapItem (":/engauge/img/panel_segment_fill.png",
38  QPoint (0, 30));
39  m_text0 = createTextItem (tr ("Segment Fill mode places several\n"
40  "points all along the line segments\n"
41  "of a curve. Step 1 - Click on the\n"
42  "Segment Fill button."),
43  QPoint (300, 40));
44  m_text1 = createTextItem (tr ("Step 2 - Select the curve the new\n"
45  "points will belong to."),
46  QPoint (300, 140));
47  m_text2 = createTextItem (tr ("Step 3 - Move the cursor over a line\n"
48  "segment in the desired curve. If a\n"
49  "green line appears, click on it once\n"
50  "to generate many points."),
51  QPoint (300, 220));
52 
53  QSize backgroundSize = context().tutorialDlg().backgroundSize();
54 
55  m_previous = new TutorialButton (tr ("Previous"),
56  context().tutorialDlg().scene());
57  m_previous->setGeometry (QPoint (buttonMargin (),
58  backgroundSize.height() - buttonMargin() - m_previous->size().height()));
59  connect (m_previous, SIGNAL (signalTriggered ()), this, SLOT (slotPrevious ()));
60 
61  m_next = new TutorialButton (tr ("Next"),
62  context().tutorialDlg().scene());
63  m_next->setGeometry (QPoint (backgroundSize.width () - buttonMargin () - m_next->size ().width (),
64  backgroundSize.height () - buttonMargin () - m_next->size ().height ()));
65  connect (m_next, SIGNAL (signalTriggered ()), this, SLOT (slotNext ()));
66 }
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...
void slotNext()
Slot called when next button is triggered.
Show a button with text for clicking ion. The button is implemented using layering of two graphics it...
#define LOG4CPP_INFO_S(logger)
Definition: convenience.h:18
QGraphicsScene & scene()
Single scene the covers the entire tutorial dialog.
Definition: TutorialDlg.cpp:76
TutorialStateContext & context()
Context class for the tutorial state machine.
QGraphicsTextItem * createTextItem(const QString &text, const QPoint &pos)
Factory method for text items.
QGraphicsTextItem * createTitle(const QString &text)
Factory method for title items.
QGraphicsPixmapItem * createPixmapItem(const QString &resource, const QPoint &pos)
Factory method for pixmap items.
void slotPrevious()
Slot called to return to previous panel.
QSize backgroundSize() const
Make geometry available for layout.
Definition: TutorialDlg.cpp:44
log4cpp::Category * mainCat
Definition: Logger.cpp:14
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.

◆ end()

void TutorialStateSegmentFill::end ( )
virtual

Transition out of this state.

Implements TutorialStateAbstractBase.

Definition at line 68 of file TutorialStateSegmentFill.cpp.

69 {
70  LOG4CPP_INFO_S ((*mainCat)) << "TutorialStateSegmentFill::end ()";
71 
72  // It is not safe to remove and deallocate items here since an active TutorialButton
73  // may be on the stack. So we clear the scene as the first step in the next begin()
74 }
#define LOG4CPP_INFO_S(logger)
Definition: convenience.h:18
log4cpp::Category * mainCat
Definition: Logger.cpp:14

◆ slotNext

void TutorialStateSegmentFill::slotNext ( )
slot

Slot called when next button is triggered.

Definition at line 76 of file TutorialStateSegmentFill.cpp.

77 {
78  LOG4CPP_INFO_S ((*mainCat)) << "TutorialStateSegmentFill::slotNext";
79 
81 }
#define LOG4CPP_INFO_S(logger)
Definition: convenience.h:18
TutorialStateContext & context()
Context class for the tutorial state machine.
log4cpp::Category * mainCat
Definition: Logger.cpp:14
void requestDelayedStateTransition(TutorialState tutorialState)
Request a transition to the specified state from the current state.

◆ slotPrevious

void TutorialStateSegmentFill::slotPrevious ( )
slot

Slot called to return to previous panel.

Definition at line 83 of file TutorialStateSegmentFill.cpp.

84 {
85  LOG4CPP_INFO_S ((*mainCat)) << "TutorialStateSegmentFill::slotPrevious";
86 
88 }
#define LOG4CPP_INFO_S(logger)
Definition: convenience.h:18
TutorialStateContext & context()
Context class for the tutorial state machine.
log4cpp::Category * mainCat
Definition: Logger.cpp:14
void requestDelayedStateTransition(TutorialState tutorialState)
Request a transition to the specified state from the current state.

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