Engauge Digitizer  2
 All Classes Functions Variables Typedefs Enumerations Friends Pages
MainWindow.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 MAIN_WINDOW_H
8 #define MAIN_WINDOW_H
9 
10 #include "BackgroundImage.h"
11 #include "CoordSystemIndex.h"
12 #include "DigitizeStateAbstractBase.h"
13 #include "DocumentAxesPointsRequired.h"
14 #include "FittingCurveCoefficients.h"
15 #include "GridLines.h"
16 #include "MainWindowModel.h"
17 #include <QCursor>
18 #include <QMainWindow>
19 #include <QMap>
20 #include <QUrl>
21 #include "Transformation.h"
22 #include "ZoomControl.h"
23 #include "ZoomFactor.h"
24 #include "ZoomFactorInitial.h"
25 
27 class ChecklistGuide;
28 class CmdMediator;
29 class CmdStackShadow;
30 class CurveStyles;
34 class DlgSettingsCoords;
39 class DlgSettingsGeneral;
55 class ExportToFile;
56 class FileCmdScript;
57 class FittingCurve;
58 class FittingWindow;
59 class GeometryWindow;
60 class Ghosts;
61 class GraphicsScene;
62 class GraphicsView;
63 #if !defined(OSX_DEBUG) && !defined(OSX_RELEASE)
64 class HelpWindow;
65 #endif
66 class LoadImageFromUrl;
67 class NetworkClient;
68 class QAction;
69 class QActionGroup;
70 class QCloseEvent;
71 class QComboBox;
72 class QDomDocument;
73 class QGraphicsLineItem;
74 class QMenu;
75 class QPushButton;
76 class QSettings;
77 class QSignalMapper;
78 class QTextStream;
79 class QTimer;
80 class QToolBar;
81 class QVBoxLayout;
82 class StatusBar;
84 class TutorialDlg;
85 class ViewPointStyle;
86 class ViewSegmentFilter;
87 
88 extern const unsigned int MAX_RECENT_FILE_LIST_SIZE;
89 
91 class MainWindow : public QMainWindow
92 {
93  Q_OBJECT
94 
96  friend class CreateActions;
97  friend class CreateCentralWidget;
98  friend class CreateCommandStackShadow;
99  friend class CreateDockableWidgets;
100  friend class CreateFacade;
101  friend class CreateHelpWindow;
102  friend class CreateIcons;
103  friend class CreateLoadImage;
104  friend class CreateMenus;
105  friend class CreateNetwork;
106  friend class CreateScene;
107  friend class CreateSettingsDialogs;
108  friend class CreateStateContexts;
109  friend class CreateStatusBar;
110  friend class CreateToolBars;
111  friend class CreateTutorial;
112  friend class CreateZoomMaps;
113 
115  friend class TestExport;
116 
117 public:
130  MainWindow(const QString &errorReportFile,
131  const QString &fileCmdScriptFile,
132  bool isDropRegression,
133  bool isRegressionTest,
134  bool isGnuplot,
135  bool isReset,
136  bool isExportOnly,
137  bool isExtractImageOnly,
138  const QString &extractImageOnlyExtension,
139  const QStringList &loadStartupFiles,
140  const QStringList &commandLineWithoutLoadStartupFiles,
141  QWidget *parent = 0);
142  ~MainWindow();
143 
145  void cmdFileClose();
146 
148  void cmdFileExport(const QString &fileName);
149 
151  void cmdFileImport(const QString &fileName);
152 
154  void cmdFileOpen(const QString &fileName);
155 
158 
160  virtual bool eventFilter(QObject *, QEvent *);
161 
163  QImage imageFiltered () const;
164 
166  bool isGnuplot() const;
167 
170 
172  bool modeMap () const;
173 
175  void resizeEvent (QResizeEvent *event);
176 
178  void saveErrorReportFileAndExit(const char *comment,
179  const char *file,
180  int line,
181  const char *context);
182 
184  GraphicsScene &scene();
185 
188  BackgroundImage selectOriginal(BackgroundImage backgroundImage);
189 
191  QString selectedGraphCurve () const;
192 
194  virtual void showEvent(QShowEvent *);
195 
197  void showTemporaryMessage (const QString &temporaryMessage);
198 
201 
203  bool transformIsDefined() const;
204 
206  void updateAfterCommand();
207 
210 
212  void updateCoordSystem(CoordSystemIndex coordSystemIndex);
213 
215  void updateDigitizeStateIfSoftwareTriggered (DigitizeState digitizeState);
216 
220 
222  void updateSettingsAxesChecker(const DocumentModelAxesChecker &modelAxesChecker);
223 
225  void updateSettingsColorFilter(const DocumentModelColorFilter &modelColorFilter);
226 
228  void updateSettingsCoords(const DocumentModelCoords &modelCoords);
229 
231  void updateSettingsCurveList (const CurvesGraphs &curvesGraphs);
232 
234  void updateSettingsCurveStyles(const CurveStyles &modelCurveStyles);
235 
237  void updateSettingsDigitizeCurve(const DocumentModelDigitizeCurve &modelDigitizeCurve);
238 
240  void updateSettingsExportFormat(const DocumentModelExportFormat &modelExport);
241 
243  void updateSettingsGeneral(const DocumentModelGeneral &modelGeneral);
244 
246  void updateSettingsGridDisplay(const DocumentModelGridDisplay &modelGridDisplay);
247 
249  void updateSettingsGridRemoval(const DocumentModelGridRemoval &modelGridRemoval);
250 
253 
255  void updateSettingsPointMatch(const DocumentModelPointMatch &modelPointMatch);
256 
258  void updateSettingsSegments(const DocumentModelSegments &modelSegments);
259 
261  void updateViewsOfSettings (const QString &activeCurve);
262 
264  GraphicsView &view ();
265 
267  const GraphicsView &view () const;
268 
269 private slots:
270  void slotBtnPrintAll();
271  void slotBtnShowAllPressed();
272  void slotBtnShowAllReleased();
273  void slotCanRedoChanged (bool);
274  void slotCanUndoChanged (bool);
275  void slotChecklistClosed ();
276  void slotCleanChanged (bool);
277  void slotCmbBackground(int);
278  void slotCmbCoordSystem(int);
279  void slotCmbCurve(int);
280  void slotContextMenuEventAxis (QString);
281  void slotContextMenuEventGraph (QStringList);
282  void slotDigitizeAxis ();
283  void slotDigitizeColorPicker ();
284  void slotDigitizeCurve ();
285  void slotDigitizePointMatch ();
286  void slotDigitizeScale ();
287  void slotDigitizeSegment ();
288  void slotDigitizeSelect ();
289  void slotEditCopy ();
290  void slotEditCut ();
291  void slotEditDelete ();
292  void slotEditMenu ();
293  void slotEditPaste ();
294  void slotEditPasteAsNew ();
295  void slotEditPasteAsNewAdvanced ();
296  void slotFileClose ();
297  void slotFileExport ();
298  void slotFileImport();
299  void slotFileImportAdvanced();
300  void slotFileImportDraggedImage(QImage);
301  void slotFileImportDraggedImageUrl(QUrl);
302  void slotFileImportImage(QString, QImage);
303  void slotFileImportImageReplace();
304  void slotFileOpen();
305  void slotFileOpenDraggedDigFile (QString);
306  void slotFilePrint();
307  bool slotFileSave();
308  bool slotFileSaveAs();
309  void slotFittingWindowClosed();
310  void slotFittingWindowCurveFit(FittingCurveCoefficients, double, double, bool, bool);
311  void slotGeometryWindowClosed();
312  void slotHelpAbout();
313  void slotHelpTutorial();
314  void slotKeyPress (Qt::Key, bool);
315  void slotLoadStartupFiles ();
316  void slotMouseMove (QPointF);
317  void slotMousePress (QPointF);
318  void slotMouseRelease (QPointF);
319  void slotRecentFileAction ();
320  void slotRecentFileClear ();
321  void slotRedoTextChanged (const QString &);
322  void slotSettingsAxesChecker ();
323  void slotSettingsColorFilter ();
324  void slotSettingsCoords ();
325  void slotSettingsCurveList ();
326  void slotSettingsCurveProperties ();
327  void slotSettingsDigitizeCurve ();
328  void slotSettingsExportFormat ();
329  void slotSettingsGeneral ();
330  void slotSettingsGridDisplay ();
331  void slotSettingsGridRemoval ();
332  void slotSettingsMainWindow ();
333  void slotSettingsPointMatch ();
334  void slotSettingsSegments ();
335  void slotTableStatusChange ();
336  void slotTimeoutRegressionErrorReport ();
337  void slotTimeoutRegressionFileCmdScript ();
338  void slotUndoTextChanged (const QString &);
339  void slotViewGridLines ();
340  void slotViewGroupBackground(QAction*);
341  void slotViewGroupCurves(QAction*);
342  void slotViewGroupStatus(QAction*);
343  void slotViewToolBarBackground ();
344  void slotViewToolBarChecklistGuide ();
345  void slotViewToolBarCoordSystem ();
346  void slotViewToolBarDigitize ();
347  void slotViewToolBarFittingWindow ();
348  void slotViewToolBarGeometryWindow ();
349  void slotViewToolBarSettingsViews ();
350  void slotViewToolTips ();
351  void slotViewZoomFactor (ZoomFactor);
352  void slotViewZoomFactorInt (int);
353  void slotViewZoom (int);
354  void slotViewZoomIn ();
355  void slotViewZoomInFromWheelEvent ();
356  void slotViewZoomOut ();
357  void slotViewZoomOutFromWheelEvent ();
358 
359 signals:
361  void signalDropRegression(QString);
362 
364  void signalZoom(int);
365 
366 private:
367  MainWindow();
368 
369  enum ImportType {
370  IMPORT_TYPE_SIMPLE,
371  IMPORT_TYPE_ADVANCED,
372  IMPORT_TYPE_IMAGE_REPLACE
373  };
374 
375  void addDockWindow (QDockWidget *dockWidget,
376  QSettings &settings,
377  const QString &settingsTokenArea,
378  const QString &settingsTokenGeometry,
379  Qt::DockWidgetArea dockWidgetArea);
380  void applyZoomFactorAfterLoad();
381  virtual void closeEvent(QCloseEvent *event);
382  ZoomFactor currentZoomFactor () const;
383 #if !defined(OSX_DEBUG) && !defined(OSX_RELEASE)
384  void exportAllCoordinateSystemsAfterRegressionTests();
385 #endif
386  QString exportRegressionFilenameFromInputFilename (const QString &fileName) const;
387  void fileExport(const QString &fileName,
388  ExportToFile exportStrategy);
389  void fileExtractImage (const QString &fileName);
390  void fileImport (const QString &fileName,
391  ImportType ImportType);
392  void fileImportWithPrompts (ImportType ImportType);
393  QString fileNameForExportOnly () const;
394  QString fileNameForExtractImageOnly () const;
395  void filePaste (ImportType importType);
396  void ghostsCreate ();
397  void ghostsDestroy ();
398  void handlerFileExtractImage ();
399  void loadCoordSystemListFromCmdMediator();
400  void loadCurveListFromCmdMediator();
401  void loadDocumentFile (const QString &fileName);
402  void loadErrorReportFile(const QString &errorReportFile);
403  bool loadImage (const QString &fileName,
404  const QImage &image,
405  ImportType ImportType);
406  bool loadImageNewDocument (const QString &fileName,
407  const QImage &image,
408  ImportType ImportType);
409  bool loadImageReplacingImage (const QString &fileName,
410  const QImage &image,
411  ImportType ImportType);
412  void loadInputFileForErrorReport(QDomDocument &domInputFile) const;
413  void loadToolTips ();
414  bool maybeSave();
415  DocumentModelExportFormat modelExportOverride (const DocumentModelExportFormat &modelExportFormatBefore,
416  const ExportToFile &exportStrategy,
417  const QString &selectedNameFilter) const;
418  bool modeGraph () const; // True if document is loaded and it has all graphs
419  void rebuildRecentFileListForCurrentFile(const QString &filePath);
420  bool saveDocumentFile(const QString &fileName);
421  QString saveErrorReportFileAndExitXml (const char *comment,
422  const char *file,
423  int line,
424  const char *context) const;
425  void saveStartingDocumentSnapshot();
426  void setCurrentFile(const QString &fileName);
427  void setCurrentPathFromFile (const QString &fileName);
428  void setNonFillZoomFactor (ZoomFactor newZoomFactor);
429  void setPixmap (const QString &curveSelected,
430  const QPixmap &pixmap);
431  void settingsRead (bool isReset);
432  void settingsReadEnvironment (QSettings &settings);
433  void settingsReadMainWindow (QSettings &settings);
434  void settingsWrite ();
435  bool setupAfterLoadNewDocument (const QString &fileName,
436  const QString &temporaryMessage,
437  ImportType ImportType);
438  bool setupAfterLoadReplacingImage (const QString &fileName,
439  const QString &temporaryMessage,
440  ImportType ImportType);
441  void startRegressionTestErrorReport (const QString &regressionInputFile);
442  void startRegressionDropTest (const QStringList &loadStartupFiles);
443  void startRegressionTestFileCmdScript ();
444  void updateAfterCommandStatusBarCoords ();
445  void updateChecklistGuide ();
446  void updateControls (); // Update the widgets (typically in terms of show/hide state) depending on the application state.
447  void updateFittingWindow ();
448  void updateGeometryWindow ();
449  void updateGridLines();
450  void updateHighlightOpacity();
451  void updateRecentFileList();
452  void updateSettingsMainWindow();
453  void updateSmallDialogs();
454  void updateTransformationAndItsDependencies();
455  void updateViewedCurves ();
456  void updateViewsOfSettings (); // Private version gets active curve name from DigitizeContext
457  void updateWindowTitle ();
458  void writeCheckpointToLogFile();
459 
460  QString m_originalFile; // Original filename for error report
461  bool m_originalFileWasImported; // True/false for imported/opened
462  bool m_isDocumentExported;
463  QString m_engaugeFile; // Not empty when a Document is currently loaded AND it was loaded and/or saved as an Engauge file
464  QString m_currentFile; // Not empty when a Document is currently loaded. No path or file extension
465  QString m_currentFileWithPathAndFileExtension; // Adds path and file extension to m_currentFile. For display
466  MainTitleBarFormat m_titleBarFormat;
467 
468  QMenu *m_menuFile;
469  QAction *m_actionImport;
470  QAction *m_actionImportAdvanced;
471  QAction *m_actionImportImageReplace;
472  QAction *m_actionOpen;
473  QMenu *m_menuFileOpenRecent;
474  QList<QAction*> m_actionRecentFiles;
475  QAction *m_actionClose;
476  QAction *m_actionSave;
477  QAction *m_actionSaveAs;
478  QAction *m_actionExport;
479  QAction *m_actionPrint;
480  QAction *m_actionExit;
481 
482  QMenu *m_menuEdit;
483  QAction *m_actionEditUndo;
484  QAction *m_actionEditRedo;
485  QAction *m_actionEditCut;
486  QAction *m_actionEditCopy;
487  QAction *m_actionEditPaste;
488  QAction *m_actionEditDelete;
489  QAction *m_actionEditPasteAsNew;
490  QAction *m_actionEditPasteAsNewAdvanced;
491 
492  QMenu *m_menuDigitize;
493  QActionGroup *m_groupDigitize;
494  QAction *m_actionDigitizeSelect;
495  QAction *m_actionDigitizeAxis;
496  QAction *m_actionDigitizeScale;
497  QAction *m_actionDigitizeCurve;
498  QAction *m_actionDigitizePointMatch;
499  QAction *m_actionDigitizeColorPicker;
500  QAction *m_actionDigitizeSegment;
501 
502  QMenu *m_menuView;
503  QAction *m_actionViewBackground;
504  QAction *m_actionViewChecklistGuide;
505  QAction *m_actionViewCoordSystem;
506  QAction *m_actionViewDigitize;
507  QAction *m_actionViewFittingWindow;
508  QAction *m_actionViewGeometryWindow;
509  QAction *m_actionViewSettingsViews;
510  QAction *m_actionViewToolTips;
511  QAction *m_actionViewGridLines;
512  QMenu *m_menuViewBackground;
513  QActionGroup *m_groupBackground;
514  QAction *m_actionViewBackgroundNone;
515  QAction *m_actionViewBackgroundOriginal;
516  QAction *m_actionViewBackgroundFiltered;
517  QMenu *m_menuViewCurves;
518  QActionGroup *m_groupCurves;
519  QAction *m_actionViewCurvesNone;
520  QAction *m_actionViewCurvesSelected;
521  QAction *m_actionViewCurvesAll;
522  QMenu *m_menuViewStatus;
523  QActionGroup *m_groupStatus;
524  QAction *m_actionStatusNever;
525  QAction *m_actionStatusTemporary;
526  QAction *m_actionStatusAlways;
527  QMenu *m_menuViewZoom;
528  QAction *m_actionZoomOut;
529  QAction *m_actionZoomIn;
530  QActionGroup *m_groupZoom;
531  QSignalMapper *m_mapperZoomFactor;
532  QAction *m_actionZoomFill;
533  QAction *m_actionZoom16To1;
534  QAction *m_actionZoom16To1Farther;
535  QAction *m_actionZoom8To1Closer;
536  QAction *m_actionZoom8To1;
537  QAction *m_actionZoom8To1Farther;
538  QAction *m_actionZoom4To1Closer;
539  QAction *m_actionZoom4To1;
540  QAction *m_actionZoom4To1Farther;
541  QAction *m_actionZoom2To1Closer;
542  QAction *m_actionZoom2To1;
543  QAction *m_actionZoom2To1Farther;
544  QAction *m_actionZoom1To1Closer;
545  QAction *m_actionZoom1To1;
546  QAction *m_actionZoom1To1Farther;
547  QAction *m_actionZoom1To2Closer;
548  QAction *m_actionZoom1To2;
549  QAction *m_actionZoom1To2Farther;
550  QAction *m_actionZoom1To4Closer;
551  QAction *m_actionZoom1To4;
552  QAction *m_actionZoom1To4Farther;
553  QAction *m_actionZoom1To8Closer;
554  QAction *m_actionZoom1To8;
555  QAction *m_actionZoom1To8Farther;
556  QAction *m_actionZoom1To16Closer;
557  QAction *m_actionZoom1To16;
558 
559  QMenu *m_menuSettings;
560  QAction *m_actionSettingsAxesChecker;
561  QAction *m_actionSettingsColorFilter;
562  QAction *m_actionSettingsCoords;
563  QAction *m_actionSettingsCurveList;
564  QAction *m_actionSettingsCurveProperties;
565  QAction *m_actionSettingsDigitizeCurve;
566  QAction *m_actionSettingsExport;
567  QAction *m_actionSettingsGeneral;
568  QAction *m_actionSettingsGridDisplay;
569  QAction *m_actionSettingsGridRemoval;
570  QAction *m_actionSettingsMainWindow;
571  QAction *m_actionSettingsPointMatch;
572  QAction *m_actionSettingsSegments;
573 
574  QMenu *m_menuHelp;
575  QAction *m_actionHelpAbout;
576  QAction *m_actionHelpChecklistGuideWizard;
577  QAction *m_actionHelpHelp;
578  QAction *m_actionHelpTutorial;
579  QAction *m_actionHelpWhatsThis;
580 
581  QVBoxLayout *m_layout;
582  GraphicsScene *m_scene;
583  GraphicsView *m_view;
584 
585  StatusBar *m_statusBar;
586  Transformation m_transformation;
587 
588  QComboBox *m_cmbCurve;
589  QToolBar *m_toolDigitize;
590  LoadImageFromUrl *m_loadImageFromUrl;
591 
592  QComboBox *m_cmbBackground;
593  QToolBar *m_toolBackground;
594 
595  ViewPointStyle *m_viewPointStyle;
596  ViewSegmentFilter *m_viewSegmentFilter;
597  QToolBar *m_toolSettingsViews;
598  ChecklistGuide *m_dockChecklistGuide;
599  FittingWindow *m_dockFittingWindow;
600  GeometryWindow *m_dockGeometryWindow;
601 
602  QComboBox *m_cmbCoordSystem;
603  QPushButton *m_btnPrintAll;
604  QPushButton *m_btnShowAll;
605  QToolBar *m_toolCoordSystem;
606 
607 #if !defined(OSX_DEBUG) && !defined(OSX_RELEASE)
608  HelpWindow *m_helpWindow;
609 #endif
610  TutorialDlg *m_tutorialDlg;
611 
612  CmdMediator *m_cmdMediator;
613  CmdStackShadow *m_cmdStackShadow;
614 
615  // State machine for user interface states
616  DigitizeStateContext *m_digitizeStateContext;
617 
618  // State machine for transformation states
619  TransformationStateContext *m_transformationStateContext;
620 
621  // State machine for background image
622  BackgroundStateContext *m_backgroundStateContext;
623 
624  DlgSettingsAxesChecker *m_dlgSettingsAxesChecker;
625  DlgSettingsColorFilter *m_dlgSettingsColorFilter;
626  DlgSettingsCoords *m_dlgSettingsCoords;
627  DlgSettingsCurveList *m_dlgSettingsCurveList;
628  DlgSettingsCurveProperties *m_dlgSettingsCurveProperties;
629  DlgSettingsDigitizeCurve *m_dlgSettingsDigitizeCurve;
630  DlgSettingsExportFormat *m_dlgSettingsExportFormat;
631  DlgSettingsGeneral *m_dlgSettingsGeneral;
632  DlgSettingsGridDisplay *m_dlgSettingsGridDisplay;
633  DlgSettingsGridRemoval *m_dlgSettingsGridRemoval;
634  DlgSettingsMainWindow *m_dlgSettingsMainWindow;
635  DlgSettingsPointMatch *m_dlgSettingsPointMatch;
636  DlgSettingsSegments *m_dlgSettingsSegments;
637 
638  // Crash reports
639  QString m_startingDocumentSnapshot; // Serialized snapshot of document at startup. Included in error report if user approves
640  NetworkClient *m_networkClient;
641 
642  // Main window settings
643  bool m_isGnuplot; // From command line
644  MainWindowModel m_modelMainWindow; // From settings file or DlgSettingsMainWindow
645 
646  // File names to be loaded at startup. Only one is loaded into the current instance, with external instances created for the other files
647  QTimer *m_timerLoadStartupFiles;
648  QStringList m_loadStartupFiles;
649 
650  // Command line arguments with load startup files omitted
651  QStringList m_commandLineWithoutLoadStartupFiles;
652 
653  // Ghosts that are created for seeing all coordinate systems at once, when there are multiple coordinate systems
654  Ghosts *m_ghosts;
655 
656  // Timers for regression testing. Neither or one is first started by the constructor for this class, but the first timeout
657  // (and all succeeding timeouts) will be from after QMainWindow::exec is called. Each timeout results in one command
658  // from the command stack getting executed
659  QTimer *m_timerRegressionErrorReport;
660  FileCmdScript *m_fileCmdScript;
661  bool m_isErrorReportRegressionTest;
662  QTimer *m_timerRegressionFileCmdScript;
663  QString m_regressionFile;
664  QString m_startupDirectory; // Used to restore original directory just before outputing regression test results, since
665  // directory changes when settings are read, and also when files are opened or imported.
666  // Restoring the directory means relative paths in the regression scripts will work consistently
667 
668  // Grid lines
669  GridLines m_gridLines;
670 
671  // Map to/from/between zoom enumerations. These eliminate the need for switch statements
672  QMap<ZoomFactorInitial, ZoomFactor> m_zoomMapFromInitial;
673  QMap<ZoomFactor, QAction*> m_zoomMapToAction;
674 
675  // Fitted curve. Null if not currently applicable/defined
676  FittingCurve *m_fittingCurve;
677 
678  // Export the single dig file that was loaded in the command line, as enforced by parseCmdLine
679  bool m_isExportOnly;
680 
681  // Extract the image from the single dig file that was loaded in the command line, as enforced by parseCmdLine
682  bool m_isExtractImageOnly;
683  QString m_extractImageOnlyExtension;
684 };
685 
686 #endif // MAIN_WINDOW_H
void updateCoordSystem(CoordSystemIndex coordSystemIndex)
Select a different CoordSystem.
Model for DlgSettingsGeneral and CmdSettingsGeneral.
Model for DlgSettingsPointMatch and CmdSettingsPointMatch.
void updateSettingsMainWindow(const MainWindowModel &modelMainWindow)
Update with new main window properties.
Model for DlgSettingsGridDisplay and CmdSettingsGridDisplay.
Class to create toolbars for MainWindow class.
void updateDigitizeStateIfSoftwareTriggered(DigitizeState digitizeState)
After software-triggered state transition, this method manually triggers the action as if user had cl...
Class to create actions for MainWindow class.
Definition: CreateActions.h:16
Class that displays the current Segment Filter in a MainWindow toolbar.
Class to create QDockWidget items for MainWindow class.
Dialog for editing Segments settings, for DigitizeStateSegment.
Model for DlgSettingsExportFormat and CmdSettingsExportFormat.
Dialog for editing point match settings, for DigitizeStatePointMatch.
Transformation transformation() const
Return read-only copy of transformation.
Context class for transformation state machine.
Model for DlgSettingsCurveProperties and CmdSettingsCurveProperties.
Definition: CurveStyles.h:22
Dockable help window.
Definition: HelpWindow.h:16
Class to create menus for MainWindow class.
Definition: CreateMenus.h:16
void updateAfterMouseRelease()
Call MainWindow::updateControls (which is private) after the very specific case - a mouse press/relea...
void saveErrorReportFileAndExit(const char *comment, const char *file, int line, const char *context)
Save error report and exit.
void cmdFileClose()
Close file. This is called from a file script command.
Definition: MainWindow.cpp:316
Class to create settings dialogs for MainWindow class.
Class to create state contexts, which wrap state machine design patterns, for MainWindow class...
Class to create zoom factor maps for MainWindow class.
bool modeMap() const
True if document scale is set using a scale bar, otherwise using axis points.
void updateViewsOfSettings(const QString &activeCurve)
Update curve-specific view of settings. Private version gets active curve name from DigitizeStateCont...
QString selectedGraphCurve() const
Curve name that is currently selected in m_cmbCurve.
Class for showing points and lines for all coordinate systems simultaneously, even though the code no...
Definition: Ghosts.h:26
Window that displays the geometry information, as a table, for the current curve. ...
void cmdFileOpen(const QString &fileName)
Open file. This is called from a file script command.
Definition: MainWindow.cpp:342
CmdMediator * cmdMediator()
Accessor for commands to process the Document.
Definition: MainWindow.cpp:350
Class to create LoadImageFromUrl for MainWindow class.
BackgroundImage selectOriginal(BackgroundImage backgroundImage)
Make original background visible, for DigitizeStateColorPicker.
Dialog for editing grid removal settings.
Dialog for editing exporting settings.
Class to create QGraphicsScene for MainWindow class.
Definition: CreateScene.h:16
Unit test of Export classes.
Definition: TestExport.h:16
void showTemporaryMessage(const QString &temporaryMessage)
Show temporary message in status bar.
Class to TutorialDlg for MainWindow class.
void updateSettingsDigitizeCurve(const DocumentModelDigitizeCurve &modelDigitizeCurve)
Update with new curve digitization styles.
Tutorial using a strategy like a comic strip with decision points deciding which panels appear...
Definition: TutorialDlg.h:19
void cmdFileExport(const QString &fileName)
Export file. This is called from a file script command.
Definition: MainWindow.cpp:324
Class to create status bar for MainWindow class.
Strategy class for exporting to a file. This strategy is external to the Document class so that class...
Definition: ExportToFile.h:25
Dockable text window containing checklist guide.
Class to create help window for MainWindow class.
Model for DlgSettingsDigitizeCurve and CmdSettingsDigitizeCurve.
GraphicsView & view()
View for the QImage and QGraphicsItems, without const.
Affine transformation between screen and graph coordinates, based on digitized axis points...
Dialog for editing filtering settings.
Container for all graph curves. The axes point curve is external to this class.
Definition: CurvesGraphs.h:24
Model for DlgSettingsColorFilter and CmdSettingsColorFilter.
Wrapper around QStatusBar to manage permanent widgets.
Definition: StatusBar.h:24
GraphicsScene & scene()
Scene container for the QImage and QGraphicsItems.
void updateSettingsGridDisplay(const DocumentModelGridDisplay &modelGridDisplay)
Update with new grid display properties.
void updateSettingsCurveStyles(const CurveStyles &modelCurveStyles)
Update with new curve styles.
Client for interacting with Engauge server.
Definition: NetworkClient.h:16
Context class that manages the background image state machine.
Facade class that wraps around all of the create classes for MainWindow.
Definition: CreateFacade.h:16
QGraphicsView class with event handling added. Typically the events are sent to the active digitizing...
Definition: GraphicsView.h:20
Container for all DigitizeStateAbstractBase subclasses. This functions as the context class in a stan...
Model for DlgSettingsMainWindow.
Container class for GridLine objects.
Definition: GridLines.h:18
Dialog for editing general settings.
void signalDropRegression(QString)
Send drag and drop regression test url.
Class to the central QWidget for MainWindow class.
Model for DlgSettingsCoords and CmdSettingsCoords.
void updateAfterCommand()
See GraphicsScene::updateAfterCommand.
Curve that overlays the current scene so the regression-fitted curve is visible.
Definition: FittingCurve.h:16
void updateSettingsColorFilter(const DocumentModelColorFilter &modelColorFilter)
Update with new color filter properties.
Dialog for editing grid display settings.
Dialog for editing DigitizeStateCurve settings.
void updateSettingsAxesChecker(const DocumentModelAxesChecker &modelAxesChecker)
Update with new axes indicator properties.
void updateSettingsPointMatch(const DocumentModelPointMatch &modelPointMatch)
Update with new point match properties.
void updateSettingsGeneral(const DocumentModelGeneral &modelGeneral)
Update with new general properties.
QImage imageFiltered() const
Background image that has been filtered for the current curve. This asserts if a curve-specific image...
Definition: MainWindow.cpp:834
void updateSettingsGridRemoval(const DocumentModelGridRemoval &modelGridRemoval)
Update with new grid removal properties.
Class that displays a view of the current Curve&#39;s point style.
Dialog for editing main window settings, which are entirely independent of all documents.
Model for DlgSettingsAxesChecker and CmdSettingsAxesChecker.
Command stack that shadows the CmdMediator command stack at startup when reading commands from an err...
void updateSettingsExportFormat(const DocumentModelExportFormat &modelExport)
Update with new export properties.
Dialog for editing coordinates settings.
Load QImage from url. This is trivial for a file, but requires an asynchronous download step for http...
virtual bool eventFilter(QObject *, QEvent *)
Catch secret keypresses.
Definition: MainWindow.cpp:371
bool isGnuplot() const
Get method for gnuplot flag.
Definition: MainWindow.cpp:839
Dialog for editing curve properties settings.
Command queue stack.
Definition: CmdMediator.h:23
void signalZoom(int)
Send zoom selection, picked from menu or keystroke, to StatusBar.
Model for DlgSettingsSegments and CmdSettingsSegments.
void cmdFileImport(const QString &fileName)
Import file. This is called from a file script command.
Definition: MainWindow.cpp:333
void resizeEvent(QResizeEvent *event)
Intercept resize event so graphics scene can be appropriately resized when in Fill mode...
void updateSettingsCoords(const DocumentModelCoords &modelCoords)
Update with new coordinate properties.
File that manages a command stack for regression testing of file import/open/export/close.
Definition: FileCmdScript.h:20
Add point and line handling to generic QGraphicsScene.
Definition: GraphicsScene.h:36
Window that displays curve fitting as applied to the currently selected curve.
Definition: FittingWindow.h:34
Model for DlgSettingsGridRemoval and CmdSettingsGridRemoval. The settings are unstable until the user...
Class to create CmdStackShadow for MainWindow class.
void updateSettingsSegments(const DocumentModelSegments &modelSegments)
Update with new segments properties.
Dialog for editing curve names settings.
Dialog for editing axes checker settings.
void updateGraphicsLinesToMatchGraphicsPoints()
Update the graphics lines so they follow the graphics points, after a drag, addition, removal, and such.
Class to create network for MainWindow class.
Definition: CreateNetwork.h:16
Main window consisting of menu, graphics scene, status bar and optional toolbars as a Single Document...
Definition: MainWindow.h:91
MainWindowModel modelMainWindow() const
Get method for main window model.
Class to create icons for MainWindow class.
Definition: CreateIcons.h:16
virtual void showEvent(QShowEvent *)
Processing performed after gui becomes available.
bool transformIsDefined() const
Return true if all three axis points have been defined.
void updateSettingsCurveList(const CurvesGraphs &curvesGraphs)
Update with new curves.