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