Engauge Digitizer  2
 All Classes Files Functions Variables Enumerations Enumerator Friends Pages
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 <QDockWidget>
13 
14 class CmdMediator;
15 class Curve;
16 class GeometryModel;
17 class MainWindowModel;
18 class QItemSelection;
19 class QString;
20 class QTableView;
21 class Transformation;
22 
27 class GeometryWindow : public QDockWidget
28 {
29  Q_OBJECT;
30 
31 public:
33  GeometryWindow (QWidget *parent);
34  virtual ~GeometryWindow ();
35 
37  void clear ();
38 
40  virtual void closeEvent(QCloseEvent *event);
41 
43  static int columnBodyPointIdentifiers ();
44 
46  void update (const CmdMediator &cmdMediator,
47  const MainWindowModel &modelMainWindow,
48  const QString &curveSelected,
49  const Transformation &transformation);
50 
51 public slots:
52 
54  void slotPointHoverEnter (QString);
55 
57  void slotPointHoverLeave (QString);
58 
60  void slotSelectionChanged (const QItemSelection &, const QItemSelection &);
61 
62 signals:
65 
66 private:
68 
69  int fold2dIndexes (int row,
70  int col,
71  int rowLow,
72  int colLow,
73  int colHigh) const;
74  void initializeHeader();
75  void loadStrategies ();
76  void resizeTable (int rowCount);
77  void unselectAll (); // Unselect all cells. This cleans up nicely when Document is closed
78 
79  enum ColumnsHeader {
80  COLUMN_HEADER_LABEL,
81  COLUMN_HEADER_VALUE,
82  NUM_HEADER_COLUMNS
83  };
84 
85  enum ColumnsBody {
86  COLUMN_BODY_X,
87  COLUMN_BODY_Y,
88  COLUMN_BODY_INDEX,
89  COLUMN_BODY_DISTANCE_GRAPH_FORWARD,
90  COLUMN_BODY_DISTANCE_PERCENT_FORWARD,
91  COLUMN_BODY_DISTANCE_GRAPH_BACKWARD,
92  COLUMN_BODY_DISTANCE_PERCENT_BACKWARD,
93  COLUMN_BODY_POINT_IDENTIFIERS,
94  NUM_BODY_COLUMNS
95  };
96 
97  enum HeaderRows {
98  HEADER_ROW_NAME,
99  HEADER_ROW_FUNC_AREA,
100  HEADER_ROW_POLY_AREA,
101  HEADER_ROW_COLUMN_NAMES,
102  NUM_HEADER_ROWS
103  };
104 
105  QTableView *m_view;
106  GeometryModel *m_model;
107 
108  GeometryStrategyContext m_geometryStrategyContext;
109 
110  // Export format is updated after every CmdAbstractBase gets redone/undone
111  DocumentModelExportFormat m_modelExport;
112 };
113 
114 #endif // GEOMETRY_WINDOW_H
void slotSelectionChanged(const QItemSelection &, const QItemSelection &)
Prepare for copy after selection has changed.
virtual void closeEvent(QCloseEvent *event)
Catch close event so corresponding menu item in MainWindow can be updated accordingly.
Model for DlgSettingsExportFormat and CmdSettingsExportFormat.
void slotPointHoverEnter(QString)
Highlight the row for the specified point.
Window that displays the geometry information, as a table, for the current curve. ...
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...
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:32
Command queue stack.
Definition: CmdMediator.h:23
Model that adds row highlighting according to the currently select point identifier.
Definition: GeometryModel.h:14
void clear()
Clear stale information.