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" 18 #include <QMainWindow> 21 #include "Transformation.h" 22 #include "ZoomControl.h" 23 #include "ZoomFactor.h" 24 #include "ZoomFactorInitial.h" 63 #if !defined(OSX_DEBUG) && !defined(OSX_RELEASE) 73 class QGraphicsLineItem;
88 extern const unsigned int MAX_RECENT_FILE_LIST_SIZE;
131 const QString &fileCmdScriptFile,
132 bool isRegressionTest,
136 bool isExtractImageOnly,
137 const QString &extractImageOnlyExtension,
138 const QStringList &loadStartupFiles,
139 const QStringList &commandLineWithoutLoadStartupFiles,
140 QWidget *parent = 0);
180 const char *context);
269 void slotBtnPrintAll();
270 void slotBtnShowAllPressed();
271 void slotBtnShowAllReleased();
272 void slotCanRedoChanged (
bool);
273 void slotCanUndoChanged (
bool);
274 void slotChecklistClosed ();
275 void slotCleanChanged (
bool);
276 void slotCmbBackground(
int);
277 void slotCmbCoordSystem(
int);
278 void slotCmbCurve(
int);
279 void slotContextMenuEventAxis (QString);
280 void slotContextMenuEventGraph (QStringList);
281 void slotDigitizeAxis ();
282 void slotDigitizeColorPicker ();
283 void slotDigitizeCurve ();
284 void slotDigitizePointMatch ();
285 void slotDigitizeScale ();
286 void slotDigitizeSegment ();
287 void slotDigitizeSelect ();
288 void slotEditCopy ();
290 void slotEditDelete ();
291 void slotEditMenu ();
292 void slotEditPaste ();
293 void slotEditPasteAsNew ();
294 void slotEditPasteAsNewAdvanced ();
295 void slotFileClose ();
296 void slotFileExport ();
297 void slotFileImport();
298 void slotFileImportAdvanced();
299 void slotFileImportDraggedImage(QImage);
300 void slotFileImportDraggedImageUrl(QUrl);
301 void slotFileImportImage(QString, QImage);
302 void slotFileImportImageReplace();
304 void slotFileOpenDraggedDigFile (QString);
305 void slotFilePrint();
307 bool slotFileSaveAs();
308 void slotFittingWindowClosed();
309 void slotFittingWindowCurveFit(FittingCurveCoefficients,
double,
double,
bool,
bool);
310 void slotGeometryWindowClosed();
311 void slotHelpAbout();
312 void slotHelpTutorial();
313 void slotKeyPress (Qt::Key,
bool);
314 void slotLoadStartupFiles ();
315 void slotMouseMove (QPointF);
316 void slotMousePress (QPointF);
317 void slotMouseRelease (QPointF);
318 void slotRecentFileAction ();
319 void slotRecentFileClear ();
320 void slotRedoTextChanged (
const QString &);
321 void slotSettingsAxesChecker ();
322 void slotSettingsColorFilter ();
323 void slotSettingsCoords ();
324 void slotSettingsCurveList ();
325 void slotSettingsCurveProperties ();
326 void slotSettingsDigitizeCurve ();
327 void slotSettingsExportFormat ();
328 void slotSettingsGeneral ();
329 void slotSettingsGridDisplay ();
330 void slotSettingsGridRemoval ();
331 void slotSettingsMainWindow ();
332 void slotSettingsPointMatch ();
333 void slotSettingsSegments ();
334 void slotTableStatusChange ();
335 void slotTimeoutRegressionErrorReport ();
336 void slotTimeoutRegressionFileCmdScript ();
337 void slotUndoTextChanged (
const QString &);
338 void slotViewGridLines ();
339 void slotViewGroupBackground(QAction*);
340 void slotViewGroupCurves(QAction*);
341 void slotViewGroupStatus(QAction*);
342 void slotViewToolBarBackground ();
343 void slotViewToolBarChecklistGuide ();
344 void slotViewToolBarCoordSystem ();
345 void slotViewToolBarDigitize ();
346 void slotViewToolBarFittingWindow ();
347 void slotViewToolBarGeometryWindow ();
348 void slotViewToolBarSettingsViews ();
349 void slotViewToolTips ();
350 void slotViewZoomFactor (ZoomFactor);
351 void slotViewZoomFactorInt (
int);
352 void slotViewZoom (
int);
353 void slotViewZoomIn ();
354 void slotViewZoomInFromWheelEvent ();
355 void slotViewZoomOut ();
356 void slotViewZoomOutFromWheelEvent ();
367 IMPORT_TYPE_ADVANCED,
368 IMPORT_TYPE_IMAGE_REPLACE
371 void addDockWindow (QDockWidget *dockWidget,
373 const QString &settingsTokenArea,
374 const QString &settingsTokenGeometry,
375 Qt::DockWidgetArea dockWidgetArea);
376 void applyZoomFactorAfterLoad();
377 virtual void closeEvent(QCloseEvent *event);
378 ZoomFactor currentZoomFactor ()
const;
379 #if !defined(OSX_DEBUG) && !defined(OSX_RELEASE) 380 void exportAllCoordinateSystemsAfterRegressionTests();
382 QString exportRegressionFilenameFromInputFilename (
const QString &fileName)
const;
383 void fileExport(
const QString &fileName,
385 void fileExtractImage (
const QString &fileName);
386 void fileImport (
const QString &fileName,
387 ImportType ImportType);
388 void fileImportWithPrompts (ImportType ImportType);
389 QString fileNameForExportOnly ()
const;
390 QString fileNameForExtractImageOnly ()
const;
391 void filePaste (ImportType importType);
392 void ghostsCreate ();
393 void ghostsDestroy ();
394 void handlerFileExtractImage ();
395 void loadCoordSystemListFromCmdMediator();
396 void loadCurveListFromCmdMediator();
397 void loadDocumentFile (
const QString &fileName);
398 void loadErrorReportFile(
const QString &errorReportFile);
399 bool loadImage (
const QString &fileName,
401 ImportType ImportType);
402 bool loadImageNewDocument (
const QString &fileName,
404 ImportType ImportType);
405 bool loadImageReplacingImage (
const QString &fileName,
407 ImportType ImportType);
408 void loadInputFileForErrorReport(QDomDocument &domInputFile)
const;
409 void loadToolTips ();
413 const QString &selectedNameFilter)
const;
414 bool modeGraph ()
const;
415 void rebuildRecentFileListForCurrentFile(
const QString &filePath);
416 bool saveDocumentFile(
const QString &fileName);
417 QString saveErrorReportFileAndExitXml (
const char *comment,
420 const char *context)
const;
421 void saveStartingDocumentSnapshot();
422 void setCurrentFile(
const QString &fileName);
423 void setCurrentPathFromFile (
const QString &fileName);
424 void setNonFillZoomFactor (ZoomFactor newZoomFactor);
425 void setPixmap (
const QString &curveSelected,
426 const QPixmap &pixmap);
427 void settingsRead (
bool isReset);
428 void settingsReadEnvironment (QSettings &settings);
429 void settingsReadMainWindow (QSettings &settings);
430 void settingsWrite ();
431 bool setupAfterLoadNewDocument (
const QString &fileName,
432 const QString &temporaryMessage,
433 ImportType ImportType);
434 bool setupAfterLoadReplacingImage (
const QString &fileName,
435 const QString &temporaryMessage,
436 ImportType ImportType);
437 void startRegressionTestErrorReport (
const QString ®ressionInputFile);
438 void startRegressionTestFileCmdScript ();
439 void updateAfterCommandStatusBarCoords ();
440 void updateChecklistGuide ();
441 void updateControls ();
442 void updateFittingWindow ();
443 void updateGeometryWindow ();
444 void updateGridLines();
445 void updateHighlightOpacity();
446 void updateRecentFileList();
447 void updateSettingsMainWindow();
448 void updateSmallDialogs();
449 void updateTransformationAndItsDependencies();
450 void updateViewedCurves ();
451 void updateViewsOfSettings ();
452 void updateWindowTitle ();
453 void writeCheckpointToLogFile();
455 QString m_originalFile;
456 bool m_originalFileWasImported;
457 bool m_isDocumentExported;
458 QString m_engaugeFile;
459 QString m_currentFile;
460 QString m_currentFileWithPathAndFileExtension;
461 MainTitleBarFormat m_titleBarFormat;
464 QAction *m_actionImport;
465 QAction *m_actionImportAdvanced;
466 QAction *m_actionImportImageReplace;
467 QAction *m_actionOpen;
468 QMenu *m_menuFileOpenRecent;
469 QList<QAction*> m_actionRecentFiles;
470 QAction *m_actionClose;
471 QAction *m_actionSave;
472 QAction *m_actionSaveAs;
473 QAction *m_actionExport;
474 QAction *m_actionPrint;
475 QAction *m_actionExit;
478 QAction *m_actionEditUndo;
479 QAction *m_actionEditRedo;
480 QAction *m_actionEditCut;
481 QAction *m_actionEditCopy;
482 QAction *m_actionEditPaste;
483 QAction *m_actionEditDelete;
484 QAction *m_actionEditPasteAsNew;
485 QAction *m_actionEditPasteAsNewAdvanced;
487 QMenu *m_menuDigitize;
488 QActionGroup *m_groupDigitize;
489 QAction *m_actionDigitizeSelect;
490 QAction *m_actionDigitizeAxis;
491 QAction *m_actionDigitizeScale;
492 QAction *m_actionDigitizeCurve;
493 QAction *m_actionDigitizePointMatch;
494 QAction *m_actionDigitizeColorPicker;
495 QAction *m_actionDigitizeSegment;
498 QAction *m_actionViewBackground;
499 QAction *m_actionViewChecklistGuide;
500 QAction *m_actionViewCoordSystem;
501 QAction *m_actionViewDigitize;
502 QAction *m_actionViewFittingWindow;
503 QAction *m_actionViewGeometryWindow;
504 QAction *m_actionViewSettingsViews;
505 QAction *m_actionViewToolTips;
506 QAction *m_actionViewGridLines;
507 QMenu *m_menuViewBackground;
508 QActionGroup *m_groupBackground;
509 QAction *m_actionViewBackgroundNone;
510 QAction *m_actionViewBackgroundOriginal;
511 QAction *m_actionViewBackgroundFiltered;
512 QMenu *m_menuViewCurves;
513 QActionGroup *m_groupCurves;
514 QAction *m_actionViewCurvesNone;
515 QAction *m_actionViewCurvesSelected;
516 QAction *m_actionViewCurvesAll;
517 QMenu *m_menuViewStatus;
518 QActionGroup *m_groupStatus;
519 QAction *m_actionStatusNever;
520 QAction *m_actionStatusTemporary;
521 QAction *m_actionStatusAlways;
522 QMenu *m_menuViewZoom;
523 QAction *m_actionZoomOut;
524 QAction *m_actionZoomIn;
525 QActionGroup *m_groupZoom;
526 QSignalMapper *m_mapperZoomFactor;
527 QAction *m_actionZoomFill;
528 QAction *m_actionZoom16To1;
529 QAction *m_actionZoom16To1Farther;
530 QAction *m_actionZoom8To1Closer;
531 QAction *m_actionZoom8To1;
532 QAction *m_actionZoom8To1Farther;
533 QAction *m_actionZoom4To1Closer;
534 QAction *m_actionZoom4To1;
535 QAction *m_actionZoom4To1Farther;
536 QAction *m_actionZoom2To1Closer;
537 QAction *m_actionZoom2To1;
538 QAction *m_actionZoom2To1Farther;
539 QAction *m_actionZoom1To1Closer;
540 QAction *m_actionZoom1To1;
541 QAction *m_actionZoom1To1Farther;
542 QAction *m_actionZoom1To2Closer;
543 QAction *m_actionZoom1To2;
544 QAction *m_actionZoom1To2Farther;
545 QAction *m_actionZoom1To4Closer;
546 QAction *m_actionZoom1To4;
547 QAction *m_actionZoom1To4Farther;
548 QAction *m_actionZoom1To8Closer;
549 QAction *m_actionZoom1To8;
550 QAction *m_actionZoom1To8Farther;
551 QAction *m_actionZoom1To16Closer;
552 QAction *m_actionZoom1To16;
554 QMenu *m_menuSettings;
555 QAction *m_actionSettingsAxesChecker;
556 QAction *m_actionSettingsColorFilter;
557 QAction *m_actionSettingsCoords;
558 QAction *m_actionSettingsCurveList;
559 QAction *m_actionSettingsCurveProperties;
560 QAction *m_actionSettingsDigitizeCurve;
561 QAction *m_actionSettingsExport;
562 QAction *m_actionSettingsGeneral;
563 QAction *m_actionSettingsGridDisplay;
564 QAction *m_actionSettingsGridRemoval;
565 QAction *m_actionSettingsMainWindow;
566 QAction *m_actionSettingsPointMatch;
567 QAction *m_actionSettingsSegments;
570 QAction *m_actionHelpAbout;
571 QAction *m_actionHelpChecklistGuideWizard;
572 QAction *m_actionHelpHelp;
573 QAction *m_actionHelpTutorial;
574 QAction *m_actionHelpWhatsThis;
576 QVBoxLayout *m_layout;
583 QComboBox *m_cmbCurve;
584 QToolBar *m_toolDigitize;
587 QComboBox *m_cmbBackground;
588 QToolBar *m_toolBackground;
592 QToolBar *m_toolSettingsViews;
597 QComboBox *m_cmbCoordSystem;
598 QPushButton *m_btnPrintAll;
599 QPushButton *m_btnShowAll;
600 QToolBar *m_toolCoordSystem;
602 #if !defined(OSX_DEBUG) && !defined(OSX_RELEASE) 634 QString m_startingDocumentSnapshot;
642 QTimer *m_timerLoadStartupFiles;
643 QStringList m_loadStartupFiles;
646 QStringList m_commandLineWithoutLoadStartupFiles;
654 QTimer *m_timerRegressionErrorReport;
656 bool m_isErrorReportRegressionTest;
657 QTimer *m_timerRegressionFileCmdScript;
658 QString m_regressionFile;
659 QString m_startupDirectory;
667 QMap<ZoomFactorInitial, ZoomFactor> m_zoomMapFromInitial;
668 QMap<ZoomFactor, QAction*> m_zoomMapToAction;
677 bool m_isExtractImageOnly;
678 QString m_extractImageOnlyExtension;
681 #endif // MAIN_WINDOW_H QImage imageFiltered() const
Background image that has been filtered for the current curve. This asserts if a curve-specific image...
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.
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.
Class that displays the current Segment Filter in a MainWindow toolbar.
Dialog for editing Segments settings, for DigitizeStateSegment.
Dialog for editing point match settings, for DigitizeStatePointMatch.
Context class for transformation state machine.
Model for DlgSettingsCurveProperties and CmdSettingsCurveProperties.
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.
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.
void updateViewsOfSettings(const QString &activeCurve)
Update curve-specific view of settings. Private version gets active curve name from DigitizeStateCont...
Class for showing points and lines for all coordinate systems simultaneously, even though the code no...
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.
CmdMediator * cmdMediator()
Accessor for commands to process the Document.
Class to create LoadImageFromUrl for MainWindow class.
BackgroundImage selectOriginal(BackgroundImage backgroundImage)
Make original background visible, for DigitizeStateColorPicker.
Dialog for editing grid removal settings.
Class to create QGraphicsScene for MainWindow class.
Unit test of Export classes.
Transformation transformation() const
Return read-only copy of transformation.
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...
void cmdFileExport(const QString &fileName)
Export file. This is called from a file script command.
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...
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.
Dialog for editing filtering settings.
Container for all graph curves. The axes point curve is external to this class.
Model for DlgSettingsColorFilter and CmdSettingsColorFilter.
Wrapper around QStatusBar to manage permanent widgets.
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.
bool transformIsDefined() const
Return true if all three axis points have been defined.
Context class that manages the background image state machine.
Facade class that wraps around all of the create classes for MainWindow.
QGraphicsView class with event handling added. Typically the events are sent to the active digitizing...
bool isGnuplot() const
Get method for gnuplot flag.
Container for all DigitizeStateAbstractBase subclasses. This functions as the context class in a stan...
Model for DlgSettingsMainWindow.
Container class for GridLine objects.
Dialog for editing general settings.
Model for DlgSettingsCoords and CmdSettingsCoords.
void updateAfterCommand()
See GraphicsScene::updateAfterCommand.
Curve that overlays the current scene so the regression-fitted curve is visible.
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.
void updateSettingsGridRemoval(const DocumentModelGridRemoval &modelGridRemoval)
Update with new grid removal properties.
Class that displays a view of the current Curve's point style.
Dialog for editing main window settings, which are entirely independent of all documents.
MainWindowModel modelMainWindow() const
Get method for main window model.
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.
Dialog for editing curve properties settings.
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.
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.
Add point and line handling to generic QGraphicsScene.
QString selectedGraphCurve() const
Curve name that is currently selected in m_cmbCurve.
Window that displays curve fitting as applied to the currently selected curve.
Model for DlgSettingsGridRemoval and CmdSettingsGridRemoval. The settings are unstable until the user...
bool modeMap() const
True if document scale is set using a scale bar, otherwise using axis points.
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.
Main window consisting of menu, graphics scene, status bar and optional toolbars as a Single Document...
Class to create icons for MainWindow class.
virtual void showEvent(QShowEvent *)
Processing performed after gui becomes available.
void updateSettingsCurveList(const CurvesGraphs &curvesGraphs)
Update with new curves.