Engauge Digitizer
2
Toggle main menu visibility
Loading...
Searching...
No Matches
Tutorial
TutorialStateColorFilter.cpp
Go to the documentation of this file.
1
/******************************************************************************************************
2
* (C) 2014 markummitchell@github.com. This file is part of Engauge Digitizer, which is released *
3
* under GNU General Public License version 2 (GPLv2) or (at your option) any later version. See file *
4
* LICENSE or go to gnu.org/licenses for details. Distribution requires prior written permission. *
5
******************************************************************************************************/
6
7
#include "
Logger.h
"
8
#include <qdebug.h>
9
#include <QGraphicsPixmapItem>
10
#include <QGraphicsScene>
11
#include <QGraphicsView>
12
#include "
TutorialButton.h
"
13
#include "
TutorialDlg.h
"
14
#include "
TutorialStateColorFilter.h
"
15
#include "
TutorialStateContext.h
"
16
17
TutorialStateColorFilter::TutorialStateColorFilter
(
TutorialStateContext
&
context
) :
18
TutorialStateAbstractBase
(
context
),
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_text4 (nullptr),
26
m_back (nullptr)
27
{
28
qCInfo(ENGAUGE_LOG) <<
"TutorialStateColorFilter::TutorialStateColorFilter"
;
29
}
30
31
void
TutorialStateColorFilter::begin
()
32
{
33
qCInfo(ENGAUGE_LOG) <<
"TutorialStateColorFilter::begin ()"
;
34
35
context
().
tutorialDlg
().
scene
().clear ();
36
37
m_title =
createTitle
(tr (
"Color Filter"
));
38
m_background =
createPixmapItem
(
":/engauge/img/panel_color_filter.png"
,
39
QPoint (0, 30));
40
m_text0 =
createTextItem
(tr (
"Each curve has Color Filter settings that\n"
41
"are applied in Segment Fill mode. For\n"
42
"black lines the defaults work well, but for\n"
43
"colored lines the settings can be improved."
),
44
QPoint (260, 30));
45
m_text1 =
createTextItem
(tr (
"Step 1 - Select the Settings / Color\n"
46
"Filter menu option."
),
47
QPoint (285, 115));
48
m_text2 =
createTextItem
(tr (
"Step 2 - Select the curve that will\n"
49
"be given the new settings."
),
50
QPoint (285, 165));
51
m_text3 =
createTextItem
(tr (
"Step 3 - Select the mode. Intensity is\n"
52
"suggested for uncolored lines, and Hue\n"
53
"is suggested for colored lines."
),
54
QPoint (285, 210));
55
m_text4 =
createTextItem
(tr (
"Step 4 - Adjust the included range by\n"
56
"dragging the green handles, until the\n"
57
"curve is clear in the preview window\n"
58
"below. The graph shows a histogram\n"
59
"distribution of the values underneath.\n"
60
"Click Ok when finished."
),
61
QPoint (285, 280));
62
63
QSize backgroundSize =
context
().
tutorialDlg
().
backgroundSize
();
64
65
m_back =
new
TutorialButton
(tr (
"Back"
),
66
context
().tutorialDlg().scene());
67
m_back->setGeometry (QPoint (backgroundSize.width () / 2 - m_back->size().width () / 2,
68
backgroundSize.height() -
buttonMargin
() - m_back->size().height()));
69
connect (m_back, SIGNAL (signalTriggered ()),
this
, SLOT (
slotBack
()));
70
}
71
72
void
TutorialStateColorFilter::end
()
73
{
74
qCInfo(ENGAUGE_LOG) <<
"TutorialStateColorFilter::end ()"
;
75
76
// It is not safe to remove and deallocate items here since an active TutorialButton
77
// may be on the stack. So we clear the scene as the first step in the next begin()
78
}
79
80
void
TutorialStateColorFilter::slotBack
()
81
{
82
qCInfo(ENGAUGE_LOG) <<
"TutorialStateColorFilter::slotBack"
;
83
84
context
().
requestDelayedStateTransition
(
TUTORIAL_STATE_CURVE_SELECTION
);
85
}
Logger.h
TutorialButton.h
TutorialDlg.h
TUTORIAL_STATE_CURVE_SELECTION
@ TUTORIAL_STATE_CURVE_SELECTION
Definition
TutorialStateAbstractBase.h:17
TutorialStateColorFilter.h
TutorialStateContext.h
TutorialButton
Show a button with text for clicking ion. The button is implemented using layering of two graphics it...
Definition
TutorialButton.h:21
TutorialDlg::scene
QGraphicsScene & scene()
Single scene the covers the entire tutorial dialog.
Definition
TutorialDlg.cpp:76
TutorialDlg::backgroundSize
QSize backgroundSize() const
Make geometry available for layout.
Definition
TutorialDlg.cpp:44
TutorialStateAbstractBase::TutorialStateAbstractBase
TutorialStateAbstractBase(TutorialStateContext &context)
Single constructor.
Definition
TutorialStateAbstractBase.cpp:18
TutorialStateAbstractBase::createTitle
QGraphicsTextItem * createTitle(const QString &text)
Factory method for title items.
Definition
TutorialStateAbstractBase.cpp:57
TutorialStateAbstractBase::createTextItem
QGraphicsTextItem * createTextItem(const QString &text, const QPoint &pos)
Factory method for text items.
Definition
TutorialStateAbstractBase.cpp:47
TutorialStateAbstractBase::context
TutorialStateContext & context()
Context class for the tutorial state machine.
Definition
TutorialStateAbstractBase.cpp:32
TutorialStateAbstractBase::createPixmapItem
QGraphicsPixmapItem * createPixmapItem(const QString &resource, const QPoint &pos)
Factory method for pixmap items.
Definition
TutorialStateAbstractBase.cpp:37
TutorialStateAbstractBase::buttonMargin
int buttonMargin() const
Buttons are placed up against bottom side, and left or right side, separated by this margin.
Definition
TutorialStateAbstractBase.cpp:27
TutorialStateColorFilter::TutorialStateColorFilter
TutorialStateColorFilter(TutorialStateContext &context)
Single constructor.
Definition
TutorialStateColorFilter.cpp:17
TutorialStateColorFilter::begin
virtual void begin()
Transition into this state.
Definition
TutorialStateColorFilter.cpp:31
TutorialStateColorFilter::slotBack
void slotBack()
Slot called to return to previous panel.
Definition
TutorialStateColorFilter.cpp:80
TutorialStateColorFilter::end
virtual void end()
Transition out of this state.
Definition
TutorialStateColorFilter.cpp:72
TutorialStateContext
Context class for tutorial state machine.
Definition
TutorialStateContext.h:21
TutorialStateContext::requestDelayedStateTransition
void requestDelayedStateTransition(TutorialState tutorialState)
Request a transition to the specified state from the current state.
Definition
TutorialStateContext.cpp:86
TutorialStateContext::tutorialDlg
TutorialDlg & tutorialDlg()
Access to tutorial dialogs and its scene.
Definition
TutorialStateContext.cpp:109
Generated on
for Engauge Digitizer by
1.17.0