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 
37 private slots:
38  void slotAcceptedPointColor (const QString &);
39  void slotCandidatePointColor (const QString &);
40  void slotMaxPointSize (int);
41  void slotMouseMove (QPointF pos);
42  void slotRejectedPointColor (const QString &);
43 
44 protected:
45  virtual void handleOk ();
46 
47 private:
48 
49  QPointF boxPositionConstraint(const QPointF &posIn);
50  void createControls (QGridLayout *layout,
51  int &row);
52  void createPreview(QGridLayout *layout,
53  int &row);
54  void createTemplate();
55  void initializeBox();
56  double radiusAlongDiagonal () const;
57  void updateControls();
58  void updatePreview();
59 
60  QSpinBox *m_spinMinPointSeparation;
61  QSpinBox *m_spinPointSize;
62  QComboBox *m_cmbAcceptedPointColor;
63  QComboBox *m_cmbRejectedPointColor;
64  QComboBox *m_cmbCandidatePointColor;
65 
66  QGraphicsScene *m_scenePreview;
67  ViewPreview *m_viewPreview;
68  QGraphicsEllipseItem *m_circle;
69 
70  DocumentModelPointMatch *m_modelPointMatchBefore;
71  DocumentModelPointMatch *m_modelPointMatchAfter;
72 };
73 
74 #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:83
CmdMediator & cmdMediator()
Provide access to Document information wrapped inside CmdMediator.