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 slotDigitizeScale ();
248 void slotDigitizeSegment ();
249 void slotDigitizeSelect ();
250 void slotEditCopy ();
252 void slotEditDelete ();
253 void slotEditMenu ();
254 void slotEditPaste ();
255 void slotEditPasteAsNew ();
256 void slotEditPasteAsNewAdvanced ();
257 void slotFileClose ();
258 void slotFileExport ();
259 void slotFileImport();
260 void slotFileImportAdvanced();
261 void slotFileImportDraggedImage(QImage);
262 void slotFileImportDraggedImageUrl(QUrl);
263 void slotFileImportImage(QString, QImage);
264 void slotFileImportImageReplace();
266 void slotFileOpenDraggedDigFile (QString);
267 void slotFilePrint();
269 bool slotFileSaveAs();
270 void slotFittingWindowClosed();
271 void slotFittingWindowCurveFit(FittingCurveCoefficients,
double,
double,
bool,
bool);
272 void slotGeometryWindowClosed();
273 void slotHelpAbout();
274 void slotHelpTutorial();
275 void slotKeyPress (Qt::Key,
bool);
276 void slotLoadStartupFiles ();
277 void slotMouseMove (QPointF);
278 void slotMousePress (QPointF);
279 void slotMouseRelease (QPointF);
280 void slotRecentFileAction ();
281 void slotRecentFileClear ();
282 void slotRedoTextChanged (
const QString &);
283 void slotSettingsAxesChecker ();
284 void slotSettingsColorFilter ();
285 void slotSettingsCoords ();
286 void slotSettingsCurveAddRemove ();
287 void slotSettingsCurveProperties ();
288 void slotSettingsDigitizeCurve ();
289 void slotSettingsExportFormat ();
290 void slotSettingsGeneral ();
291 void slotSettingsGridDisplay ();
292 void slotSettingsGridRemoval ();
293 void slotSettingsMainWindow ();
294 void slotSettingsPointMatch ();
295 void slotSettingsSegments ();
296 void slotTableStatusChange ();
297 void slotTimeoutRegressionErrorReport ();
298 void slotTimeoutRegressionFileCmdScript ();
299 void slotUndoTextChanged (
const QString &);
300 void slotViewGridLines ();
301 void slotViewGroupBackground(QAction*);
302 void slotViewGroupCurves(QAction*);
303 void slotViewGroupStatus(QAction*);
304 void slotViewToolBarBackground ();
305 void slotViewToolBarChecklistGuide ();
306 void slotViewToolBarCoordSystem ();
307 void slotViewToolBarDigitize ();
308 void slotViewToolBarFittingWindow ();
309 void slotViewToolBarGeometryWindow ();
310 void slotViewToolBarSettingsViews ();
311 void slotViewToolTips ();
312 void slotViewZoom16To1 ();
313 void slotViewZoom8To1 ();
314 void slotViewZoom4To1 ();
315 void slotViewZoom2To1 ();
316 void slotViewZoom1To1 ();
317 void slotViewZoom1To2 ();
318 void slotViewZoom1To4 ();
319 void slotViewZoom1To8 ();
320 void slotViewZoom1To16 ();
321 void slotViewZoom (
int);
322 void slotViewZoomFill ();
323 void slotViewZoomIn ();
324 void slotViewZoomInFromWheelEvent ();
325 void slotViewZoomOut ();
326 void slotViewZoomOutFromWheelEvent ();
337 IMPORT_TYPE_ADVANCED,
338 IMPORT_TYPE_IMAGE_REPLACE
341 void addDockWindow (QDockWidget *dockWidget,
343 const QString &settingsTokenArea,
344 const QString &settingsTokenGeometry,
345 Qt::DockWidgetArea dockWidgetArea);
346 void applyZoomFactorAfterLoad();
347 virtual void closeEvent(QCloseEvent *event);
348 void createActions();
349 void createActionsDigitize ();
350 void createActionsEdit ();
351 void createActionsFile ();
352 void createActionsHelp ();
353 void createActionsSettings ();
354 void createActionsView ();
355 void createCentralWidget ();
356 void createCommandStackShadow ();
357 void createDockableWidgets ();
358 void createHelpWindow ();
360 void createLoadImageFromUrl ();
362 void createNetwork();
364 void createSettingsDialogs ();
365 void createStateContextBackground();
366 void createStateContextDigitize();
367 void createStateContextTransformation();
368 void createStatusBar();
369 void createToolBars();
370 void createTutorial();
371 void createZoomMap ();
372 ZoomFactor currentZoomFactor ()
const;
374 void exportAllCoordinateSystemsAfterRegressionTests();
376 QString exportFilenameFromInputFilename (
const QString &fileName)
const;
377 void fileExport(
const QString &fileName,
379 void fileImport (
const QString &fileName,
380 ImportType ImportType);
381 void fileImportWithPrompts (ImportType ImportType);
382 void filePaste (ImportType importType);
383 void ghostsCreate ();
384 void ghostsDestroy ();
385 void loadCoordSystemListFromCmdMediator();
386 void loadCurveListFromCmdMediator();
387 void loadDocumentFile (
const QString &fileName);
388 void loadErrorReportFile(
const QString &errorReportFile);
389 bool loadImage (
const QString &fileName,
391 ImportType ImportType);
392 bool loadImageNewDocument (
const QString &fileName,
394 ImportType ImportType);
395 bool loadImageReplacingImage (
const QString &fileName,
397 ImportType ImportType);
398 void loadInputFileForErrorReport(QDomDocument &domInputFile)
const;
399 void loadToolTips ();
403 const QString &selectedNameFilter)
const;
404 bool modeGraph ()
const;
405 bool modeMap ()
const;
406 void rebuildRecentFileListForCurrentFile(
const QString &filePath);
407 bool saveDocumentFile(
const QString &fileName);
408 QString saveErrorReportFileAndExitXml (
const char *comment,
411 const char *context)
const;
412 void saveStartingDocumentSnapshot();
413 void setCurrentFile(
const QString &fileName);
414 void setCurrentPathFromFile (
const QString &fileName);
415 void setPixmap (
const QString &curveSelected,
416 const QPixmap &pixmap);
417 void settingsRead (
bool isReset);
418 void settingsReadEnvironment (QSettings &settings);
419 void settingsReadMainWindow (QSettings &settings);
420 void settingsWrite ();
421 bool setupAfterLoadNewDocument (
const QString &fileName,
422 const QString &temporaryMessage,
423 ImportType ImportType);
424 bool setupAfterLoadReplacingImage (
const QString &fileName,
425 const QString &temporaryMessage,
426 ImportType ImportType);
427 void startRegressionTestErrorReport (
const QString ®ressionInputFile);
428 void startRegressionTestFileCmdScript ();
429 void updateAfterCommandStatusBarCoords ();
430 void updateChecklistGuide ();
431 void updateControls ();
432 void updateFittingWindow ();
433 void updateGeometryWindow ();
434 void updateGridLines();
435 void updateHighlightOpacity();
436 void updateRecentFileList();
437 void updateSettingsMainWindow();
438 void updateSmallDialogs();
439 void updateTransformationAndItsDependencies();
440 void updateViewedCurves ();
441 void updateViewsOfSettings ();
442 void updateWindowTitle ();
443 void writeCheckpointToLogFile();
445 QString m_originalFile;
446 bool m_originalFileWasImported;
447 bool m_isDocumentExported;
448 QString m_engaugeFile;
449 QString m_currentFile;
450 QString m_currentFileWithPathAndFileExtension;
451 MainTitleBarFormat m_titleBarFormat;
454 QAction *m_actionImport;
455 QAction *m_actionImportAdvanced;
456 QAction *m_actionImportImageReplace;
457 QAction *m_actionOpen;
458 QMenu *m_menuFileOpenRecent;
459 QList<QAction*> m_actionRecentFiles;
460 QAction *m_actionClose;
461 QAction *m_actionSave;
462 QAction *m_actionSaveAs;
463 QAction *m_actionExport;
464 QAction *m_actionPrint;
465 QAction *m_actionExit;
468 QAction *m_actionEditUndo;
469 QAction *m_actionEditRedo;
470 QAction *m_actionEditCut;
471 QAction *m_actionEditCopy;
472 QAction *m_actionEditPaste;
473 QAction *m_actionEditDelete;
474 QAction *m_actionEditPasteAsNew;
475 QAction *m_actionEditPasteAsNewAdvanced;
477 QMenu *m_menuDigitize;
478 QActionGroup *m_groupDigitize;
479 QAction *m_actionDigitizeSelect;
480 QAction *m_actionDigitizeAxis;
481 QAction *m_actionDigitizeScale;
482 QAction *m_actionDigitizeCurve;
483 QAction *m_actionDigitizePointMatch;
484 QAction *m_actionDigitizeColorPicker;
485 QAction *m_actionDigitizeSegment;
488 QAction *m_actionViewBackground;
489 QAction *m_actionViewChecklistGuide;
490 QAction *m_actionViewCoordSystem;
491 QAction *m_actionViewDigitize;
492 QAction *m_actionViewFittingWindow;
493 QAction *m_actionViewGeometryWindow;
494 QAction *m_actionViewSettingsViews;
495 QAction *m_actionViewToolTips;
496 QAction *m_actionViewGridLines;
497 QMenu *m_menuViewBackground;
498 QActionGroup *m_groupBackground;
499 QAction *m_actionViewBackgroundNone;
500 QAction *m_actionViewBackgroundOriginal;
501 QAction *m_actionViewBackgroundFiltered;
502 QMenu *m_menuViewCurves;
503 QActionGroup *m_groupCurves;
504 QAction *m_actionViewCurvesNone;
505 QAction *m_actionViewCurvesSelected;
506 QAction *m_actionViewCurvesAll;
507 QMenu *m_menuViewStatus;
508 QActionGroup *m_groupStatus;
509 QAction *m_actionStatusNever;
510 QAction *m_actionStatusTemporary;
511 QAction *m_actionStatusAlways;
512 QMenu *m_menuViewZoom;
513 QAction *m_actionZoomOut;
514 QAction *m_actionZoomIn;
515 QActionGroup *m_groupZoom;
516 QAction *m_actionZoomFill;
517 QAction *m_actionZoom16To1;
518 QAction *m_actionZoom8To1;
519 QAction *m_actionZoom4To1;
520 QAction *m_actionZoom2To1;
521 QAction *m_actionZoom1To1;
522 QAction *m_actionZoom1To2;
523 QAction *m_actionZoom1To4;
524 QAction *m_actionZoom1To8;
525 QAction *m_actionZoom1To16;
527 QMenu *m_menuSettings;
528 QAction *m_actionSettingsAxesChecker;
529 QAction *m_actionSettingsColorFilter;
530 QAction *m_actionSettingsCoords;
531 QAction *m_actionSettingsCurveAddRemove;
532 QAction *m_actionSettingsCurveProperties;
533 QAction *m_actionSettingsDigitizeCurve;
534 QAction *m_actionSettingsExport;
535 QAction *m_actionSettingsGeneral;
536 QAction *m_actionSettingsGridDisplay;
537 QAction *m_actionSettingsGridRemoval;
538 QAction *m_actionSettingsMainWindow;
539 QAction *m_actionSettingsPointMatch;
540 QAction *m_actionSettingsSegments;
543 QAction *m_actionHelpAbout;
544 QAction *m_actionHelpChecklistGuideWizard;
545 QAction *m_actionHelpHelp;
546 QAction *m_actionHelpTutorial;
547 QAction *m_actionHelpWhatsThis;
549 QVBoxLayout *m_layout;
556 QComboBox *m_cmbCurve;
557 QToolBar *m_toolDigitize;
560 QComboBox *m_cmbBackground;
561 QToolBar *m_toolBackground;
565 QToolBar *m_toolSettingsViews;
570 QComboBox *m_cmbCoordSystem;
571 QPushButton *m_btnPrintAll;
572 QPushButton *m_btnShowAll;
573 QToolBar *m_toolCoordSystem;
605 QString m_startingDocumentSnapshot;
613 QTimer *m_timerLoadStartupFiles;
614 QStringList m_loadStartupFiles;
622 QTimer *m_timerRegressionErrorReport;
624 bool m_isErrorReportRegressionTest;
625 QTimer *m_timerRegressionFileCmdScript;
626 QString m_regressionFile;
627 QString m_startupDirectory;
635 QMap<ZoomFactorInitial, ZoomFactor> m_zoomMap;
641 #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 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 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...
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.
Transformation transformation() const
Return read-only copy of transformation.
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.
void saveErrorReportFileAndExit(const char *comment, const char *file, int line, const char *context) const
Save error report and exit.
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.
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...
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...
virtual void showEvent(QShowEvent *)
Processing performed after gui becomes available.