Engauge Digitizer
2
Toggle main menu visibility
Loading...
Searching...
No Matches
Dlg
DlgSettingsSegments.h
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
#ifndef DLG_SETTINGS_SEGMENTS_H
8
#define DLG_SETTINGS_SEGMENTS_H
9
10
#include "
DlgSettingsAbstractBase.h
"
11
#include "
GraphicsPoint.h
"
12
#include <QImage>
13
#include <QList>
14
15
class
ButtonWhatsThis
;
16
class
DocumentModelSegments
;
17
class
QCheckBox;
18
class
QComboBox;
19
class
QGridLayout;
20
class
QGraphicsScene;
21
class
QSpinBox;
22
class
Segment
;
23
class
ViewPreview
;
24
25
typedef
QList<GraphicsPoint*>
GraphicsPoints
;
26
31
class
DlgSettingsSegments
:
public
DlgSettingsAbstractBase
32
{
33
Q_OBJECT;
34
35
public
:
37
DlgSettingsSegments
(
MainWindow
&
mainWindow
);
38
virtual
~DlgSettingsSegments
();
39
40
virtual
void
createOptionalSaveDefault
(QHBoxLayout *layout);
41
virtual
QWidget *
createSubPanel
();
42
virtual
void
load
(
CmdMediator
&
cmdMediator
);
43
virtual
void
setSmallDialogs
(
bool
smallDialogs);
44
45
private
slots:
46
void
slotFillCorners (
int
state);
47
void
slotInactiveOpacity (
const
QString &);
48
void
slotLineColor (
const
QString &);
49
void
slotLineWidthActive (
int
);
50
void
slotLineWidthInactive (
int
);
51
void
slotMinLength (
const
QString &);
52
void
slotPointSeparation (
const
QString &);
53
void
slotWhatsThis();
54
55
protected
:
56
virtual
void
handleOk
();
57
58
private
:
59
60
enum
HoverState {
61
HOVER_ACTIVE,
62
HOVER_INACTIVE
63
};
64
65
void
clearPointsOneScene (
GraphicsPoints
&points);
66
void
createControls (QGridLayout *layout,
int
&row);
67
void
createPreview (QGridLayout *layout,
int
&row);
68
QImage createPreviewImage ()
const
;
69
void
updateControls();
70
void
updatePreview();
71
void
updatePreviewOneScene (QGraphicsScene *scenePreview,
72
QList<Segment*> &segments,
73
GraphicsPoints
&points,
74
HoverState hoverState);
75
76
ButtonWhatsThis
*m_btnWhatsThis;
77
QSpinBox *m_spinMinLength;
78
QSpinBox *m_spinPointSeparation;
79
QCheckBox *m_chkFillCorners;
80
QSpinBox *m_spinLineWidthActive;
81
QSpinBox *m_spinLineWidthInactive;
82
QComboBox *m_cmbLineColor;
83
QComboBox *m_cmbInactiveOpacity;
84
85
QGraphicsScene *m_scenePreviewActive;
86
QGraphicsScene *m_scenePreviewInactive;
87
ViewPreview
*m_viewPreviewActive;
88
ViewPreview
*m_viewPreviewInactive;
89
90
DocumentModelSegments
*m_modelSegmentsBefore;
91
DocumentModelSegments
*m_modelSegmentsAfter;
92
93
QList<Segment*> m_segmentsActive;
// Segments extracted from image
94
QList<Segment*> m_segmentsInactive;
// Segments extracted from image
95
GraphicsPoints
m_pointsActive;
// Points spread along the segments
96
GraphicsPoints
m_pointsInactive;
// Points spread along the segments
97
98
bool
m_loading;
// Flag that prevents multiple preview updates during loading while controls get loaded
99
};
100
101
#endif
// DLG_SETTINGS_SEGMENTS_H
DlgSettingsAbstractBase.h
GraphicsPoints
QList< GraphicsPoint * > GraphicsPoints
Definition
DlgSettingsSegments.h:25
GraphicsPoint.h
ButtonWhatsThis
Unobtrusive button to trigger QWhatsThis since some operating systems (Linux Mint) do not show WhatsT...
Definition
ButtonWhatsThis.h:16
CmdMediator
Command queue stack.
Definition
CmdMediator.h:24
DlgSettingsAbstractBase::DlgSettingsAbstractBase
DlgSettingsAbstractBase(const QString &title, const QString &dialogName, MainWindow &mainWindow)
Single constructor.
Definition
DlgSettingsAbstractBase.cpp:27
DlgSettingsAbstractBase::cmdMediator
CmdMediator & cmdMediator()
Provide access to Document information wrapped inside CmdMediator.
Definition
DlgSettingsAbstractBase.cpp:67
DlgSettingsAbstractBase::mainWindow
MainWindow & mainWindow()
Get method for MainWindow.
Definition
DlgSettingsAbstractBase.cpp:157
DlgSettingsSegments::handleOk
virtual void handleOk()
Process slotOk.
Definition
DlgSettingsSegments.cpp:299
DlgSettingsSegments::load
virtual void load(CmdMediator &cmdMediator)
Load settings from Document.
Definition
DlgSettingsSegments.cpp:312
DlgSettingsSegments::createSubPanel
virtual QWidget * createSubPanel()
Create dialog-specific panel to which base class will add Ok and Cancel buttons.
Definition
DlgSettingsSegments.cpp:269
DlgSettingsSegments::~DlgSettingsSegments
virtual ~DlgSettingsSegments()
Definition
DlgSettingsSegments.cpp:58
DlgSettingsSegments::createOptionalSaveDefault
virtual void createOptionalSaveDefault(QHBoxLayout *layout)
Let subclass define an optional Save As Default button.
Definition
DlgSettingsSegments.cpp:171
DlgSettingsSegments::DlgSettingsSegments
DlgSettingsSegments(MainWindow &mainWindow)
Single constructor.
Definition
DlgSettingsSegments.cpp:40
DlgSettingsSegments::setSmallDialogs
virtual void setSmallDialogs(bool smallDialogs)
If false then dialogs have a minimum size so all controls are visible.
Definition
DlgSettingsSegments.cpp:358
DocumentModelSegments
Model for DlgSettingsSegments and CmdSettingsSegments.
Definition
DocumentModelSegments.h:19
MainWindow
Main window consisting of menu, graphics scene, status bar and optional toolbars as a Single Document...
Definition
MainWindow.h:95
Segment
Selectable piecewise-defined line that follows a filtered line in the image.
Definition
Segment.h:22
ViewPreview
Class that modifies QGraphicsView to automatically expand/shrink the view to fit the window,...
Definition
ViewPreview.h:15
Generated on
for Engauge Digitizer by
1.17.0