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 "MainWindowModel.h"
18#include <QCursor>
19#include <QMainWindow>
20#include <QMap>
21#include <QPointF>
22#include <QUrl>
23#include "Transformation.h"
24#include "ZoomControl.h"
25#include "ZoomFactor.h"
26#include "ZoomFactorInitial.h"
27
29class ChecklistGuide;
30class CmdMediator;
31class CmdStackShadow;
32class CurveStyles;
58class ExportToFile;
59class FileCmdScript;
60class FittingCurve;
61class FittingWindow;
62class GeometryWindow;
63class Ghosts;
64class GraphicsScene;
65class GraphicsView;
66#if !defined(OSX_DEBUG) && !defined(OSX_RELEASE)
67class HelpWindow;
68#endif
70class NetworkClient;
71class QAction;
72class QActionGroup;
73class QCloseEvent;
74class QComboBox;
75class QDomDocument;
76class QGraphicsLineItem;
77class QGridLayout;
78class QMenu;
79class QPushButton;
80class QSettings;
81class QSignalMapper;
82class QTextStream;
83class QTimer;
84class QToolBar;
85class StatusBar;
87class TutorialDlg;
88class ViewPointStyle;
90
91extern const unsigned int MAX_RECENT_FILE_LIST_SIZE;
92
94class MainWindow : public QMainWindow
95{
96 Q_OBJECT
97
99 friend class CreateActions;
103 friend class CreateFacade;
104 friend class CreateHelpWindow;
105 friend class CreateIcons;
106 friend class CreateLoadImage;
107 friend class CreateMenus;
108 friend class CreateNetwork;
109 friend class CreateScene;
112 friend class CreateStatusBar;
113 friend class CreateToolBars;
114 friend class CreateTutorial;
115 friend class CreateZoomMaps;
116
118 friend class TestExport;
119 friend class TestGuidelines;
120
121public:
135 MainWindow(const QString &errorReportFile,
136 const QString &fileCmdScriptFile,
137 bool isDropRegression,
138 bool isRegressionTest,
139 bool isGnuplot,
140 bool isReset,
141 bool isExportOnly,
142 bool isExtractImageOnly,
143 const QString &extractImageOnlyExtension,
144 const QStringList &loadStartupFiles,
145 const QStringList &commandLineWithoutLoadStartupFiles,
146 QWidget *parent = nullptr);
147 ~MainWindow();
148
150 void cmdFileClose();
151
153 void cmdFileExport(const QString &fileName);
154
156 void cmdFileImport(const QString &fileName);
157
159 void cmdFileOpen(const QString &fileName);
160
163
166
168 virtual bool eventFilter(QObject *, QEvent *);
169
171 void guidelineAddXT (const QString &identifier,
172 double xT);
173
175 void guidelineAddYR (const QString &identifier,
176 double yR);
177
179 void guidelineMoveXT (const QString &identifier,
180 double xTAfter);
181
183 void guidelineMoveYR (const QString &identifier,
184 double yRAfter);
185
187 void guidelineRemove (const QString &identifier);
188
190 bool guidelinesAreVisible () const;
191
193 void handleGuidelinesActiveChange (bool active);
194
196 QImage imageFiltered () const;
197
199 bool isGnuplot() const;
200
203
205 bool modeMap () const;
206
208 void resizeEvent (QResizeEvent *event);
209
211 void saveErrorReportFileAndExit(const char *comment,
212 const char *file,
213 int line,
214 const char *context);
215
218
222
224 QString selectedGraphCurve () const;
225
227 void sendGong ();
228
230 virtual void showEvent(QShowEvent *);
231
233 void showTemporaryMessage (const QString &temporaryMessage);
234
237
239 bool transformIsDefined() const;
240
242 void updateAfterCommand();
243
246
248 void updateCoordSystem(CoordSystemIndex coordSystemIndex);
249
252
256
258 void updateSettingsAxesChecker(const DocumentModelAxesChecker &modelAxesChecker);
259
261 void updateSettingsColorFilter(const DocumentModelColorFilter &modelColorFilter);
262
264 void updateSettingsCoords(const DocumentModelCoords &modelCoords);
265
267 void updateSettingsCurveList (const CurvesGraphs &curvesGraphs);
268
270 void updateSettingsCurveStyles(const CurveStyles &modelCurveStyles);
271
273 void updateSettingsDigitizeCurve(const DocumentModelDigitizeCurve &modelDigitizeCurve);
274
277
279 void updateSettingsGeneral(const DocumentModelGeneral &modelGeneral);
280
282 void updateSettingsGridDisplay(const DocumentModelGridDisplay &modelGridDisplay);
283
285 void updateSettingsGridRemoval(const DocumentModelGridRemoval &modelGridRemoval);
286
288 void updateSettingsGuideline (const DocumentModelGuideline &modelGuideline);
289
292
294 void updateSettingsPointMatch(const DocumentModelPointMatch &modelPointMatch);
295
297 void updateSettingsSegments(const DocumentModelSegments &modelSegments);
298
300 void updateViewsOfSettings (const QString &activeCurve);
301
303 GraphicsView &view ();
304
306 const GraphicsView &view () const;
307
308private slots:
309 void slotBtnPrintAll();
310 void slotBtnShowAllPressed();
311 void slotBtnShowAllReleased();
312 void slotCanRedoChanged (bool);
313 void slotCanUndoChanged (bool);
314 void slotChecklistClosed ();
315 void slotCleanChanged (bool);
316 void slotCmbBackground(int);
317 void slotCmbCoordSystem(int);
318 void slotCmbCurve(int);
319 void slotContextMenuEventAxis (QString);
320 void slotContextMenuEventGraph (QStringList);
321 void slotDigitizeAxis ();
322 void slotDigitizeColorPicker ();
323 void slotDigitizeCurve ();
324 void slotDigitizeGuidelines ();
325 void slotDigitizePointMatch ();
326 void slotDigitizeScale ();
327 void slotDigitizeSegment ();
328 void slotDigitizeSelect ();
329 void slotEditCopy ();
330 void slotEditCut ();
331 void slotEditDelete ();
332 void slotEditMenu ();
333 void slotEditPaste ();
334 void slotEditPasteAsNew ();
335 void slotEditPasteAsNewAdvanced ();
336 void slotFileClose ();
337 void slotFileExport ();
338 void slotFileImport();
339 void slotFileImportAdvanced();
340 void slotFileImportDraggedImage(QImage);
341 void slotFileImportDraggedImageUrl(QUrl);
342 void slotFileImportImage(QString, QImage);
343 void slotFileImportImageReplace();
344 void slotFileOpen();
345 void slotFileOpenDraggedDigFile (QString);
346 void slotFilePrint();
347 bool slotFileSave();
348 bool slotFileSaveAs();
349 void slotFittingWindowClosed();
350 void slotFittingWindowCurveFit(FittingCurveCoefficients, double, double, bool, bool);
351 void slotGeometryWindowClosed();
352 void slotGuidelineDragged(QString, double, bool, GuidelineState);
353 void slotHelpAbout();
354 void slotHelpTutorial();
355 void slotKeyPress (Qt::Key, bool);
356 void slotLoadStartupFiles ();
357 void slotMouseMove (QPointF);
358 void slotMousePress (QPointF);
359 void slotMouseRelease (QPointF);
360 void slotRecentFileAction ();
361 void slotRecentFileClear ();
362 void slotRedoTextChanged (const QString &);
363 void slotSettingsAxesChecker ();
364 void slotSettingsColorFilter ();
365 void slotSettingsCoords ();
366 void slotSettingsCurveList ();
367 void slotSettingsCurveProperties ();
368 void slotSettingsDigitizeCurve ();
369 void slotSettingsExportFormat ();
370 void slotSettingsGeneral ();
371 void slotSettingsGridDisplay ();
372 void slotSettingsGridRemoval ();
373 void slotSettingsGuideline ();
374 void slotSettingsMainWindow ();
375 void slotSettingsPointMatch ();
376 void slotSettingsSegments ();
377 void slotTableStatusChange ();
378 void slotTimeoutChecklistGuideWizard ();
379 void slotTimeoutRegressionErrorReport ();
380 void slotTimeoutRegressionFileCmdScript ();
381 void slotUndoTextChanged (const QString &);
382 void slotViewGridLines ();
383 void slotViewGroupBackground(QAction*);
384 void slotViewGroupCurves(QAction*);
385 void slotViewGroupStatus(QAction*);
386 void slotViewGuidelines ();
387 void slotViewToolBarBackground ();
388 void slotViewToolBarCoordSystem ();
389 void slotViewToolBarDigitize ();
390 void slotViewWindowChecklistGuide ();
391 void slotViewWindowFitting ();
392 void slotViewWindowGeometry ();
393 void slotViewToolBarSettingsViews ();
394 void slotViewToolTips ();
395 void slotViewZoomFactor (ZoomFactor);
396 void slotViewZoomFactorInt (int);
397 void slotViewZoom (int);
398 void slotViewZoomIn ();
399 void slotViewZoomInFromWheelEvent ();
400 void slotViewZoomOut ();
401 void slotViewZoomOutFromWheelEvent ();
402
403signals:
404
406 void signalDropRegression(QString);
407
409 void signalGong ();
410
412 void signalZoom(int);
413
414private:
415 MainWindow();
416
417 enum ImportType {
418 IMPORT_TYPE_SIMPLE,
419 IMPORT_TYPE_ADVANCED,
420 IMPORT_TYPE_IMAGE_REPLACE
421 };
422
423 void addDockWindow (QDockWidget *dockWidget,
424 QSettings &settings,
425 const QString &settingsTokenArea,
426 const QString &settingsTokenGeometry,
427 Qt::DockWidgetArea dockWidgetArea);
428 void applyZoomFactorAfterLoad();
429 virtual void closeEvent(QCloseEvent *event);
430 ZoomFactor currentZoomFactor () const;
431#if !defined(OSX_DEBUG) && !defined(OSX_RELEASE)
432 void exportAllCoordinateSystemsAfterRegressionTests();
433#endif
434 QString exportRegressionFilenameFromInputFilename (const QString &fileName) const;
435 void fileExport(const QString &fileName,
436 ExportToFile exportStrategy);
437 void fileExtractImage (const QString &fileName);
438 void fileImport (const QString &fileName,
439 ImportType ImportType);
440 void fileImportWithPrompts (ImportType ImportType);
441 QString fileNameForExportOnly () const;
442 QString fileNameForExtractImageOnly () const;
443 void filePaste (ImportType importType);
444 void ghostsCreate ();
445 void ghostsDestroy ();
446 void guidelineAddXTEnqueue (double value);
447 void guidelineAddYREnqueue (double value);
448 void guidelineMoveXTEnqueue (double valueBefore,
449 double valueAfter);
450 void guidelineMoveYREnqueue (double valueBefore,
451 double valueAfter);
452 void guidelineRemoveXTEnqueue (double value);
453 void guidelineRemoveYREnqueue (double value);
454 Guidelines &guidelines ();
455 void handleGuidelineMode();
456 void handlerFileExtractImage ();
457 void loadCoordSystemListFromCmdMediator();
458 void loadCurveListFromCmdMediator();
459 void loadDocumentFile (const QString &fileName);
460 void loadErrorReportFile(const QString &errorReportFile);
461 void loadGuidelinesFromCmdMediator();
462 bool loadImage (const QString &fileName,
463 const QImage &image,
464 ImportType ImportType);
465 bool loadImageNewDocument (const QString &fileName,
466 const QImage &image,
467 ImportType ImportType);
468 bool loadImageReplacingImage (const QString &fileName,
469 const QImage &image,
470 ImportType ImportType);
471 void loadInputFileForErrorReport(QDomDocument &domInputFile) const;
472 void loadToolTips ();
473 void loadViewsLoad (); // Apply the views settings as appropriate just after loading
474 void loadViewsSave (); // Save the current views settings just before saving
475 bool maybeSave();
476 QString messageCannotReadFile (const QString &fileName) const;
477 bool modeGraph () const; // True if document is loaded and it has all graphs
478 void rebuildRecentFileListForCurrentFile(const QString &filePath);
479 bool saveDocumentFile(const QString &fileName);
480 QString saveErrorReportFileAndExitXml (const char *comment,
481 const char *file,
482 int line,
483 const char *context) const;
484 void saveStartingDocumentSnapshot();
485 void setCurrentFile(const QString &fileName);
486 void setCurrentPathFromFile (const QString &fileName);
487 void setNonFillZoomFactor (ZoomFactor newZoomFactor);
488 void setPixmap (const QString &curveSelected,
489 const QPixmap &pixmap);
490 void settingsRead (bool isReset);
491 void settingsReadEnvironment (QSettings &settings);
492 void settingsReadMainWindow (QSettings &settings);
493 void settingsWrite ();
494 bool setupAfterLoadNewDocument (const QString &fileName,
495 const QString &temporaryMessage,
496 ImportType ImportType);
497 bool setupAfterLoadReplacingImage (const QString &fileName,
498 const QString &temporaryMessage,
499 ImportType ImportType);
500 void startRegressionTestErrorReport (const QString &regressionInputFile);
501 void startRegressionDropTest (const QStringList &loadStartupFiles);
502 void startRegressionTestFileCmdScript ();
503 void updateAfterCommandStatusBarCoords ();
504 void updateChecklistGuide ();
505 void updateControls (); // Update the widgets (typically in terms of show/hide state) depending on the application state.
506 void updateFittingWindow ();
507 void updateGeometryWindow ();
508 void updateGridLines();
509 void updateGuidelines();
510 void updateHighlightOpacity();
511 void updateRecentFileList();
513 void updateSmallDialogs();
514 void updateTransformationAndItsDependencies();
515 void updateViewedCurves ();
516 void updateViewsOfSettings (); // Private version gets active curve name from DigitizeContext
517 void updateWindowTitle ();
518 void writeCheckpointToLogFile();
519
520 QString m_originalFile; // Original filename for error report
521 bool m_originalFileWasImported; // True/false for imported/opened
522 bool m_isDocumentExported;
523 QString m_engaugeFile; // Not empty when a Document is currently loaded AND it was loaded and/or saved as an Engauge file
524 QString m_currentFile; // Not empty when a Document is currently loaded. No path or file extension
525 QString m_currentFileWithPathAndFileExtension; // Adds path and file extension to m_currentFile. For display
526 MainTitleBarFormat m_titleBarFormat;
527
528 QMenu *m_menuFile;
529 QAction *m_actionImport;
530 QAction *m_actionImportAdvanced;
531 QAction *m_actionImportImageReplace;
532 QAction *m_actionOpen;
533 QMenu *m_menuFileOpenRecent;
534 QList<QAction*> m_actionRecentFiles;
535 QAction *m_actionClose;
536 QAction *m_actionSave;
537 QAction *m_actionSaveAs;
538 QAction *m_actionExport;
539 QAction *m_actionPrint;
540 QAction *m_actionExit;
541
542 QMenu *m_menuEdit;
543 QAction *m_actionEditUndo;
544 QAction *m_actionEditRedo;
545 QAction *m_actionEditCut;
546 QAction *m_actionEditCopy;
547 QAction *m_actionEditPaste;
548 QAction *m_actionEditDelete;
549 QAction *m_actionEditPasteAsNew;
550 QAction *m_actionEditPasteAsNewAdvanced;
551
552 QMenu *m_menuDigitize;
553 QActionGroup *m_groupDigitize;
554 QAction *m_actionDigitizeSelect;
555 QAction *m_actionDigitizeAxis;
556 QAction *m_actionDigitizeScale;
557 QAction *m_actionDigitizeCurve;
558 QAction *m_actionDigitizeGuideline;
559 QAction *m_actionDigitizePointMatch;
560 QAction *m_actionDigitizeColorPicker;
561 QAction *m_actionDigitizeSegment;
562
563 QMenu *m_menuView;
564 QAction *m_actionViewBackgroundToolBar;
565 QAction *m_actionViewChecklistGuideWindow;
566 QAction *m_actionViewCoordSystemToolBar;
567 QAction *m_actionViewDigitizeToolBar;
568 QAction *m_actionViewFittingWindow;
569 QAction *m_actionViewGeometryWindow;
570 QAction *m_actionViewSettingsViewsToolBar;
571 QAction *m_actionViewToolTips;
572 QAction *m_actionViewGridLines;
573 QAction *m_actionViewGuidelines;
574 QMenu *m_menuViewBackground;
575 QActionGroup *m_groupBackground;
576 QAction *m_actionViewBackgroundNone;
577 QAction *m_actionViewBackgroundOriginal;
578 QAction *m_actionViewBackgroundFiltered;
579 QMenu *m_menuViewCurves;
580 QActionGroup *m_groupCurves;
581 QAction *m_actionViewCurvesNone;
582 QAction *m_actionViewCurvesSelected;
583 QAction *m_actionViewCurvesAll;
584 QMenu *m_menuViewGuidelines;
585 QMenu *m_menuViewStatus;
586 QActionGroup *m_groupStatus;
587 QAction *m_actionStatusNever;
588 QAction *m_actionStatusTemporary;
589 QAction *m_actionStatusAlways;
590 QMenu *m_menuViewZoom;
591 QAction *m_actionZoomOut;
592 QAction *m_actionZoomIn;
593 QActionGroup *m_groupZoom;
594 QSignalMapper *m_mapperZoomFactor;
595 QAction *m_actionZoomFill;
596 QAction *m_actionZoom16To1;
597 QAction *m_actionZoom16To1Farther;
598 QAction *m_actionZoom8To1Closer;
599 QAction *m_actionZoom8To1;
600 QAction *m_actionZoom8To1Farther;
601 QAction *m_actionZoom4To1Closer;
602 QAction *m_actionZoom4To1;
603 QAction *m_actionZoom4To1Farther;
604 QAction *m_actionZoom2To1Closer;
605 QAction *m_actionZoom2To1;
606 QAction *m_actionZoom2To1Farther;
607 QAction *m_actionZoom1To1Closer;
608 QAction *m_actionZoom1To1;
609 QAction *m_actionZoom1To1Farther;
610 QAction *m_actionZoom1To2Closer;
611 QAction *m_actionZoom1To2;
612 QAction *m_actionZoom1To2Farther;
613 QAction *m_actionZoom1To4Closer;
614 QAction *m_actionZoom1To4;
615 QAction *m_actionZoom1To4Farther;
616 QAction *m_actionZoom1To8Closer;
617 QAction *m_actionZoom1To8;
618 QAction *m_actionZoom1To8Farther;
619 QAction *m_actionZoom1To16Closer;
620 QAction *m_actionZoom1To16;
621
622 QMenu *m_menuSettings;
623 QAction *m_actionSettingsAxesChecker;
624 QAction *m_actionSettingsColorFilter;
625 QAction *m_actionSettingsCoords;
626 QAction *m_actionSettingsCurveList;
627 QAction *m_actionSettingsCurveProperties;
628 QAction *m_actionSettingsDigitizeCurve;
629 QAction *m_actionSettingsExport;
630 QAction *m_actionSettingsGeneral;
631 QAction *m_actionSettingsGridDisplay;
632 QAction *m_actionSettingsGridRemoval;
633 QAction *m_actionSettingsGuideline;
634 QAction *m_actionSettingsMainWindow;
635 QAction *m_actionSettingsPointMatch;
636 QAction *m_actionSettingsSegments;
637
638 QMenu *m_menuHelp;
639 QAction *m_actionHelpAbout;
640 QAction *m_actionHelpChecklistGuideWizard;
641 QAction *m_actionHelpHelp;
642 QAction *m_actionHelpTutorial;
643 QAction *m_actionHelpWhatsThis;
644
645 QGridLayout *m_layout;
646 GraphicsScene *m_scene;
647 GraphicsView *m_view;
648
649 StatusBar *m_statusBar;
650 Transformation m_transformation;
651
652 QComboBox *m_cmbCurve;
653 QToolBar *m_toolDigitize;
654 LoadImageFromUrl *m_loadImageFromUrl;
655
656 QComboBox *m_cmbBackground;
657 QToolBar *m_toolBackground;
658
659 ViewPointStyle *m_viewPointStyle;
660 ViewSegmentFilter *m_viewSegmentFilter;
661 QToolBar *m_toolSettingsViews;
662 ChecklistGuide *m_dockChecklistGuide;
663 FittingWindow *m_dockFittingWindow;
664 GeometryWindow *m_dockGeometryWindow;
665
666 QComboBox *m_cmbCoordSystem;
667 QPushButton *m_btnPrintAll;
668 QPushButton *m_btnShowAll;
669 QToolBar *m_toolCoordSystem;
670
671#if !defined(OSX_DEBUG) && !defined(OSX_RELEASE)
672 HelpWindow *m_helpWindow;
673#endif
674 TutorialDlg *m_tutorialDlg;
675
676 CmdMediator *m_cmdMediator;
677 CmdStackShadow *m_cmdStackShadow;
678
679 // State machine for user interface states
680 DigitizeStateContext *m_digitizeStateContext;
681
682 // State machine for transformation states
683 TransformationStateContext *m_transformationStateContext;
684
685 // State machine for background image
686 BackgroundStateContext *m_backgroundStateContext;
687
688 DlgSettingsAxesChecker *m_dlgSettingsAxesChecker;
689 DlgSettingsColorFilter *m_dlgSettingsColorFilter;
690 DlgSettingsCoords *m_dlgSettingsCoords;
691 DlgSettingsCurveList *m_dlgSettingsCurveList;
692 DlgSettingsCurveProperties *m_dlgSettingsCurveProperties;
693 DlgSettingsDigitizeCurve *m_dlgSettingsDigitizeCurve;
694 DlgSettingsExportFormat *m_dlgSettingsExportFormat;
695 DlgSettingsGeneral *m_dlgSettingsGeneral;
696 DlgSettingsGridDisplay *m_dlgSettingsGridDisplay;
697 DlgSettingsGridRemoval *m_dlgSettingsGridRemoval;
698 DlgSettingsGuideline *m_dlgSettingsGuideline;
699 DlgSettingsMainWindow *m_dlgSettingsMainWindow;
700 DlgSettingsPointMatch *m_dlgSettingsPointMatch;
701 DlgSettingsSegments *m_dlgSettingsSegments;
702
703 // Crash reports
704 QString m_startingDocumentSnapshot; // Serialized snapshot of document at startup. Included in error report if user approves
705 NetworkClient *m_networkClient;
706
707 // Main window settings
708 bool m_isGnuplot; // From command line
709 MainWindowModel m_modelMainWindow; // From settings file or DlgSettingsMainWindow
710
711 // File names to be loaded at startup. Only one is loaded into the current instance, with external instances created for the other files
712 QTimer *m_timerLoadStartupFiles;
713 QStringList m_loadStartupFiles;
714
715 // Command line arguments with load startup files omitted
716 QStringList m_commandLineWithoutLoadStartupFiles;
717
718 // Ghosts that are created for seeing all coordinate systems at once, when there are multiple coordinate systems
719 Ghosts *m_ghosts;
720
721 // Timers for regression testing. Neither or one is first started by the constructor for this class, but the first timeout
722 // (and all succeeding timeouts) will be from after QMainWindow::exec is called. Each timeout results in one command
723 // from the command stack getting executed
724 QTimer *m_timerRegressionErrorReport;
725 FileCmdScript *m_fileCmdScript;
726 bool m_isErrorReportRegressionTest;
727 QTimer *m_timerRegressionFileCmdScript;
728 QString m_regressionFile;
729 QString m_startupDirectory; // Used to restore original directory just before outputing regression test results, since
730 // directory changes when settings are read, and also when files are opened or imported.
731 // Restoring the directory means relative paths in the regression scripts will work consistently
732
733 // Grid lines
734 GridLines m_gridLines;
735
736 // Guidelines that are effectively invisible until cursor gets to outermost pixels in scene (and view if zoomed out
737 // enough that there is no scroll bar)
738 Guidelines m_guidelines;
739
740 // Map to/from/between zoom enumerations. These eliminate the need for switch statements
741 QMap<ZoomFactorInitial, ZoomFactor> m_zoomMapFromInitial;
742 QMap<ZoomFactor, QAction*> m_zoomMapToAction;
743
744 // Fitted curve. Null if not currently applicable/defined
745 FittingCurve *m_fittingCurve;
746
747 // Export the single dig file that was loaded in the command line, as enforced by parseCmdLine
748 bool m_isExportOnly;
749
750 // Extract the image from the single dig file that was loaded in the command line, as enforced by parseCmdLine
751 bool m_isExtractImageOnly;
752 QString m_extractImageOnlyExtension;
753
754 // Timer for delayed execution of ChecklistGuideWizard after call to import handler
755 QTimer *m_timerChecklistGuideWizard;
756};
757
758#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.
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 guideline 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.
Model for managing the coordinate values corresponding Guidelines.
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
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:114
friend class CreateIcons
Definition MainWindow.h:105
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.
friend class CreateToolBars
Definition MainWindow.h:113
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:112
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:104
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:106
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:110
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:118
void cmdFileExport(const QString &fileName)
Export file. This is called from a file script command.
friend class CreateFacade
Definition MainWindow.h:103
friend class CreateMenus
Definition MainWindow.h:107
friend class TestGuidelines
Definition MainWindow.h:119
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:100
void cmdFileClose()
Close file. This is called from a file script command.
friend class CreateDockableWidgets
Definition MainWindow.h:102
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:99
friend class CreateZoomMaps
Definition MainWindow.h:115
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.
DigitizeState digitizeState() const
Get DigitizeState. This should only be used to populate arguments in CmdAbstract constructor!
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:109
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:101
Transformation transformation() const
Return read-only copy of transformation.
friend class CreateNetwork
Definition MainWindow.h:108
friend class CreateStateContexts
Definition MainWindow.h:111
void updateSettingsColorFilter(const DocumentModelColorFilter &modelColorFilter)
Update with new color filter properties.
void updateCoordSystem(CoordSystemIndex coordSystemIndex)
Select a different CoordSystem.
void updateSettingsGuideline(const DocumentModelGuideline &modelGuideline)
Update with new guideline properties.
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.