Engauge Digitizer  2
DlgSettingsPointMatch.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_POINT_MATCH_H
8 #define DLG_SETTINGS_POINT_MATCH_H
9 
10 #include "CoordsType.h"
11 #include "DlgSettingsAbstractBase.h"
12 
14 class QComboBox;
15 class QGraphicsEllipseItem;
16 class QGraphicsLineItem;
17 class QGraphicsPixmapItem;
18 class QGraphicsScene;
19 class QGridLayout;
20 class QSpinBox;
21 class ViewPreview;
22 
25 {
26  Q_OBJECT;
27 
28 public:
31  virtual ~DlgSettingsPointMatch();
32 
33  virtual void createOptionalSaveDefault (QHBoxLayout *layout);
34  virtual QWidget *createSubPanel ();
35  virtual void load (CmdMediator &cmdMediator);
36  virtual void setSmallDialogs (bool smallDialogs);
37 
38 private slots:
39  void slotAcceptedPointColor (const QString &);
40  void slotCandidatePointColor (const QString &);
41  void slotMaxPointSize (int);
42  void slotMouseMove (QPointF pos);
43  void slotRejectedPointColor (const QString &);
44 
45 protected:
46  virtual void handleOk ();
47 
48 private:
49 
50  QPointF boxPositionConstraint(const QPointF &posIn);
51  void createControls (QGridLayout *layout,
52  int &row);
53  void createPreview(QGridLayout *layout,
54  int &row);
55  void createTemplate();
56  void initializeBox();
57  double radiusAlongDiagonal () const;
58  void updateControls();
59  void updatePreview();
60 
61  QSpinBox *m_spinMinPointSeparation;
62  QSpinBox *m_spinPointSize;
63  QComboBox *m_cmbAcceptedPointColor;
64  QComboBox *m_cmbRejectedPointColor;
65  QComboBox *m_cmbCandidatePointColor;
66 
67  QGraphicsScene *m_scenePreview;
68  ViewPreview *m_viewPreview;
69  QGraphicsEllipseItem *m_circle;
70 
71  DocumentModelPointMatch *m_modelPointMatchBefore;
72  DocumentModelPointMatch *m_modelPointMatchAfter;
73 };
74 
75 #endif // DLG_SETTINGS_POINT_MATCH_H
Model for DlgSettingsPointMatch and CmdSettingsPointMatch.
Dialog for editing point match settings, for DigitizeStatePointMatch.
Class that modifies QGraphicsView to automatically expand/shrink the view to fit the window...
Definition: ViewPreview.h:14
virtual void handleOk()
Process slotOk.
Command queue stack.
Definition: CmdMediator.h:23
virtual void load(CmdMediator &cmdMediator)
Load settings from Document.
Abstract base class for all Settings dialogs.
virtual QWidget * createSubPanel()
Create dialog-specific panel to which base class will add Ok and Cancel buttons.
DlgSettingsPointMatch(MainWindow &mainWindow)
Single constructor.
MainWindow & mainWindow()
Get method for MainWindow.
virtual void createOptionalSaveDefault(QHBoxLayout *layout)
Let subclass define an optional Save As Default button.
Main window consisting of menu, graphics scene, status bar and optional toolbars as a Single Document...
Definition: MainWindow.h:89
CmdMediator & cmdMediator()
Provide access to Document information wrapped inside CmdMediator.
virtual void setSmallDialogs(bool smallDialogs)
If false then dialogs have a minimum size so all controls are visible.