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;
132 const QString &fileCmdScriptFile,
133 bool isDropRegression,
134 bool isRegressionTest,
138 bool isExtractImageOnly,
139 const QString &extractImageOnlyExtension,
140 const QStringList &loadStartupFiles,
141 const QStringList &commandLineWithoutLoadStartupFiles,
142 QWidget *parent = 0);
182 const char *context);
271 void slotBtnPrintAll();
272 void slotBtnShowAllPressed();
273 void slotBtnShowAllReleased();
274 void slotCanRedoChanged (
bool);
275 void slotCanUndoChanged (
bool);
276 void slotChecklistClosed ();
277 void slotCleanChanged (
bool);
278 void slotCmbBackground(
int);
279 void slotCmbCoordSystem(
int);
280 void slotCmbCurve(
int);
281 void slotContextMenuEventAxis (QString);
282 void slotContextMenuEventGraph (QStringList);
283 void slotDigitizeAxis ();
284 void slotDigitizeColorPicker ();
285 void slotDigitizeCurve ();
286 void slotDigitizePointMatch ();
287 void slotDigitizeScale ();
288 void slotDigitizeSegment ();
289 void slotDigitizeSelect ();
290 void slotEditCopy ();
292 void slotEditDelete ();
293 void slotEditMenu ();
294 void slotEditPaste ();
295 void slotEditPasteAsNew ();
296 void slotEditPasteAsNewAdvanced ();
297 void slotFileClose ();
298 void slotFileExport ();
299 void slotFileImport();
300 void slotFileImportAdvanced();
301 void slotFileImportDraggedImage(QImage);
302 void slotFileImportDraggedImageUrl(QUrl);
303 void slotFileImportImage(QString, QImage);
304 void slotFileImportImageReplace();
306 void slotFileOpenDraggedDigFile (QString);
307 void slotFilePrint();
309 bool slotFileSaveAs();
310 void slotFittingWindowClosed();
311 void slotFittingWindowCurveFit(FittingCurveCoefficients,
double,
double,
bool,
bool);
312 void slotGeometryWindowClosed();
313 void slotHelpAbout();
314 void slotHelpTutorial();
315 void slotKeyPress (Qt::Key,
bool);
316 void slotLoadStartupFiles ();
317 void slotMouseMove (QPointF);
318 void slotMousePress (QPointF);
319 void slotMouseRelease (QPointF);
320 void slotRecentFileAction ();
321 void slotRecentFileClear ();
322 void slotRedoTextChanged (
const QString &);
323 void slotSettingsAxesChecker ();
324 void slotSettingsColorFilter ();
325 void slotSettingsCoords ();
326 void slotSettingsCurveList ();
327 void slotSettingsCurveProperties ();
328 void slotSettingsDigitizeCurve ();
329 void slotSettingsExportFormat ();
330 void slotSettingsGeneral ();
331 void slotSettingsGridDisplay ();
332 void slotSettingsGridRemoval ();
333 void slotSettingsMainWindow ();
334 void slotSettingsPointMatch ();
335 void slotSettingsSegments ();
336 void slotTableStatusChange ();
337 void slotTimeoutRegressionErrorReport ();
338 void slotTimeoutRegressionFileCmdScript ();
339 void slotUndoTextChanged (
const QString &);
340 void slotViewGridLines ();
341 void slotViewGroupBackground(QAction*);
342 void slotViewGroupCurves(QAction*);
343 void slotViewGroupStatus(QAction*);
344 void slotViewToolBarBackground ();
345 void slotViewToolBarChecklistGuide ();
346 void slotViewToolBarCoordSystem ();
347 void slotViewToolBarDigitize ();
348 void slotViewToolBarFittingWindow ();
349 void slotViewToolBarGeometryWindow ();
350 void slotViewToolBarSettingsViews ();
351 void slotViewToolTips ();
352 void slotViewZoomFactor (ZoomFactor);
353 void slotViewZoomFactorInt (
int);
354 void slotViewZoom (
int);
355 void slotViewZoomIn ();
356 void slotViewZoomInFromWheelEvent ();
357 void slotViewZoomOut ();
358 void slotViewZoomOutFromWheelEvent ();
372 IMPORT_TYPE_ADVANCED,
373 IMPORT_TYPE_IMAGE_REPLACE
376 void addDockWindow (QDockWidget *dockWidget,
378 const QString &settingsTokenArea,
379 const QString &settingsTokenGeometry,
380 Qt::DockWidgetArea dockWidgetArea);
381 void applyZoomFactorAfterLoad();
382 virtual void closeEvent(QCloseEvent *event);
383 ZoomFactor currentZoomFactor ()
const;
384 #if !defined(OSX_DEBUG) && !defined(OSX_RELEASE) 385 void exportAllCoordinateSystemsAfterRegressionTests();
387 QString exportRegressionFilenameFromInputFilename (
const QString &fileName)
const;
388 void fileExport(
const QString &fileName,
390 void fileExtractImage (
const QString &fileName);
391 void fileImport (
const QString &fileName,
392 ImportType ImportType);
393 void fileImportWithPrompts (ImportType ImportType);
394 QString fileNameForExportOnly ()
const;
395 QString fileNameForExtractImageOnly ()
const;
396 void filePaste (ImportType importType);
397 void ghostsCreate ();
398 void ghostsDestroy ();
399 void handlerFileExtractImage ();
400 void loadCoordSystemListFromCmdMediator();
401 void loadCurveListFromCmdMediator();
402 void loadDocumentFile (
const QString &fileName);
403 void loadErrorReportFile(
const QString &errorReportFile);
404 bool loadImage (
const QString &fileName,
406 ImportType ImportType);
407 bool loadImageNewDocument (
const QString &fileName,
409 ImportType ImportType);
410 bool loadImageReplacingImage (
const QString &fileName,
412 ImportType ImportType);
413 void loadInputFileForErrorReport(QDomDocument &domInputFile)
const;
414 void loadToolTips ();
418 const QString &selectedNameFilter)
const;
419 bool modeGraph ()
const;
420 void rebuildRecentFileListForCurrentFile(
const QString &filePath);
421 bool saveDocumentFile(
const QString &fileName);
422 QString saveErrorReportFileAndExitXml (
const char *comment,
425 const char *context)
const;
426 void saveStartingDocumentSnapshot();
427 void setCurrentFile(
const QString &fileName);
428 void setCurrentPathFromFile (
const QString &fileName);
429 void setNonFillZoomFactor (ZoomFactor newZoomFactor);
430 void setPixmap (
const QString &curveSelected,
431 const QPixmap &pixmap);
432 void settingsRead (
bool isReset);
433 void settingsReadEnvironment (QSettings &settings);
434 void settingsReadMainWindow (QSettings &settings);
435 void settingsWrite ();
436 bool setupAfterLoadNewDocument (
const QString &fileName,
437 const QString &temporaryMessage,
438 ImportType ImportType);
439 bool setupAfterLoadReplacingImage (
const QString &fileName,
440 const QString &temporaryMessage,
441 ImportType ImportType);
442 void startRegressionTestErrorReport (
const QString ®ressionInputFile);
443 void startRegressionDropTest (
const QStringList &loadStartupFiles);
444 void startRegressionTestFileCmdScript ();
445 void updateAfterCommandStatusBarCoords ();
446 void updateChecklistGuide ();
447 void updateControls ();
448 void updateFittingWindow ();
449 void updateGeometryWindow ();
450 void updateGridLines();
451 void updateHighlightOpacity();
452 void updateRecentFileList();
453 void updateSettingsMainWindow();
454 void updateSmallDialogs();
455 void updateTransformationAndItsDependencies();
456 void updateViewedCurves ();
457 void updateViewsOfSettings ();
458 void updateWindowTitle ();
459 void writeCheckpointToLogFile();
461 QString m_originalFile;
462 bool m_originalFileWasImported;
463 bool m_isDocumentExported;
464 QString m_engaugeFile;
465 QString m_currentFile;
466 QString m_currentFileWithPathAndFileExtension;
467 MainTitleBarFormat m_titleBarFormat;
470 QAction *m_actionImport;
471 QAction *m_actionImportAdvanced;
472 QAction *m_actionImportImageReplace;
473 QAction *m_actionOpen;
474 QMenu *m_menuFileOpenRecent;
475 QList<QAction*> m_actionRecentFiles;
476 QAction *m_actionClose;
477 QAction *m_actionSave;
478 QAction *m_actionSaveAs;
479 QAction *m_actionExport;
480 QAction *m_actionPrint;
481 QAction *m_actionExit;
484 QAction *m_actionEditUndo;
485 QAction *m_actionEditRedo;
486 QAction *m_actionEditCut;
487 QAction *m_actionEditCopy;
488 QAction *m_actionEditPaste;
489 QAction *m_actionEditDelete;
490 QAction *m_actionEditPasteAsNew;
491 QAction *m_actionEditPasteAsNewAdvanced;
493 QMenu *m_menuDigitize;
494 QActionGroup *m_groupDigitize;
495 QAction *m_actionDigitizeSelect;
496 QAction *m_actionDigitizeAxis;
497 QAction *m_actionDigitizeScale;
498 QAction *m_actionDigitizeCurve;
499 QAction *m_actionDigitizePointMatch;
500 QAction *m_actionDigitizeColorPicker;
501 QAction *m_actionDigitizeSegment;
504 QAction *m_actionViewBackground;
505 QAction *m_actionViewChecklistGuide;
506 QAction *m_actionViewCoordSystem;
507 QAction *m_actionViewDigitize;
508 QAction *m_actionViewFittingWindow;
509 QAction *m_actionViewGeometryWindow;
510 QAction *m_actionViewSettingsViews;
511 QAction *m_actionViewToolTips;
512 QAction *m_actionViewGridLines;
513 QMenu *m_menuViewBackground;
514 QActionGroup *m_groupBackground;
515 QAction *m_actionViewBackgroundNone;
516 QAction *m_actionViewBackgroundOriginal;
517 QAction *m_actionViewBackgroundFiltered;
518 QMenu *m_menuViewCurves;
519 QActionGroup *m_groupCurves;
520 QAction *m_actionViewCurvesNone;
521 QAction *m_actionViewCurvesSelected;
522 QAction *m_actionViewCurvesAll;
523 QMenu *m_menuViewStatus;
524 QActionGroup *m_groupStatus;
525 QAction *m_actionStatusNever;
526 QAction *m_actionStatusTemporary;
527 QAction *m_actionStatusAlways;
528 QMenu *m_menuViewZoom;
529 QAction *m_actionZoomOut;
530 QAction *m_actionZoomIn;
531 QActionGroup *m_groupZoom;
532 QSignalMapper *m_mapperZoomFactor;
533 QAction *m_actionZoomFill;
534 QAction *m_actionZoom16To1;
535 QAction *m_actionZoom16To1Farther;
536 QAction *m_actionZoom8To1Closer;
537 QAction *m_actionZoom8To1;
538 QAction *m_actionZoom8To1Farther;
539 QAction *m_actionZoom4To1Closer;
540 QAction *m_actionZoom4To1;
541 QAction *m_actionZoom4To1Farther;
542 QAction *m_actionZoom2To1Closer;
543 QAction *m_actionZoom2To1;
544 QAction *m_actionZoom2To1Farther;
545 QAction *m_actionZoom1To1Closer;
546 QAction *m_actionZoom1To1;
547 QAction *m_actionZoom1To1Farther;
548 QAction *m_actionZoom1To2Closer;
549 QAction *m_actionZoom1To2;
550 QAction *m_actionZoom1To2Farther;
551 QAction *m_actionZoom1To4Closer;
552 QAction *m_actionZoom1To4;
553 QAction *m_actionZoom1To4Farther;
554 QAction *m_actionZoom1To8Closer;
555 QAction *m_actionZoom1To8;
556 QAction *m_actionZoom1To8Farther;
557 QAction *m_actionZoom1To16Closer;
558 QAction *m_actionZoom1To16;
560 QMenu *m_menuSettings;
561 QAction *m_actionSettingsAxesChecker;
562 QAction *m_actionSettingsColorFilter;
563 QAction *m_actionSettingsCoords;
564 QAction *m_actionSettingsCurveList;
565 QAction *m_actionSettingsCurveProperties;
566 QAction *m_actionSettingsDigitizeCurve;
567 QAction *m_actionSettingsExport;
568 QAction *m_actionSettingsGeneral;
569 QAction *m_actionSettingsGridDisplay;
570 QAction *m_actionSettingsGridRemoval;
571 QAction *m_actionSettingsMainWindow;
572 QAction *m_actionSettingsPointMatch;
573 QAction *m_actionSettingsSegments;
576 QAction *m_actionHelpAbout;
577 QAction *m_actionHelpChecklistGuideWizard;
578 QAction *m_actionHelpHelp;
579 QAction *m_actionHelpTutorial;
580 QAction *m_actionHelpWhatsThis;
582 QVBoxLayout *m_layout;
589 QComboBox *m_cmbCurve;
590 QToolBar *m_toolDigitize;
593 QComboBox *m_cmbBackground;
594 QToolBar *m_toolBackground;
598 QToolBar *m_toolSettingsViews;
603 QComboBox *m_cmbCoordSystem;
604 QPushButton *m_btnPrintAll;
605 QPushButton *m_btnShowAll;
606 QToolBar *m_toolCoordSystem;
608 #if !defined(OSX_DEBUG) && !defined(OSX_RELEASE) 640 QString m_startingDocumentSnapshot;
648 QTimer *m_timerLoadStartupFiles;
649 QStringList m_loadStartupFiles;
652 QStringList m_commandLineWithoutLoadStartupFiles;
660 QTimer *m_timerRegressionErrorReport;
662 bool m_isErrorReportRegressionTest;
663 QTimer *m_timerRegressionFileCmdScript;
664 QString m_regressionFile;
665 QString m_startupDirectory;
673 QMap<ZoomFactorInitial, ZoomFactor> m_zoomMapFromInitial;
674 QMap<ZoomFactor, QAction*> m_zoomMapToAction;
683 bool m_isExtractImageOnly;
684 QString m_extractImageOnlyExtension;
687 #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.
void signalDropRegression(QString)
Send drag and drop regression test url.
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,...
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.