Engauge Digitizer  2
GraphicsLinesForCurves.h
Go to the documentation of this file.
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_LINES_FOR_CURVES_H
8 #define GRAPHICS_LINES_FOR_CURVES_H
9 
10 #include <QHash>
11 
12 class CurveStyles;
13 class GeometryWindow;
15 class GraphicsPoint;
16 class GraphicsScene;
17 class LineStyle;
18 class Point;
19 class QGraphicsItem;
20 class QPainterPath;
21 class QPointF;
22 class QTextStream;
24 class Transformation;
25 
26 typedef QHash<QString, GraphicsLinesForCurve*> GraphicsLinesContainer;
27 
30 {
31 public:
34 
37  void addPoint (const QString &curveName,
38  const QString &pointIdentifier,
39  double ordinal,
40  GraphicsPoint &point);
41 
43  void addRemoveCurves (GraphicsScene &scene,
44  const QStringList &curveNames);
45 
47  void lineMembershipPurge (const CurveStyles &curveStyles,
48  SplineDrawer &splineDrawer,
49  QPainterPath &pathMultiValued,
50  LineStyle &lineMultiValued);
51 
53  void lineMembershipReset ();
54 
56  void print () const;
57 
59  void printStream (QString indentation,
60  QTextStream &str) const;
61 
63  void removePoint (const QString &identifier);
64 
68 
70  void resetOnLoad();
71 
73  void updateAfterCommand (GraphicsScene &scene,
74  const CurveStyles &curveStyles,
75  const QString &curveName,
76  const Point &point,
77  GeometryWindow *geometryWindow);
78 
80  void updateCurveStyles (const CurveStyles &modelCurveStyles);
81 
84  SplineDrawer &splineDrawer,
85  QPainterPath &pathMultiValued,
86  LineStyle &lineMultiValued);
87 
89  void updateHighlightOpacity (double highlightOpacity);
90 
92  void updatePointOrdinalsAfterDrag (const CurveStyles &curveStyles,
93  const Transformation &transformation);
94 
95 private:
96 
97  GraphicsLinesContainer m_graphicsLinesForCurve;
98 };
99 
100 #endif // GRAPHICS_LINES_FOR_CURVES_H
GraphicsLinesForCurves::lineMembershipPurge
void lineMembershipPurge(const CurveStyles &curveStyles, SplineDrawer &splineDrawer, QPainterPath &pathMultiValued, LineStyle &lineMultiValued)
Mark the end of addPoint calls. Remove stale lines, insert missing lines, and draw the graphics lines...
Definition: GraphicsLinesForCurves.cpp:84
GraphicsLinesForCurves
This class stores the GraphicsLinesForCurves objects, one per Curve.
Definition: GraphicsLinesForCurves.h:28
GraphicsLinesContainer
QHash< QString, GraphicsLinesForCurve * > GraphicsLinesContainer
Definition: GraphicsLinesForCurves.h:23
GraphicsLinesForCurves::GraphicsLinesForCurves
GraphicsLinesForCurves()
Single constructor.
Definition: GraphicsLinesForCurves.cpp:25
GraphicsLinesForCurves::printStream
void printStream(QString indentation, QTextStream &str) const
Debugging method that supports print method of this class and printStream method of some other class(...
Definition: GraphicsLinesForCurves.cpp:126
Transformation
Affine transformation between screen and graph coordinates, based on digitized axis points.
Definition: Transformation.h:30
GraphicsLinesForCurves::removeTemporaryPointIfExists
void removeTemporaryPointIfExists()
Remove temporary point if it exists.
Definition: GraphicsLinesForCurves.cpp:156
GraphicsLinesForCurves::addPoint
void addPoint(const QString &curveName, const QString &pointIdentifier, double ordinal, GraphicsPoint &point)
Add new point.
Definition: GraphicsLinesForCurves.cpp:29
GraphicsLinesForCurves::removePoint
void removePoint(const QString &identifier)
Remove the specified point. The act of deleting it will automatically remove it from the GraphicsScen...
Definition: GraphicsLinesForCurves.cpp:143
GraphicsLinesForCurves::print
void print() const
Debugging method for printing directly from symbolic debugger.
Definition: GraphicsLinesForCurves.cpp:117
LineStyle
Details for a specific Line.
Definition: LineStyle.h:18
GraphicsLinesForCurve
This class stores the GraphicsLine objects for one Curve.
Definition: GraphicsLinesForCurve.h:26
GraphicsScene
Add point and line handling to generic QGraphicsScene.
Definition: GraphicsScene.h:35
GraphicsLinesForCurves::updateCurveStyles
void updateCurveStyles(const CurveStyles &modelCurveStyles)
Update the curve style for every curve.
Definition: GraphicsLinesForCurves.cpp:196
GraphicsLinesForCurves::updateGraphicsLinesToMatchGraphicsPoints
void updateGraphicsLinesToMatchGraphicsPoints(const CurveStyles &curveStyles, SplineDrawer &splineDrawer, QPainterPath &pathMultiValued, LineStyle &lineMultiValued)
Calls to moveLinesWithDraggedPoint have finished so update the lines correspondingly.
Definition: GraphicsLinesForCurves.cpp:209
SplineDrawer
This class takes the output from Spline and uses that to draw the curve in the graphics window,...
Definition: SplineDrawer.h:34
GraphicsLinesForCurves::updateAfterCommand
void updateAfterCommand(GraphicsScene &scene, const CurveStyles &curveStyles, const QString &curveName, const Point &point, GeometryWindow *geometryWindow)
Update the GraphicsScene with the specified Point from the Document. If it does not exist yet in the ...
Definition: GraphicsLinesForCurves.cpp:179
GraphicsLinesForCurves::resetOnLoad
void resetOnLoad()
Reset, when loading a document after the first, to same state that first document was at when loaded.
Definition: GraphicsLinesForCurves.cpp:166
GraphicsLinesForCurves::updatePointOrdinalsAfterDrag
void updatePointOrdinalsAfterDrag(const CurveStyles &curveStyles, const Transformation &transformation)
See GraphicsScene::updateOrdinalsAfterDrag.
Definition: GraphicsLinesForCurves.cpp:246
GraphicsPoint
Graphics item for drawing a circular or polygonal Point.
Definition: GraphicsPoint.h:42
Point
Class that represents one digitized point. The screen-to-graph coordinate transformation is always ex...
Definition: Point.h:24
GeometryWindow
Window that displays the geometry information, as a table, for the current curve.
Definition: GeometryWindow.h:27
CurveStyles
Model for DlgSettingsCurveProperties and CmdSettingsCurveProperties.
Definition: CurveStyles.h:21
GraphicsLinesForCurves::lineMembershipReset
void lineMembershipReset()
Mark points as unwanted. Afterwards, lineMembershipPurge gets called.
Definition: GraphicsLinesForCurves.cpp:104
GraphicsLinesForCurves::updateHighlightOpacity
void updateHighlightOpacity(double highlightOpacity)
Update the highlight opacity value. This may or may not affect the current display immediately depend...
Definition: GraphicsLinesForCurves.cpp:232
GraphicsLinesForCurves::addRemoveCurves
void addRemoveCurves(GraphicsScene &scene, const QStringList &curveNames)
Add new curves and remove expired curves to match the specified list.
Definition: GraphicsLinesForCurves.cpp:45