00001
00002
00003
00004
00005
00006
00007 #ifndef GEOMETRY_WINDOW_H
00008 #define GEOMETRY_WINDOW_H
00009
00010 #include "DocumentModelExportFormat.h"
00011 #include "GeometryStrategyContext.h"
00012 #include <QDockWidget>
00013
00014 class CmdMediator;
00015 class Curve;
00016 class GeometryModel;
00017 class MainWindowModel;
00018 class QItemSelection;
00019 class QString;
00020 class QTableView;
00021 class Transformation;
00022
00027 class GeometryWindow : public QDockWidget
00028 {
00029 Q_OBJECT;
00030
00031 public:
00033 GeometryWindow (QWidget *parent);
00034 virtual ~GeometryWindow ();
00035
00037 void clear ();
00038
00040 virtual void closeEvent(QCloseEvent *event);
00041
00043 static int columnBodyPointIdentifiers ();
00044
00046 void update (const CmdMediator &cmdMediator,
00047 const MainWindowModel &modelMainWindow,
00048 const QString &curveSelected,
00049 const Transformation &transformation);
00050
00051 public slots:
00052
00054 void slotPointHoverEnter (QString);
00055
00057 void slotPointHoverLeave (QString);
00058
00060 void slotSelectionChanged (const QItemSelection &, const QItemSelection &);
00061
00062 signals:
00064 void signalGeometryWindowClosed();
00065
00066 private:
00067 GeometryWindow();
00068
00069 int fold2dIndexes (int row,
00070 int col,
00071 int rowLow,
00072 int colLow,
00073 int colHigh) const;
00074 void initializeHeader();
00075 void loadStrategies ();
00076 void resizeTable (int rowCount);
00077 void unselectAll ();
00078
00079 enum ColumnsHeader {
00080 COLUMN_HEADER_LABEL,
00081 COLUMN_HEADER_VALUE,
00082 NUM_HEADER_COLUMNS
00083 };
00084
00085 enum ColumnsBody {
00086 COLUMN_BODY_X,
00087 COLUMN_BODY_Y,
00088 COLUMN_BODY_INDEX,
00089 COLUMN_BODY_DISTANCE_GRAPH_FORWARD,
00090 COLUMN_BODY_DISTANCE_PERCENT_FORWARD,
00091 COLUMN_BODY_DISTANCE_GRAPH_BACKWARD,
00092 COLUMN_BODY_DISTANCE_PERCENT_BACKWARD,
00093 COLUMN_BODY_POINT_IDENTIFIERS,
00094 NUM_BODY_COLUMNS
00095 };
00096
00097 enum HeaderRows {
00098 HEADER_ROW_NAME,
00099 HEADER_ROW_FUNC_AREA,
00100 HEADER_ROW_POLY_AREA,
00101 HEADER_ROW_COLUMN_NAMES,
00102 NUM_HEADER_ROWS
00103 };
00104
00105 QTableView *m_view;
00106 GeometryModel *m_model;
00107
00108 GeometryStrategyContext m_geometryStrategyContext;
00109
00110
00111 DocumentModelExportFormat m_modelExport;
00112 };
00113
00114 #endif // GEOMETRY_WINDOW_H