4 #include "BackgroundImage.h"
5 #include "DigitizeStateAbstractBase.h"
6 #include "MainWindowModel.h"
10 #include "Transformation.h"
11 #include "ZoomControl.h"
12 #include "ZoomFactor.h"
52 class QGraphicsLineItem;
74 QStringList loadStartupFiles,
100 const char *context)
const;
186 void slotCanRedoChanged (
bool);
187 void slotCanUndoChanged (
bool);
188 void slotChecklistClosed ();
189 void slotCleanChanged (
bool);
190 void slotCmbBackground(
int);
191 void slotCmbCurve(
int);
192 void slotContextMenuEvent (QString);
193 void slotDigitizeAxis ();
194 void slotDigitizeColorPicker ();
195 void slotDigitizeCurve ();
196 void slotDigitizePointMatch ();
197 void slotDigitizeSegment ();
198 void slotDigitizeSelect ();
199 void slotEditCopy ();
201 void slotEditDelete ();
202 void slotEditPaste ();
203 void slotFileClose ();
204 void slotFileExport ();
205 void slotFileImport();
206 void slotFileImportDraggedImage(QImage);
207 void slotFileImportDraggedImageUrl(QUrl);
208 void slotFileImportImage(QString, QImage);
210 void slotFileOpenDraggedDigFile (QString);
211 void slotFilePrint();
213 bool slotFileSaveAs();
214 void slotHelpAbout();
215 void slotHelpTutorial();
216 void slotKeyPress (Qt::Key,
bool);
218 void slotLoadStartupFiles ();
219 void slotMouseMove (QPointF);
220 void slotMousePress (QPointF);
221 void slotMouseRelease (QPointF);
222 void slotRecentFileAction ();
223 void slotRedoTextChanged (
const QString &);
224 void slotSetOverrideCursor (QCursor);
225 void slotSettingsAxesChecker ();
226 void slotSettingsColorFilter ();
227 void slotSettingsCoords ();
228 void slotSettingsCurveAddRemove ();
229 void slotSettingsCurveProperties ();
230 void slotSettingsDigitizeCurve ();
231 void slotSettingsExportFormat ();
232 void slotSettingsGeneral ();
233 void slotSettingsGridRemoval ();
234 void slotSettingsMainWindow ();
235 void slotSettingsPointMatch ();
236 void slotSettingsSegments ();
237 void slotUndoTextChanged (
const QString &);
238 void slotViewGroupBackground(QAction*);
239 void slotViewGroupCurves(QAction*);
240 void slotViewGroupStatus(QAction*);
241 void slotViewToolBarBackground ();
242 void slotViewToolBarChecklistGuide ();
243 void slotViewToolBarDigitize ();
244 void slotViewToolBarSettingsViews ();
245 void slotViewToolTips ();
246 void slotViewZoom16To1 ();
247 void slotViewZoom8To1 ();
248 void slotViewZoom4To1 ();
249 void slotViewZoom2To1 ();
250 void slotViewZoom1To1 ();
251 void slotViewZoom1To2 ();
252 void slotViewZoom1To4 ();
253 void slotViewZoom1To8 ();
254 void slotViewZoom1To16 ();
255 void slotViewZoom (
int);
256 void slotViewZoomFill ();
257 void slotViewZoomIn ();
258 void slotViewZoomOut ();
267 void applyZoomFactorAfterLoad();
268 virtual void closeEvent(QCloseEvent *event);
269 void createActions();
270 void createActionsDigitize ();
271 void createActionsEdit ();
272 void createActionsFile ();
273 void createActionsHelp ();
274 void createActionsSettings ();
275 void createActionsView ();
276 void createCentralWidget ();
277 void createCommandStackShadow ();
278 void createHelpWindow ();
280 void createLoadImageFromUrl ();
282 void createNetwork();
284 void createSettingsDialogs ();
285 void createStateContextBackground();
286 void createStateContextDigitize();
287 void createStateContextTransformation();
288 void createStatusBar();
289 void createToolBars();
290 void createTutorial();
291 ZoomFactor currentZoomFactor ()
const;
292 void fileImport (
const QString &fileName);
293 void loadCurveListFromCmdMediator();
294 void loadDocumentFile (
const QString &fileName);
295 void loadErrorReportFile(
const QString &initialPath,
296 const QString &errorReportFile);
297 void loadImage (
const QString &fileName,
298 const QImage &image);
299 void loadInputFileForErrorReport(QDomDocument &domInputFile)
const;
300 void loadToolTips ();
304 const QString &selectedNameFilter)
const;
305 void rebuildRecentFileListForCurrentFile(
const QString &filePath);
306 bool saveDocumentFile(
const QString &fileName);
307 QString saveErrorReportFileAndExitXml (
const char *comment,
311 bool includeDocument)
const;
312 void saveStartingDocumentSnapshot();
313 void setCurrentFile(
const QString &fileName);
314 void setCurrentPathFromFile (
const QString &fileName);
315 void setPixmap (
const QPixmap &pixmap);
316 void settingsRead ();
317 void settingsReadEnvironment (QSettings &settings);
318 void settingsReadMainWindow (QSettings &settings);
319 void settingsWrite ();
320 void setupAfterLoad (
const QString &fileName,
321 const QString &temporaryMessage);
322 void updateAfterCommandStatusBarCoords ();
323 void updateControls ();
324 void updateRecentFileList();
325 void updateSettingsMainWindow();
326 void updateTransformationAndItsDependencies();
327 void updateViewedCurves ();
328 void updateViewsOfSettings ();
329 void writeCheckpointToLogFile();
331 QString m_originalFile;
332 bool m_originalFileWasImported;
333 bool m_isDocumentExported;
334 QString m_engaugeFile;
335 QString m_currentFile;
338 QAction *m_actionImport;
339 QAction *m_actionOpen;
340 QMenu *m_menuFileOpenRecent;
341 QList<QAction*> m_actionRecentFiles;
342 QAction *m_actionClose;
343 QAction *m_actionSave;
344 QAction *m_actionSaveAs;
345 QAction *m_actionExport;
346 QAction *m_actionPrint;
347 QAction *m_actionExit;
350 QAction *m_actionEditUndo;
351 QAction *m_actionEditRedo;
352 QAction *m_actionEditCut;
353 QAction *m_actionEditCopy;
354 QAction *m_actionEditPaste;
355 QAction *m_actionEditDelete;
357 QMenu *m_menuDigitize;
358 QActionGroup *m_groupDigitize;
359 QAction *m_actionDigitizeSelect;
360 QAction *m_actionDigitizeAxis;
361 QAction *m_actionDigitizeCurve;
362 QAction *m_actionDigitizePointMatch;
363 QAction *m_actionDigitizeColorPicker;
364 QAction *m_actionDigitizeSegment;
367 QAction *m_actionViewBackground;
368 QAction *m_actionViewChecklistGuide;
369 QAction *m_actionViewDigitize;
370 QAction *m_actionViewSettingsViews;
371 QAction *m_actionViewToolTips;
372 QMenu *m_menuViewBackground;
373 QActionGroup *m_groupBackground;
374 QAction *m_actionViewBackgroundNone;
375 QAction *m_actionViewBackgroundOriginal;
376 QAction *m_actionViewBackgroundFiltered;
377 QMenu *m_menuViewCurves;
378 QActionGroup *m_groupCurves;
379 QAction *m_actionViewCurvesNone;
380 QAction *m_actionViewCurvesSelected;
381 QAction *m_actionViewCurvesAll;
382 QMenu *m_menuViewStatus;
383 QActionGroup *m_groupStatus;
384 QAction *m_actionStatusNever;
385 QAction *m_actionStatusTemporary;
386 QAction *m_actionStatusAlways;
387 QMenu *m_menuViewZoom;
388 QAction *m_actionZoomOut;
389 QAction *m_actionZoomIn;
390 QActionGroup *m_groupZoom;
391 QAction *m_actionZoomFill;
392 QAction *m_actionZoom16To1;
393 QAction *m_actionZoom8To1;
394 QAction *m_actionZoom4To1;
395 QAction *m_actionZoom2To1;
396 QAction *m_actionZoom1To1;
397 QAction *m_actionZoom1To2;
398 QAction *m_actionZoom1To4;
399 QAction *m_actionZoom1To8;
400 QAction *m_actionZoom1To16;
402 QMenu *m_menuSettings;
403 QAction *m_actionSettingsAxesChecker;
404 QAction *m_actionSettingsColorFilter;
405 QAction *m_actionSettingsCoords;
406 QAction *m_actionSettingsCurveAddRemove;
407 QAction *m_actionSettingsCurveProperties;
408 QAction *m_actionSettingsDigitizeCurve;
409 QAction *m_actionSettingsExport;
410 QAction *m_actionSettingsGeneral;
411 QAction *m_actionSettingsGridRemoval;
412 QAction *m_actionSettingsMainWindow;
413 QAction *m_actionSettingsPointMatch;
414 QAction *m_actionSettingsSegments;
417 QAction *m_actionHelpAbout;
418 QAction *m_actionHelpChecklistGuideWizard;
419 QAction *m_actionHelpHelp;
420 QAction *m_actionHelpTutorial;
421 QAction *m_actionHelpWhatsThis;
423 QVBoxLayout *m_layout;
430 QComboBox *m_cmbCurve;
431 QToolBar *m_toolDigitize;
434 QComboBox *m_cmbBackground;
435 QToolBar *m_toolBackground;
439 QToolBar *m_toolSettingsViews;
471 QString m_startingDocumentSnapshot;
479 QTimer *m_timerLoadStartupFiles;
480 QStringList m_loadStartupFiles;
483 #endif // MAIN_WINDOW_H
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...
virtual void wheelEvent(QWheelEvent *event)
Convert wheel events into zoom in/out.
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.
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...
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 and CmdSettingsMainWindow.
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 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.
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.