10 #include "BackgroundImage.h" 11 #include "CoordSystemIndex.h" 12 #include "DigitizeStateAbstractBase.h" 13 #include "DocumentAxesPointsRequired.h" 14 #include "GridLines.h" 15 #include "MainWindowModel.h" 17 #include <QMainWindow> 20 #include "Transformation.h" 21 #include "ZoomControl.h" 22 #include "ZoomFactor.h" 23 #include "ZoomFactorInitial.h" 68 class QGraphicsLineItem;
97 const QString &fileCmdScriptFile,
98 bool isRegressionTest,
101 QStringList loadStartupFiles,
102 QWidget *parent = 0);
139 const char *context)
const;
228 void slotBtnPrintAll();
229 void slotBtnShowAllPressed();
230 void slotBtnShowAllReleased();
231 void slotCanRedoChanged (
bool);
232 void slotCanUndoChanged (
bool);
233 void slotChecklistClosed ();
234 void slotCleanChanged (
bool);
235 void slotCmbBackground(
int);
236 void slotCmbCoordSystem(
int);
237 void slotCmbCurve(
int);
238 void slotContextMenuEventAxis (QString);
239 void slotContextMenuEventGraph (QStringList);
240 void slotDigitizeAxis ();
241 void slotDigitizeColorPicker ();
242 void slotDigitizeCurve ();
243 void slotDigitizePointMatch ();
244 void slotDigitizeSegment ();
245 void slotDigitizeSelect ();
246 void slotEditCopy ();
248 void slotEditDelete ();
249 void slotEditMenu ();
250 void slotEditPaste ();
251 void slotEditPasteAsNew ();
252 void slotEditPasteAsNewAdvanced ();
253 void slotFileClose ();
254 void slotFileExport ();
255 void slotFileImport();
256 void slotFileImportAdvanced();
257 void slotFileImportDraggedImage(QImage);
258 void slotFileImportDraggedImageUrl(QUrl);
259 void slotFileImportImage(QString, QImage);
260 void slotFileImportImageReplace();
262 void slotFileOpenDraggedDigFile (QString);
263 void slotFilePrint();
265 bool slotFileSaveAs();
266 void slotGeometryWindowClosed();
267 void slotHelpAbout();
268 void slotHelpTutorial();
269 void slotKeyPress (Qt::Key,
bool);
270 void slotLoadStartupFiles ();
271 void slotMouseMove (QPointF);
272 void slotMousePress (QPointF);
273 void slotMouseRelease (QPointF);
274 void slotRecentFileAction ();
275 void slotRecentFileClear ();
276 void slotRedoTextChanged (
const QString &);
277 void slotSettingsAxesChecker ();
278 void slotSettingsColorFilter ();
279 void slotSettingsCoords ();
280 void slotSettingsCurveAddRemove ();
281 void slotSettingsCurveProperties ();
282 void slotSettingsDigitizeCurve ();
283 void slotSettingsExportFormat ();
284 void slotSettingsGeneral ();
285 void slotSettingsGridDisplay ();
286 void slotSettingsGridRemoval ();
287 void slotSettingsMainWindow ();
288 void slotSettingsPointMatch ();
289 void slotSettingsSegments ();
290 void slotTimeoutRegressionErrorReport ();
291 void slotTimeoutRegressionFileCmdScript ();
292 void slotUndoTextChanged (
const QString &);
293 void slotViewGridLines ();
294 void slotViewGroupBackground(QAction*);
295 void slotViewGroupCurves(QAction*);
296 void slotViewGroupStatus(QAction*);
297 void slotViewToolBarBackground ();
298 void slotViewToolBarChecklistGuide ();
299 void slotViewToolBarCoordSystem ();
300 void slotViewToolBarDigitize ();
301 void slotViewToolBarGeometryWindow ();
302 void slotViewToolBarSettingsViews ();
303 void slotViewToolTips ();
304 void slotViewZoom16To1 ();
305 void slotViewZoom8To1 ();
306 void slotViewZoom4To1 ();
307 void slotViewZoom2To1 ();
308 void slotViewZoom1To1 ();
309 void slotViewZoom1To2 ();
310 void slotViewZoom1To4 ();
311 void slotViewZoom1To8 ();
312 void slotViewZoom1To16 ();
313 void slotViewZoom (
int);
314 void slotViewZoomFill ();
315 void slotViewZoomIn ();
316 void slotViewZoomInFromWheelEvent ();
317 void slotViewZoomOut ();
318 void slotViewZoomOutFromWheelEvent ();
329 IMPORT_TYPE_ADVANCED,
330 IMPORT_TYPE_IMAGE_REPLACE
333 void addDockWindow (QDockWidget *dockWidget,
335 const QString &settingsTokenArea,
336 const QString &settingsTokenGeometry,
337 Qt::DockWidgetArea dockWidgetArea);
338 void applyZoomFactorAfterLoad();
339 virtual void closeEvent(QCloseEvent *event);
340 void createActions();
341 void createActionsDigitize ();
342 void createActionsEdit ();
343 void createActionsFile ();
344 void createActionsHelp ();
345 void createActionsSettings ();
346 void createActionsView ();
347 void createCentralWidget ();
348 void createCommandStackShadow ();
349 void createDockableWidgets ();
350 void createHelpWindow ();
352 void createLoadImageFromUrl ();
354 void createNetwork();
356 void createSettingsDialogs ();
357 void createStateContextBackground();
358 void createStateContextDigitize();
359 void createStateContextTransformation();
360 void createStatusBar();
361 void createToolBars();
362 void createTutorial();
363 void createZoomMap ();
364 ZoomFactor currentZoomFactor ()
const;
366 void exportAllCoordinateSystemsAfterRegressionTests();
368 QString exportFilenameFromInputFilename (
const QString &fileName)
const;
369 void fileExport(
const QString &fileName,
371 void fileImport (
const QString &fileName,
372 ImportType ImportType);
373 void fileImportWithPrompts (ImportType ImportType);
374 void filePaste (ImportType importType);
375 void ghostsCreate ();
376 void ghostsDestroy ();
377 void loadCoordSystemListFromCmdMediator();
378 void loadCurveListFromCmdMediator();
379 void loadDocumentFile (
const QString &fileName);
380 void loadErrorReportFile(
const QString &errorReportFile);
381 bool loadImage (
const QString &fileName,
383 ImportType ImportType);
384 bool loadImageNewDocument (
const QString &fileName,
386 ImportType ImportType);
387 bool loadImageReplacingImage (
const QString &fileName,
389 ImportType ImportType);
390 void loadInputFileForErrorReport(QDomDocument &domInputFile)
const;
391 void loadToolTips ();
395 const QString &selectedNameFilter)
const;
396 void rebuildRecentFileListForCurrentFile(
const QString &filePath);
397 bool saveDocumentFile(
const QString &fileName);
398 QString saveErrorReportFileAndExitXml (
const char *comment,
401 const char *context)
const;
402 void saveStartingDocumentSnapshot();
403 void setCurrentFile(
const QString &fileName);
404 void setCurrentPathFromFile (
const QString &fileName);
405 void setPixmap (
const QString &curveSelected,
406 const QPixmap &pixmap);
407 void settingsRead (
bool isReset);
408 void settingsReadEnvironment (QSettings &settings);
409 void settingsReadMainWindow (QSettings &settings);
410 void settingsWrite ();
411 bool setupAfterLoadNewDocument (
const QString &fileName,
412 const QString &temporaryMessage,
413 ImportType ImportType);
414 bool setupAfterLoadReplacingImage (
const QString &fileName,
415 const QString &temporaryMessage,
416 ImportType ImportType);
417 void startRegressionTestErrorReport (
const QString ®ressionInputFile);
418 void startRegressionTestFileCmdScript ();
419 void updateAfterCommandStatusBarCoords ();
420 void updateChecklistGuide ();
421 void updateControls ();
422 void updateGeometryWindow ();
423 void updateGridLines();
424 void updateHighlightOpacity();
425 void updateRecentFileList();
426 void updateSettingsMainWindow();
427 void updateSmallDialogs();
428 void updateTransformationAndItsDependencies();
429 void updateViewedCurves ();
430 void updateViewsOfSettings ();
431 void updateWindowTitle ();
432 void writeCheckpointToLogFile();
434 QString m_originalFile;
435 bool m_originalFileWasImported;
436 bool m_isDocumentExported;
437 QString m_engaugeFile;
438 QString m_currentFile;
439 QString m_currentFileWithPathAndFileExtension;
440 MainTitleBarFormat m_titleBarFormat;
443 QAction *m_actionImport;
444 QAction *m_actionImportAdvanced;
445 QAction *m_actionImportImageReplace;
446 QAction *m_actionOpen;
447 QMenu *m_menuFileOpenRecent;
448 QList<QAction*> m_actionRecentFiles;
449 QAction *m_actionClose;
450 QAction *m_actionSave;
451 QAction *m_actionSaveAs;
452 QAction *m_actionExport;
453 QAction *m_actionPrint;
454 QAction *m_actionExit;
457 QAction *m_actionEditUndo;
458 QAction *m_actionEditRedo;
459 QAction *m_actionEditCut;
460 QAction *m_actionEditCopy;
461 QAction *m_actionEditPaste;
462 QAction *m_actionEditDelete;
463 QAction *m_actionEditPasteAsNew;
464 QAction *m_actionEditPasteAsNewAdvanced;
466 QMenu *m_menuDigitize;
467 QActionGroup *m_groupDigitize;
468 QAction *m_actionDigitizeSelect;
469 QAction *m_actionDigitizeAxis;
470 QAction *m_actionDigitizeCurve;
471 QAction *m_actionDigitizePointMatch;
472 QAction *m_actionDigitizeColorPicker;
473 QAction *m_actionDigitizeSegment;
476 QAction *m_actionViewBackground;
477 QAction *m_actionViewChecklistGuide;
478 QAction *m_actionViewCoordSystem;
479 QAction *m_actionViewDigitize;
480 QAction *m_actionViewGeometryWindow;
481 QAction *m_actionViewSettingsViews;
482 QAction *m_actionViewToolTips;
483 QAction *m_actionViewGridLines;
484 QMenu *m_menuViewBackground;
485 QActionGroup *m_groupBackground;
486 QAction *m_actionViewBackgroundNone;
487 QAction *m_actionViewBackgroundOriginal;
488 QAction *m_actionViewBackgroundFiltered;
489 QMenu *m_menuViewCurves;
490 QActionGroup *m_groupCurves;
491 QAction *m_actionViewCurvesNone;
492 QAction *m_actionViewCurvesSelected;
493 QAction *m_actionViewCurvesAll;
494 QMenu *m_menuViewStatus;
495 QActionGroup *m_groupStatus;
496 QAction *m_actionStatusNever;
497 QAction *m_actionStatusTemporary;
498 QAction *m_actionStatusAlways;
499 QMenu *m_menuViewZoom;
500 QAction *m_actionZoomOut;
501 QAction *m_actionZoomIn;
502 QActionGroup *m_groupZoom;
503 QAction *m_actionZoomFill;
504 QAction *m_actionZoom16To1;
505 QAction *m_actionZoom8To1;
506 QAction *m_actionZoom4To1;
507 QAction *m_actionZoom2To1;
508 QAction *m_actionZoom1To1;
509 QAction *m_actionZoom1To2;
510 QAction *m_actionZoom1To4;
511 QAction *m_actionZoom1To8;
512 QAction *m_actionZoom1To16;
514 QMenu *m_menuSettings;
515 QAction *m_actionSettingsAxesChecker;
516 QAction *m_actionSettingsColorFilter;
517 QAction *m_actionSettingsCoords;
518 QAction *m_actionSettingsCurveAddRemove;
519 QAction *m_actionSettingsCurveProperties;
520 QAction *m_actionSettingsDigitizeCurve;
521 QAction *m_actionSettingsExport;
522 QAction *m_actionSettingsGeneral;
523 QAction *m_actionSettingsGridDisplay;
524 QAction *m_actionSettingsGridRemoval;
525 QAction *m_actionSettingsMainWindow;
526 QAction *m_actionSettingsPointMatch;
527 QAction *m_actionSettingsSegments;
530 QAction *m_actionHelpAbout;
531 QAction *m_actionHelpChecklistGuideWizard;
532 QAction *m_actionHelpHelp;
533 QAction *m_actionHelpTutorial;
534 QAction *m_actionHelpWhatsThis;
536 QVBoxLayout *m_layout;
543 QComboBox *m_cmbCurve;
544 QToolBar *m_toolDigitize;
547 QComboBox *m_cmbBackground;
548 QToolBar *m_toolBackground;
552 QToolBar *m_toolSettingsViews;
556 QComboBox *m_cmbCoordSystem;
557 QPushButton *m_btnPrintAll;
558 QPushButton *m_btnShowAll;
559 QToolBar *m_toolCoordSystem;
591 QString m_startingDocumentSnapshot;
599 QTimer *m_timerLoadStartupFiles;
600 QStringList m_loadStartupFiles;
608 QTimer *m_timerRegressionErrorReport;
610 bool m_isErrorReportRegressionTest;
611 QTimer *m_timerRegressionFileCmdScript;
612 QString m_regressionFile;
613 QString m_startupDirectory;
621 QMap<ZoomFactorInitial, ZoomFactor> m_zoomMap;
624 #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.
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.
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.