Engauge Digitizer 2
Loading...
Searching...
No Matches
GraphicsScene.h
1/******************************************************************************************************
2 * (C) 2014 markummitchell@github.com. This file is part of Engauge Digitizer, which is released *
3 * under GNU General Public License version 2 (GPLv2) or (at your option) any later version. See file *
4 * LICENSE or go to gnu.org/licenses for details. Distribution requires prior written permission. *
5 ******************************************************************************************************/
6
7#ifndef GRAPHICS_SCENE_H
8#define GRAPHICS_SCENE_H
9
10#include "CmdMediator.h"
11#include "GraphicsLinesForCurves.h"
12#include <QGraphicsScene>
13#include <QStringList>
14
15class CmdMediator;
16class Curve;
17class CurvesGraphs;
18class CurveStyles;
19class GraphicsPoint;
20class MainWindow;
21class PointStyle;
22class QTextStream;
23class Transformation;
24
31class GraphicsScene : public QGraphicsScene
32{
33public:
35 GraphicsScene(MainWindow *mainWindow);
36
38 void addTemporaryPoint (const QString &identifier,
39 GraphicsPoint *point);
40
42 GraphicsPoint *createPoint (const QString &identifier,
43 const PointStyle &pointStyle,
44 const QPointF &posScreen);
45
48
50 QStringList positionHasChangedPointIdentifiers () const;
51
53 void printStream (QString indentation,
54 QTextStream &str);
55
57 void removePoint (const QString &identifier);
58
62
64 void resetOnLoad();
65
68
70 QStringList selectedPointIdentifiers () const;
71
73 void showCurves (bool show,
74 bool showAll = false,
75 const QString &curveName = "");
76
79 void updateAfterCommand (CmdMediator &cmdMediator);
80
82 void updateCurveStyles(const CurveStyles &modelCurveStyles);
83
86 void updateGraphicsLinesToMatchGraphicsPoints (const CurveStyles &modelCurveStyles,
87 const Transformation &transformation);
88
89private:
90
92 QString dumpCursors () const;
93
94 const QGraphicsPixmapItem *image () const;
95
97 void updateCurves (CmdMediator &cmdMediator);
98
100 void updatePointMembership (CmdMediator &cmdMediator);
101
103 GraphicsLinesForCurves m_graphicsLinesForCurves;
104};
105
106#endif // GRAPHICS_SCENE_H
Command queue stack.
Definition CmdMediator.h:24
Model for DlgSettingsCurveProperties and CmdSettingsCurveProperties.
Definition CurveStyles.h:23
Container for one set of digitized Points.
Definition Curve.h:33
Container for all graph curves. The axes point curve is external to this class.
This class stores the GraphicsLinesForCurves objects, one per Curve.
Graphics item for drawing a circular or polygonal Point.
Add point and line handling to generic QGraphicsScene.
void updateGraphicsLinesToMatchGraphicsPoints(const CurveStyles &modelCurveStyles, const Transformation &transformation)
A mouse move has just occurred so move the selected points, since they were dragged.
void resetOnLoad()
Reset, when loading a document after the first, to same state that first document was at when loaded.
void updateAfterCommand(CmdMediator &cmdMediator)
Update the Points and their Curves after executing a command.
QStringList selectedPointIdentifiers() const
Return a list of identifiers for the currently selected points.
void hideAllItemsExceptImage()
Hide all graphics items, except background image, in preparation for preview during IMPORT_TYPE_ADVAN...
void addTemporaryPoint(const QString &identifier, GraphicsPoint *point)
Add one temporary point to m_graphicsLinesForCurves. Non-temporary points are handled by the updateLi...
QStringList positionHasChangedPointIdentifiers() const
Return a list of identifiers for the points that have moved since the last call to resetPositionHasCh...
void showCurves(bool show, bool showAll=false, const QString &curveName="")
Show or hide all Curves (if showAll is true) or just the selected Curve (if showAll is false);.
void resetPositionHasChangedFlags()
Reset positionHasChanged flag for all items. Typically this is done as part of mousePressEvent.
void printStream(QString indentation, QTextStream &str)
Debugging method that supports print method of this class and printStream method of some other class(...
void removeTemporaryPointIfExists()
Remove temporary point if it exists.
void removePoint(const QString &identifier)
Remove specified point. This aborts if the point does not exist.
void updateCurveStyles(const CurveStyles &modelCurveStyles)
Update curve styles after settings changed.
GraphicsPoint * createPoint(const QString &identifier, const PointStyle &pointStyle, const QPointF &posScreen)
Create one QGraphicsItem-based object that represents one Point. It is NOT added to m_graphicsLinesFo...
Main window consisting of menu, graphics scene, status bar and optional toolbars as a Single Document...
Definition MainWindow.h:78
Details for a specific Point.
Definition PointStyle.h:21
Affine transformation between screen and graph coordinates, based on digitized axis points.