Engauge Digitizer 2
Loading...
Searching...
No Matches
DlgSettingsSegments.h
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
16class QCheckBox;
17class QComboBox;
18class QGridLayout;
19class QGraphicsScene;
20class QSpinBox;
21class Segment;
22class ViewPreview;
23
24typedef QList<GraphicsPoint*> GraphicsPoints;
25
28{
29 Q_OBJECT;
30
31public:
34 virtual ~DlgSettingsSegments();
35
36 virtual void createOptionalSaveDefault (QHBoxLayout *layout);
37 virtual QWidget *createSubPanel ();
38 virtual void load (CmdMediator &cmdMediator);
39
40private slots:
41 void slotFillCorners (int state);
42 void slotLineColor (const QString &);
43 void slotLineWidth (int);
44 void slotMinLength (const QString &);
45 void slotPointSeparation (const QString &);
46
47protected:
48 virtual void handleOk ();
49
50private:
51
52 void clearPoints();
53 void createControls (QGridLayout *layout, int &row);
54 void createPreview (QGridLayout *layout, int &row);
55 QImage createPreviewImage () const;
56 void updateControls();
57 void updatePreview();
58
59 QSpinBox *m_spinMinLength;
60 QSpinBox *m_spinPointSeparation;
61 QCheckBox *m_chkFillCorners;
62 QSpinBox *m_spinLineWidth;
63 QComboBox *m_cmbLineColor;
64
65 QGraphicsScene *m_scenePreview;
66 ViewPreview *m_viewPreview;
67
68 DocumentModelSegments *m_modelSegmentsBefore;
69 DocumentModelSegments *m_modelSegmentsAfter;
70
71 QList<Segment*> m_segments; // Segments extracted from image
72 GraphicsPoints m_points; // Points spread along the segments
73
74 bool m_loading; // Flag that prevents multiple preview updates during loading while controls get loaded
75};
76
77#endif // DLG_SETTINGS_SEGMENTS_H
Command queue stack.
Definition CmdMediator.h:24
Abstract base class for all Settings dialogs.
CmdMediator & cmdMediator()
Provide access to Document information wrapped inside CmdMediator.
MainWindow & mainWindow()
Get method for MainWindow.
Dialog for editing Segments settings, for DigitizeStateSegment.
virtual void handleOk()
Process slotOk.
virtual void load(CmdMediator &cmdMediator)
Load settings from Document.
virtual QWidget * createSubPanel()
Create dialog-specific panel to which base class will add Ok and Cancel buttons.
virtual void createOptionalSaveDefault(QHBoxLayout *layout)
Let subclass define an optional Save As Default button.
Model for DlgSettingsSegments and CmdSettingsSegments.
Main window consisting of menu, graphics scene, status bar and optional toolbars as a Single Document...
Definition MainWindow.h:78
Selectable piecewise-defined line that follows a filtered line in the image.
Definition Segment.h:22
Class that modifies QGraphicsView to automatically expand/shrink the view to fit the window,...
Definition ViewPreview.h:15