10 #include "BackgroundImage.h"
11 #include "CoordSystemIndex.h"
12 #include "DigitizeStateAbstractBase.h"
13 #include "DocumentAxesPointsRequired.h"
14 #include "MainWindowModel.h"
16 #include <QMainWindow>
18 #include "Transformation.h"
19 #include "ZoomControl.h"
20 #include "ZoomFactor.h"
62 class QGraphicsLineItem;
90 const QString &fileCmdScriptFile,
91 bool isRegressionTest,
93 QStringList loadStartupFiles,
131 const char *context)
const;
217 void slotBtnPrintAll();
218 void slotBtnShowAllPressed();
219 void slotBtnShowAllReleased();
220 void slotCanRedoChanged (
bool);
221 void slotCanUndoChanged (
bool);
222 void slotChecklistClosed ();
223 void slotCleanChanged (
bool);
224 void slotCmbBackground(
int);
225 void slotCmbCoordSystem(
int);
226 void slotCmbCurve(
int);
227 void slotContextMenuEvent (QString);
228 void slotDigitizeAxis ();
229 void slotDigitizeColorPicker ();
230 void slotDigitizeCurve ();
231 void slotDigitizePointMatch ();
232 void slotDigitizeSegment ();
233 void slotDigitizeSelect ();
234 void slotEditCopy ();
236 void slotEditDelete ();
237 void slotEditMenu ();
238 void slotEditPaste ();
239 void slotEditPasteAsNew ();
240 void slotEditPasteAsNewAdvanced ();
241 void slotFileClose ();
242 void slotFileExport ();
243 void slotFileImport();
244 void slotFileImportAdvanced();
245 void slotFileImportDraggedImage(QImage);
246 void slotFileImportDraggedImageUrl(QUrl);
247 void slotFileImportImage(QString, QImage);
249 void slotFileOpenDraggedDigFile (QString);
250 void slotFilePrint();
252 bool slotFileSaveAs();
253 void slotHelpAbout();
254 void slotHelpTutorial();
255 void slotKeyPress (Qt::Key,
bool);
257 void slotLoadStartupFiles ();
258 void slotMouseMove (QPointF);
259 void slotMousePress (QPointF);
260 void slotMouseRelease (QPointF);
261 void slotRecentFileAction ();
262 void slotRecentFileClear ();
263 void slotRedoTextChanged (
const QString &);
264 void slotSetOverrideCursor (QCursor);
265 void slotSettingsAxesChecker ();
266 void slotSettingsColorFilter ();
267 void slotSettingsCoords ();
268 void slotSettingsCurveAddRemove ();
269 void slotSettingsCurveProperties ();
270 void slotSettingsDigitizeCurve ();
271 void slotSettingsExportFormat ();
272 void slotSettingsGeneral ();
273 void slotSettingsGridRemoval ();
274 void slotSettingsMainWindow ();
275 void slotSettingsPointMatch ();
276 void slotSettingsSegments ();
277 void slotTimeoutRegressionErrorReport ();
278 void slotTimeoutRegressionFileCmdScript ();
279 void slotUndoTextChanged (
const QString &);
280 void slotViewGroupBackground(QAction*);
281 void slotViewGroupCurves(QAction*);
282 void slotViewGroupStatus(QAction*);
283 void slotViewToolBarBackground ();
284 void slotViewToolBarChecklistGuide ();
285 void slotViewToolBarCoordSystem ();
286 void slotViewToolBarDigitize ();
287 void slotViewToolBarSettingsViews ();
288 void slotViewToolTips ();
289 void slotViewZoom16To1 ();
290 void slotViewZoom8To1 ();
291 void slotViewZoom4To1 ();
292 void slotViewZoom2To1 ();
293 void slotViewZoom1To1 ();
294 void slotViewZoom1To2 ();
295 void slotViewZoom1To4 ();
296 void slotViewZoom1To8 ();
297 void slotViewZoom1To16 ();
298 void slotViewZoom (
int);
299 void slotViewZoomFill ();
300 void slotViewZoomIn ();
301 void slotViewZoomInFromWheelEvent ();
302 void slotViewZoomOut ();
303 void slotViewZoomOutFromWheelEvent ();
317 void applyZoomFactorAfterLoad();
318 virtual void closeEvent(QCloseEvent *event);
319 void createActions();
320 void createActionsDigitize ();
321 void createActionsEdit ();
322 void createActionsFile ();
323 void createActionsHelp ();
324 void createActionsSettings ();
325 void createActionsView ();
326 void createCentralWidget ();
327 void createCommandStackShadow ();
328 void createHelpWindow ();
330 void createLoadImageFromUrl ();
332 void createNetwork();
334 void createSettingsDialogs ();
335 void createStateContextBackground();
336 void createStateContextDigitize();
337 void createStateContextTransformation();
338 void createStatusBar();
339 void createToolBars();
340 void createTutorial();
341 ZoomFactor currentZoomFactor ()
const;
342 void exportAllCoordinateSystems();
343 QString exportFilenameFromInputFilename (
const QString &fileName)
const;
344 void fileExport(
const QString &fileName,
346 void fileImport (
const QString &fileName,
347 ImportType ImportType);
348 void fileImportWithPrompts (ImportType ImportType);
349 void filePaste (ImportType importType);
350 void ghostsCreate ();
351 void ghostsDestroy ();
352 void loadCoordSystemListFromCmdMediator();
353 void loadCurveListFromCmdMediator();
354 void loadDocumentFile (
const QString &fileName);
355 void loadErrorReportFile(
const QString &initialPath,
356 const QString &errorReportFile);
357 bool loadImage (
const QString &fileName,
359 ImportType ImportType);
360 void loadInputFileForErrorReport(QDomDocument &domInputFile)
const;
361 void loadToolTips ();
365 const QString &selectedNameFilter)
const;
366 void rebuildRecentFileListForCurrentFile(
const QString &filePath);
367 bool saveDocumentFile(
const QString &fileName);
368 QString saveErrorReportFileAndExitXml (
const char *comment,
371 const char *context)
const;
372 void saveStartingDocumentSnapshot();
373 void setCurrentFile(
const QString &fileName);
374 void setCurrentPathFromFile (
const QString &fileName);
375 void setPixmap (
const QPixmap &pixmap);
376 void settingsRead ();
377 void settingsReadEnvironment (QSettings &settings);
378 void settingsReadMainWindow (QSettings &settings);
379 void settingsWrite ();
380 bool setupAfterLoad (
const QString &fileName,
381 const QString &temporaryMessage,
382 ImportType ImportType);
383 void startRegressionTestErrorReport (
const QString ®ressionInputFile);
384 void startRegressionTestFileCmdScript ();
385 void updateAfterCommandStatusBarCoords ();
386 void updateControls ();
387 void updateRecentFileList();
388 void updateSettingsMainWindow();
389 void updateTransformationAndItsDependencies();
390 void updateViewedCurves ();
391 void updateViewsOfSettings ();
392 void updateWindowTitle ();
393 void writeCheckpointToLogFile();
395 QString m_originalFile;
396 bool m_originalFileWasImported;
397 bool m_isDocumentExported;
398 QString m_engaugeFile;
399 QString m_currentFile;
400 QString m_currentFileWithPathAndFileExtension;
401 MainTitleBarFormat m_titleBarFormat;
404 QAction *m_actionImport;
405 QAction *m_actionImportAdvanced;
406 QAction *m_actionOpen;
407 QMenu *m_menuFileOpenRecent;
408 QList<QAction*> m_actionRecentFiles;
409 QAction *m_actionClose;
410 QAction *m_actionSave;
411 QAction *m_actionSaveAs;
412 QAction *m_actionExport;
413 QAction *m_actionPrint;
414 QAction *m_actionExit;
417 QAction *m_actionEditUndo;
418 QAction *m_actionEditRedo;
419 QAction *m_actionEditCut;
420 QAction *m_actionEditCopy;
421 QAction *m_actionEditPaste;
422 QAction *m_actionEditDelete;
423 QAction *m_actionEditPasteAsNew;
424 QAction *m_actionEditPasteAsNewAdvanced;
426 QMenu *m_menuDigitize;
427 QActionGroup *m_groupDigitize;
428 QAction *m_actionDigitizeSelect;
429 QAction *m_actionDigitizeAxis;
430 QAction *m_actionDigitizeCurve;
431 QAction *m_actionDigitizePointMatch;
432 QAction *m_actionDigitizeColorPicker;
433 QAction *m_actionDigitizeSegment;
436 QAction *m_actionViewBackground;
437 QAction *m_actionViewChecklistGuide;
438 QAction *m_actionViewCoordSystem;
439 QAction *m_actionViewDigitize;
440 QAction *m_actionViewSettingsViews;
441 QAction *m_actionViewToolTips;
442 QMenu *m_menuViewBackground;
443 QActionGroup *m_groupBackground;
444 QAction *m_actionViewBackgroundNone;
445 QAction *m_actionViewBackgroundOriginal;
446 QAction *m_actionViewBackgroundFiltered;
447 QMenu *m_menuViewCurves;
448 QActionGroup *m_groupCurves;
449 QAction *m_actionViewCurvesNone;
450 QAction *m_actionViewCurvesSelected;
451 QAction *m_actionViewCurvesAll;
452 QMenu *m_menuViewStatus;
453 QActionGroup *m_groupStatus;
454 QAction *m_actionStatusNever;
455 QAction *m_actionStatusTemporary;
456 QAction *m_actionStatusAlways;
457 QMenu *m_menuViewZoom;
458 QAction *m_actionZoomOut;
459 QAction *m_actionZoomIn;
460 QActionGroup *m_groupZoom;
461 QAction *m_actionZoomFill;
462 QAction *m_actionZoom16To1;
463 QAction *m_actionZoom8To1;
464 QAction *m_actionZoom4To1;
465 QAction *m_actionZoom2To1;
466 QAction *m_actionZoom1To1;
467 QAction *m_actionZoom1To2;
468 QAction *m_actionZoom1To4;
469 QAction *m_actionZoom1To8;
470 QAction *m_actionZoom1To16;
472 QMenu *m_menuSettings;
473 QAction *m_actionSettingsAxesChecker;
474 QAction *m_actionSettingsColorFilter;
475 QAction *m_actionSettingsCoords;
476 QAction *m_actionSettingsCurveAddRemove;
477 QAction *m_actionSettingsCurveProperties;
478 QAction *m_actionSettingsDigitizeCurve;
479 QAction *m_actionSettingsExport;
480 QAction *m_actionSettingsGeneral;
481 QAction *m_actionSettingsGridRemoval;
482 QAction *m_actionSettingsMainWindow;
483 QAction *m_actionSettingsPointMatch;
484 QAction *m_actionSettingsSegments;
487 QAction *m_actionHelpAbout;
488 QAction *m_actionHelpChecklistGuideWizard;
489 QAction *m_actionHelpHelp;
490 QAction *m_actionHelpTutorial;
491 QAction *m_actionHelpWhatsThis;
493 QVBoxLayout *m_layout;
500 QComboBox *m_cmbCurve;
501 QToolBar *m_toolDigitize;
504 QComboBox *m_cmbBackground;
505 QToolBar *m_toolBackground;
509 QToolBar *m_toolSettingsViews;
512 QComboBox *m_cmbCoordSystem;
513 QPushButton *m_btnPrintAll;
514 QPushButton *m_btnShowAll;
515 QToolBar *m_toolCoordSystem;
546 QString m_startingDocumentSnapshot;
554 QTimer *m_timerLoadStartupFiles;
555 QStringList m_loadStartupFiles;
563 QTimer *m_timerRegressionErrorReport;
565 QTimer *m_timerRegressionFileCmdScript;
566 QString m_regressionFile;
569 #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.
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...
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 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.
Dialog for editing general settings.
Model for DlgSettingsCoords and CmdSettingsCoords.
void updateAfterCommand()
See GraphicsScene::updateAfterCommand.
void updateSettingsColorFilter(const DocumentModelColorFilter &modelColorFilter)
Update with new color filter properties.
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.
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.