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 &initialPath,
384 const QString ®ressionInputFile);
385 void startRegressionTestFileCmdScript ();
386 void updateAfterCommandStatusBarCoords ();
387 void updateControls ();
388 void updateRecentFileList();
389 void updateSettingsMainWindow();
390 void updateTransformationAndItsDependencies();
391 void updateViewedCurves ();
392 void updateViewsOfSettings ();
393 void updateWindowTitle ();
394 void writeCheckpointToLogFile();
396 QString m_originalFile;
397 bool m_originalFileWasImported;
398 bool m_isDocumentExported;
399 QString m_engaugeFile;
400 QString m_currentFile;
401 QString m_currentFileWithPathAndFileExtension;
402 MainTitleBarFormat m_titleBarFormat;
405 QAction *m_actionImport;
406 QAction *m_actionImportAdvanced;
407 QAction *m_actionOpen;
408 QMenu *m_menuFileOpenRecent;
409 QList<QAction*> m_actionRecentFiles;
410 QAction *m_actionClose;
411 QAction *m_actionSave;
412 QAction *m_actionSaveAs;
413 QAction *m_actionExport;
414 QAction *m_actionPrint;
415 QAction *m_actionExit;
418 QAction *m_actionEditUndo;
419 QAction *m_actionEditRedo;
420 QAction *m_actionEditCut;
421 QAction *m_actionEditCopy;
422 QAction *m_actionEditPaste;
423 QAction *m_actionEditDelete;
424 QAction *m_actionEditPasteAsNew;
425 QAction *m_actionEditPasteAsNewAdvanced;
427 QMenu *m_menuDigitize;
428 QActionGroup *m_groupDigitize;
429 QAction *m_actionDigitizeSelect;
430 QAction *m_actionDigitizeAxis;
431 QAction *m_actionDigitizeCurve;
432 QAction *m_actionDigitizePointMatch;
433 QAction *m_actionDigitizeColorPicker;
434 QAction *m_actionDigitizeSegment;
437 QAction *m_actionViewBackground;
438 QAction *m_actionViewChecklistGuide;
439 QAction *m_actionViewCoordSystem;
440 QAction *m_actionViewDigitize;
441 QAction *m_actionViewSettingsViews;
442 QAction *m_actionViewToolTips;
443 QMenu *m_menuViewBackground;
444 QActionGroup *m_groupBackground;
445 QAction *m_actionViewBackgroundNone;
446 QAction *m_actionViewBackgroundOriginal;
447 QAction *m_actionViewBackgroundFiltered;
448 QMenu *m_menuViewCurves;
449 QActionGroup *m_groupCurves;
450 QAction *m_actionViewCurvesNone;
451 QAction *m_actionViewCurvesSelected;
452 QAction *m_actionViewCurvesAll;
453 QMenu *m_menuViewStatus;
454 QActionGroup *m_groupStatus;
455 QAction *m_actionStatusNever;
456 QAction *m_actionStatusTemporary;
457 QAction *m_actionStatusAlways;
458 QMenu *m_menuViewZoom;
459 QAction *m_actionZoomOut;
460 QAction *m_actionZoomIn;
461 QActionGroup *m_groupZoom;
462 QAction *m_actionZoomFill;
463 QAction *m_actionZoom16To1;
464 QAction *m_actionZoom8To1;
465 QAction *m_actionZoom4To1;
466 QAction *m_actionZoom2To1;
467 QAction *m_actionZoom1To1;
468 QAction *m_actionZoom1To2;
469 QAction *m_actionZoom1To4;
470 QAction *m_actionZoom1To8;
471 QAction *m_actionZoom1To16;
473 QMenu *m_menuSettings;
474 QAction *m_actionSettingsAxesChecker;
475 QAction *m_actionSettingsColorFilter;
476 QAction *m_actionSettingsCoords;
477 QAction *m_actionSettingsCurveAddRemove;
478 QAction *m_actionSettingsCurveProperties;
479 QAction *m_actionSettingsDigitizeCurve;
480 QAction *m_actionSettingsExport;
481 QAction *m_actionSettingsGeneral;
482 QAction *m_actionSettingsGridRemoval;
483 QAction *m_actionSettingsMainWindow;
484 QAction *m_actionSettingsPointMatch;
485 QAction *m_actionSettingsSegments;
488 QAction *m_actionHelpAbout;
489 QAction *m_actionHelpChecklistGuideWizard;
490 QAction *m_actionHelpHelp;
491 QAction *m_actionHelpTutorial;
492 QAction *m_actionHelpWhatsThis;
494 QVBoxLayout *m_layout;
501 QComboBox *m_cmbCurve;
502 QToolBar *m_toolDigitize;
505 QComboBox *m_cmbBackground;
506 QToolBar *m_toolBackground;
510 QToolBar *m_toolSettingsViews;
513 QComboBox *m_cmbCoordSystem;
514 QPushButton *m_btnPrintAll;
515 QPushButton *m_btnShowAll;
516 QToolBar *m_toolCoordSystem;
547 QString m_startingDocumentSnapshot;
555 QTimer *m_timerLoadStartupFiles;
556 QStringList m_loadStartupFiles;
564 QTimer *m_timerRegressionErrorReport;
566 QTimer *m_timerRegressionFileCmdScript;
567 QString m_regressionFile;
570 #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.