Engauge Digitizer 2
Loading...
Searching...
No Matches
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
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
25
28{
30
31public:
34 virtual ~DlgSettingsSegments();
35
37 virtual QWidget *createSubPanel ();
38 virtual void load (CmdMediator &cmdMediator);
39 virtual void setSmallDialogs (bool smallDialogs);
40
41private slots:
42 void slotFillCorners (int state);
43 void slotLineColor (const QString &);
44 void slotLineWidth (int);
45 void slotMinLength (const QString &);
46 void slotPointSeparation (const QString &);
47
48protected:
49 virtual void handleOk ();
50
51private:
52
53 void clearPoints();
54 void createControls (QGridLayout *layout, int &row);
55 void createPreview (QGridLayout *layout, int &row);
56 QImage createPreviewImage () const;
57 void updateControls();
58 void updatePreview();
59
60 QSpinBox *m_spinMinLength;
61 QSpinBox *m_spinPointSeparation;
62 QCheckBox *m_chkFillCorners;
63 QSpinBox *m_spinLineWidth;
64 QComboBox *m_cmbLineColor;
65
66 QGraphicsScene *m_scenePreview;
67 ViewPreview *m_viewPreview;
68
69 DocumentModelSegments *m_modelSegmentsBefore;
70 DocumentModelSegments *m_modelSegmentsAfter;
71
72 QList<Segment*> m_segments; // Segments extracted from image
73 GraphicsPoints m_points; // Points spread along the segments
74
75 bool m_loading; // Flag that prevents multiple preview updates during loading while controls get loaded
76};
77
78#endif // DLG_SETTINGS_SEGMENTS_H
const int INNER_RADIUS_MIN
QList< GraphicsPoint * > GraphicsPoints
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.
DlgSettingsSegments(MainWindow &mainWindow)
Single constructor.
virtual void setSmallDialogs(bool smallDialogs)
If false then dialogs have a minimum size so all controls are visible.
Model for DlgSettingsSegments and CmdSettingsSegments.
Main window consisting of menu, graphics scene, status bar and optional toolbars as a Single Document...
Definition MainWindow.h:92
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