Engauge Digitizer  2
GeometryWindow.h
1 /******************************************************************************************************
2  * (C) 2016 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 GEOMETRY_WINDOW_H
8 #define GEOMETRY_WINDOW_H
9 
10 #include "DocumentModelExportFormat.h"
11 #include "GeometryStrategyContext.h"
12 #include "WindowAbstractBase.h"
13 
14 class CmdMediator;
15 class Curve;
16 class GeometryModel;
17 class MainWindow;
18 class MainWindowModel;
19 class QItemSelection;
20 class QString;
21 class QTableView;
22 class Transformation;
23 
29 {
30  Q_OBJECT;
31 
32 public:
34  GeometryWindow (MainWindow *mainWindow);
35  virtual ~GeometryWindow ();
36 
37  virtual void clear ();
38  virtual void closeEvent(QCloseEvent *event);
39 
41  static int columnBodyPointIdentifiers ();
42 
43  virtual void doCopy ();
44  virtual void update (const CmdMediator &cmdMediator,
45  const MainWindowModel &modelMainWindow,
46  const QString &curveSelected,
47  const Transformation &transformation);
48  virtual QTableView *view () const;
49 
50 public slots:
51 
53  void slotPointHoverEnter (QString);
54 
56  void slotPointHoverLeave (QString);
57 
58 signals:
59 
62 
63 private:
65 
66  void createWidgets (MainWindow *mainWindow);
67  void initializeHeader();
68  void loadStrategies ();
69  void resizeTable (int rowCount);
70  void unselectAll (); // Unselect all cells. This cleans up nicely when Document is closed
71 
72  enum ColumnsHeader {
73  COLUMN_HEADER_LABEL,
74  COLUMN_HEADER_VALUE,
75  NUM_HEADER_COLUMNS
76  };
77 
78  enum ColumnsBody {
79  COLUMN_BODY_X,
80  COLUMN_BODY_Y,
81  COLUMN_BODY_INDEX,
82  COLUMN_BODY_DISTANCE_GRAPH_FORWARD,
83  COLUMN_BODY_DISTANCE_PERCENT_FORWARD,
84  COLUMN_BODY_DISTANCE_GRAPH_BACKWARD,
85  COLUMN_BODY_DISTANCE_PERCENT_BACKWARD,
86  COLUMN_BODY_POINT_IDENTIFIERS,
87  NUM_BODY_COLUMNS
88  };
89 
90  enum HeaderRows {
91  HEADER_ROW_NAME,
92  HEADER_ROW_FUNC_AREA,
93  HEADER_ROW_POLY_AREA,
94  HEADER_ROW_COLUMN_NAMES,
95  NUM_HEADER_ROWS
96  };
97 
98  QTableView *m_view;
99  GeometryModel *m_model;
100 
101  GeometryStrategyContext m_geometryStrategyContext;
102 
103  // Export format is updated after every CmdAbstractBase gets redone/undone
104  DocumentModelExportFormat m_modelExport;
105 };
106 
107 #endif // GEOMETRY_WINDOW_H
virtual void closeEvent(QCloseEvent *event)
Catch close event so corresponding menu item in MainWindow can be updated accordingly.
Model for DlgSettingsExportFormat and CmdSettingsExportFormat.
virtual QTableView * view() const
QTableView-based class used by child class.
Dockable widget abstract base class.
void slotPointHoverEnter(QString)
Highlight the row for the specified point.
Window that displays the geometry information, as a table, for the current curve. ...
virtual void update(const CmdMediator &cmdMediator, const MainWindowModel &modelMainWindow, const QString &curveSelected, const Transformation &transformation)
Populate the table with the specified Curve.
void slotPointHoverLeave(QString)
Unhighlight the row for the specified point.
Affine transformation between screen and graph coordinates, based on digitized axis points...
virtual void doCopy()
Copy the current selection to the clipboard.
Class for that manages geometry strategies.
Model for DlgSettingsMainWindow.
void signalGeometryWindowClosed()
Signal that this QDockWidget was just closed.
static int columnBodyPointIdentifiers()
Hidden column that has the point identifiers.
Container for one set of digitized Points.
Definition: Curve.h:33
Command queue stack.
Definition: CmdMediator.h:23
Model that adds row highlighting according to the currently select point identifier.
Definition: GeometryModel.h:14
Main window consisting of menu, graphics scene, status bar and optional toolbars as a Single Document...
Definition: MainWindow.h:89
virtual void clear()
Clear stale information.