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" 71 class QGraphicsLineItem;
100 const QString &fileCmdScriptFile,
101 bool isRegressionTest,
104 QStringList loadStartupFiles,
105 QWidget *parent = 0);
142 const char *context)
const;
231 void slotBtnPrintAll();
232 void slotBtnShowAllPressed();
233 void slotBtnShowAllReleased();
234 void slotCanRedoChanged (
bool);
235 void slotCanUndoChanged (
bool);
236 void slotChecklistClosed ();
237 void slotCleanChanged (
bool);
238 void slotCmbBackground(
int);
239 void slotCmbCoordSystem(
int);
240 void slotCmbCurve(
int);
241 void slotContextMenuEventAxis (QString);
242 void slotContextMenuEventGraph (QStringList);
243 void slotDigitizeAxis ();
244 void slotDigitizeColorPicker ();
245 void slotDigitizeCurve ();
246 void slotDigitizePointMatch ();
247 void slotDigitizeSegment ();
248 void slotDigitizeSelect ();
249 void slotEditCopy ();
251 void slotEditDelete ();
252 void slotEditMenu ();
253 void slotEditPaste ();
254 void slotEditPasteAsNew ();
255 void slotEditPasteAsNewAdvanced ();
256 void slotFileClose ();
257 void slotFileExport ();
258 void slotFileImport();
259 void slotFileImportAdvanced();
260 void slotFileImportDraggedImage(QImage);
261 void slotFileImportDraggedImageUrl(QUrl);
262 void slotFileImportImage(QString, QImage);
263 void slotFileImportImageReplace();
265 void slotFileOpenDraggedDigFile (QString);
266 void slotFilePrint();
268 bool slotFileSaveAs();
269 void slotFittingWindowClosed();
270 void slotFittingWindowCurveFit(FittingCurveCoefficients,
double,
double,
bool,
bool);
271 void slotGeometryWindowClosed();
272 void slotHelpAbout();
273 void slotHelpTutorial();
274 void slotKeyPress (Qt::Key,
bool);
275 void slotLoadStartupFiles ();
276 void slotMouseMove (QPointF);
277 void slotMousePress (QPointF);
278 void slotMouseRelease (QPointF);
279 void slotRecentFileAction ();
280 void slotRecentFileClear ();
281 void slotRedoTextChanged (
const QString &);
282 void slotSettingsAxesChecker ();
283 void slotSettingsColorFilter ();
284 void slotSettingsCoords ();
285 void slotSettingsCurveAddRemove ();
286 void slotSettingsCurveProperties ();
287 void slotSettingsDigitizeCurve ();
288 void slotSettingsExportFormat ();
289 void slotSettingsGeneral ();
290 void slotSettingsGridDisplay ();
291 void slotSettingsGridRemoval ();
292 void slotSettingsMainWindow ();
293 void slotSettingsPointMatch ();
294 void slotSettingsSegments ();
295 void slotTableStatusChange ();
296 void slotTimeoutRegressionErrorReport ();
297 void slotTimeoutRegressionFileCmdScript ();
298 void slotUndoTextChanged (
const QString &);
299 void slotViewGridLines ();
300 void slotViewGroupBackground(QAction*);
301 void slotViewGroupCurves(QAction*);
302 void slotViewGroupStatus(QAction*);
303 void slotViewToolBarBackground ();
304 void slotViewToolBarChecklistGuide ();
305 void slotViewToolBarCoordSystem ();
306 void slotViewToolBarDigitize ();
307 void slotViewToolBarFittingWindow ();
308 void slotViewToolBarGeometryWindow ();
309 void slotViewToolBarSettingsViews ();
310 void slotViewToolTips ();
311 void slotViewZoom16To1 ();
312 void slotViewZoom8To1 ();
313 void slotViewZoom4To1 ();
314 void slotViewZoom2To1 ();
315 void slotViewZoom1To1 ();
316 void slotViewZoom1To2 ();
317 void slotViewZoom1To4 ();
318 void slotViewZoom1To8 ();
319 void slotViewZoom1To16 ();
320 void slotViewZoom (
int);
321 void slotViewZoomFill ();
322 void slotViewZoomIn ();
323 void slotViewZoomInFromWheelEvent ();
324 void slotViewZoomOut ();
325 void slotViewZoomOutFromWheelEvent ();
336 IMPORT_TYPE_ADVANCED,
337 IMPORT_TYPE_IMAGE_REPLACE
340 void addDockWindow (QDockWidget *dockWidget,
342 const QString &settingsTokenArea,
343 const QString &settingsTokenGeometry,
344 Qt::DockWidgetArea dockWidgetArea);
345 void applyZoomFactorAfterLoad();
346 virtual void closeEvent(QCloseEvent *event);
347 void createActions();
348 void createActionsDigitize ();
349 void createActionsEdit ();
350 void createActionsFile ();
351 void createActionsHelp ();
352 void createActionsSettings ();
353 void createActionsView ();
354 void createCentralWidget ();
355 void createCommandStackShadow ();
356 void createDockableWidgets ();
357 void createHelpWindow ();
359 void createLoadImageFromUrl ();
361 void createNetwork();
363 void createSettingsDialogs ();
364 void createStateContextBackground();
365 void createStateContextDigitize();
366 void createStateContextTransformation();
367 void createStatusBar();
368 void createToolBars();
369 void createTutorial();
370 void createZoomMap ();
371 ZoomFactor currentZoomFactor ()
const;
373 void exportAllCoordinateSystemsAfterRegressionTests();
375 QString exportFilenameFromInputFilename (
const QString &fileName)
const;
376 void fileExport(
const QString &fileName,
378 void fileImport (
const QString &fileName,
379 ImportType ImportType);
380 void fileImportWithPrompts (ImportType ImportType);
381 void filePaste (ImportType importType);
382 void ghostsCreate ();
383 void ghostsDestroy ();
384 void loadCoordSystemListFromCmdMediator();
385 void loadCurveListFromCmdMediator();
386 void loadDocumentFile (
const QString &fileName);
387 void loadErrorReportFile(
const QString &errorReportFile);
388 bool loadImage (
const QString &fileName,
390 ImportType ImportType);
391 bool loadImageNewDocument (
const QString &fileName,
393 ImportType ImportType);
394 bool loadImageReplacingImage (
const QString &fileName,
396 ImportType ImportType);
397 void loadInputFileForErrorReport(QDomDocument &domInputFile)
const;
398 void loadToolTips ();
402 const QString &selectedNameFilter)
const;
403 void rebuildRecentFileListForCurrentFile(
const QString &filePath);
404 bool saveDocumentFile(
const QString &fileName);
405 QString saveErrorReportFileAndExitXml (
const char *comment,
408 const char *context)
const;
409 void saveStartingDocumentSnapshot();
410 void setCurrentFile(
const QString &fileName);
411 void setCurrentPathFromFile (
const QString &fileName);
412 void setPixmap (
const QString &curveSelected,
413 const QPixmap &pixmap);
414 void settingsRead (
bool isReset);
415 void settingsReadEnvironment (QSettings &settings);
416 void settingsReadMainWindow (QSettings &settings);
417 void settingsWrite ();
418 bool setupAfterLoadNewDocument (
const QString &fileName,
419 const QString &temporaryMessage,
420 ImportType ImportType);
421 bool setupAfterLoadReplacingImage (
const QString &fileName,
422 const QString &temporaryMessage,
423 ImportType ImportType);
424 void startRegressionTestErrorReport (
const QString ®ressionInputFile);
425 void startRegressionTestFileCmdScript ();
426 void updateAfterCommandStatusBarCoords ();
427 void updateChecklistGuide ();
428 void updateControls ();
429 void updateFittingWindow ();
430 void updateGeometryWindow ();
431 void updateGridLines();
432 void updateHighlightOpacity();
433 void updateRecentFileList();
434 void updateSettingsMainWindow();
435 void updateSmallDialogs();
436 void updateTransformationAndItsDependencies();
437 void updateViewedCurves ();
438 void updateViewsOfSettings ();
439 void updateWindowTitle ();
440 void writeCheckpointToLogFile();
442 QString m_originalFile;
443 bool m_originalFileWasImported;
444 bool m_isDocumentExported;
445 QString m_engaugeFile;
446 QString m_currentFile;
447 QString m_currentFileWithPathAndFileExtension;
448 MainTitleBarFormat m_titleBarFormat;
451 QAction *m_actionImport;
452 QAction *m_actionImportAdvanced;
453 QAction *m_actionImportImageReplace;
454 QAction *m_actionOpen;
455 QMenu *m_menuFileOpenRecent;
456 QList<QAction*> m_actionRecentFiles;
457 QAction *m_actionClose;
458 QAction *m_actionSave;
459 QAction *m_actionSaveAs;
460 QAction *m_actionExport;
461 QAction *m_actionPrint;
462 QAction *m_actionExit;
465 QAction *m_actionEditUndo;
466 QAction *m_actionEditRedo;
467 QAction *m_actionEditCut;
468 QAction *m_actionEditCopy;
469 QAction *m_actionEditPaste;
470 QAction *m_actionEditDelete;
471 QAction *m_actionEditPasteAsNew;
472 QAction *m_actionEditPasteAsNewAdvanced;
474 QMenu *m_menuDigitize;
475 QActionGroup *m_groupDigitize;
476 QAction *m_actionDigitizeSelect;
477 QAction *m_actionDigitizeAxis;
478 QAction *m_actionDigitizeCurve;
479 QAction *m_actionDigitizePointMatch;
480 QAction *m_actionDigitizeColorPicker;
481 QAction *m_actionDigitizeSegment;
484 QAction *m_actionViewBackground;
485 QAction *m_actionViewChecklistGuide;
486 QAction *m_actionViewCoordSystem;
487 QAction *m_actionViewDigitize;
488 QAction *m_actionViewFittingWindow;
489 QAction *m_actionViewGeometryWindow;
490 QAction *m_actionViewSettingsViews;
491 QAction *m_actionViewToolTips;
492 QAction *m_actionViewGridLines;
493 QMenu *m_menuViewBackground;
494 QActionGroup *m_groupBackground;
495 QAction *m_actionViewBackgroundNone;
496 QAction *m_actionViewBackgroundOriginal;
497 QAction *m_actionViewBackgroundFiltered;
498 QMenu *m_menuViewCurves;
499 QActionGroup *m_groupCurves;
500 QAction *m_actionViewCurvesNone;
501 QAction *m_actionViewCurvesSelected;
502 QAction *m_actionViewCurvesAll;
503 QMenu *m_menuViewStatus;
504 QActionGroup *m_groupStatus;
505 QAction *m_actionStatusNever;
506 QAction *m_actionStatusTemporary;
507 QAction *m_actionStatusAlways;
508 QMenu *m_menuViewZoom;
509 QAction *m_actionZoomOut;
510 QAction *m_actionZoomIn;
511 QActionGroup *m_groupZoom;
512 QAction *m_actionZoomFill;
513 QAction *m_actionZoom16To1;
514 QAction *m_actionZoom8To1;
515 QAction *m_actionZoom4To1;
516 QAction *m_actionZoom2To1;
517 QAction *m_actionZoom1To1;
518 QAction *m_actionZoom1To2;
519 QAction *m_actionZoom1To4;
520 QAction *m_actionZoom1To8;
521 QAction *m_actionZoom1To16;
523 QMenu *m_menuSettings;
524 QAction *m_actionSettingsAxesChecker;
525 QAction *m_actionSettingsColorFilter;
526 QAction *m_actionSettingsCoords;
527 QAction *m_actionSettingsCurveAddRemove;
528 QAction *m_actionSettingsCurveProperties;
529 QAction *m_actionSettingsDigitizeCurve;
530 QAction *m_actionSettingsExport;
531 QAction *m_actionSettingsGeneral;
532 QAction *m_actionSettingsGridDisplay;
533 QAction *m_actionSettingsGridRemoval;
534 QAction *m_actionSettingsMainWindow;
535 QAction *m_actionSettingsPointMatch;
536 QAction *m_actionSettingsSegments;
539 QAction *m_actionHelpAbout;
540 QAction *m_actionHelpChecklistGuideWizard;
541 QAction *m_actionHelpHelp;
542 QAction *m_actionHelpTutorial;
543 QAction *m_actionHelpWhatsThis;
545 QVBoxLayout *m_layout;
552 QComboBox *m_cmbCurve;
553 QToolBar *m_toolDigitize;
556 QComboBox *m_cmbBackground;
557 QToolBar *m_toolBackground;
561 QToolBar *m_toolSettingsViews;
566 QComboBox *m_cmbCoordSystem;
567 QPushButton *m_btnPrintAll;
568 QPushButton *m_btnShowAll;
569 QToolBar *m_toolCoordSystem;
601 QString m_startingDocumentSnapshot;
609 QTimer *m_timerLoadStartupFiles;
610 QStringList m_loadStartupFiles;
618 QTimer *m_timerRegressionErrorReport;
620 bool m_isErrorReportRegressionTest;
621 QTimer *m_timerRegressionFileCmdScript;
622 QString m_regressionFile;
623 QString m_startupDirectory;
631 QMap<ZoomFactorInitial, ZoomFactor> m_zoomMap;
637 #endif // MAIN_WINDOW_H void updateCoordSystem(CoordSystemIndex coordSystemIndex)
Select a different CoordSystem.
Model for DlgSettingsGeneral and CmdSettingsGeneral.
Model for DlgSettingsPointMatch and CmdSettingsPointMatch.
void updateSettingsMainWindow(const MainWindowModel &modelMainWindow)
Update with new main window properties.
Model for DlgSettingsGridDisplay and CmdSettingsGridDisplay.
void updateDigitizeStateIfSoftwareTriggered(DigitizeState digitizeState)
After software-triggered state transition, this method manually triggers the action as if user had cl...
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.
Transformation transformation() const
Return read-only copy of transformation.
Context class for transformation state machine.
Model for DlgSettingsCurveProperties and CmdSettingsCurveProperties.
void updateSettingsCurveAddRemove(const CurvesGraphs &curvesGraphs)
Update with new curves.
void updateAfterMouseRelease()
Call MainWindow::updateControls (which is private) after the very specific case - a mouse press/relea...
void cmdFileClose()
Close file. This is called from a file script command.
void updateViewsOfSettings(const QString &activeCurve)
Update curve-specific view of settings. Private version gets active curve name from DigitizeStateCont...
QString selectedGraphCurve() const
Curve name that is currently selected in m_cmbCurve.
Class for showing points and lines for all coordinate systems simultaneously, even though the code no...
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.
BackgroundImage selectOriginal(BackgroundImage backgroundImage)
Make original background visible, for DigitizeStateColorPicker.
Dialog for editing grid removal settings.
void showTemporaryMessage(const QString &temporaryMessage)
Show temporary message in status bar.
Dialog for editing curve names settings.
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.
Strategy class for exporting to a file. This strategy is external to the Document class so that class...
Dockable text window containing checklist guide.
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.
Context class that manages the background image state machine.
QGraphicsView class with event handling added. Typically the events are sent to the active digitizing...
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.
QImage imageFiltered() const
Background image that has been filtered for the current curve. This asserts if a curve-specific image...
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.
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.
bool isGnuplot() const
Get method for gnuplot flag.
Dialog for editing curve properties settings.
void saveErrorReportFileAndExit(const char *comment, const char *file, int line, const char *context) const
Save error report and exit.
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.
Window that displays curve fitting as applied to the currently selected curve.
Model for DlgSettingsGridRemoval and CmdSettingsGridRemoval. The settings are unstable until the user...
void updateSettingsSegments(const DocumentModelSegments &modelSegments)
Update with new segments properties.
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.
Main window consisting of menu, graphics scene, status bar and optional toolbars as a Single Document...
MainWindowModel modelMainWindow() const
Get method for main window model.
virtual void showEvent(QShowEvent *)
Processing performed after gui becomes available.
bool transformIsDefined() const
Return true if all three axis points have been defined.