Engauge Digitizer  2
GraphicsLinesForCurves.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_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 Point;
18 class QGraphicsItem;
19 class QPointF;
20 class QTextStream;
21 class Transformation;
22 
23 typedef QHash<QString, GraphicsLinesForCurve*> GraphicsLinesContainer;
24 
27 {
28 public:
31 
34  void addPoint (const QString &curveName,
35  const QString &pointIdentifier,
36  double ordinal,
37  GraphicsPoint &point);
38 
40  void addRemoveCurves (GraphicsScene &scene,
41  const QStringList &curveNames);
42 
44  void lineMembershipPurge (const CurveStyles &curveStyles);
45 
47  void lineMembershipReset ();
48 
50  void print () const;
51 
53  void printStream (QString indentation,
54  QTextStream &str) const;
55 
57  void removePoint (const QString &identifier);
58 
62 
64  void resetOnLoad();
65 
67  void updateAfterCommand (GraphicsScene &scene,
68  const CurveStyles &curveStyles,
69  const QString &curveName,
70  const Point &point,
71  GeometryWindow *geometryWindow);
72 
74  void updateCurveStyles (const CurveStyles &modelCurveStyles);
75 
77  void updateGraphicsLinesToMatchGraphicsPoints (const CurveStyles &curveStyles);
78 
80  void updateHighlightOpacity (double highlightOpacity);
81 
83  void updatePointOrdinalsAfterDrag (const CurveStyles &curveStyles,
84  const Transformation &transformation);
85 
86 private:
87 
88  GraphicsLinesContainer m_graphicsLinesForCurve;
89 };
90 
91 #endif // GRAPHICS_LINES_FOR_CURVES_H
void lineMembershipPurge(const CurveStyles &curveStyles)
Mark the end of addPoint calls. Remove stale lines, insert missing lines, and draw the graphics lines...
void removePoint(const QString &identifier)
Remove the specified point. The act of deleting it will automatically remove it from the GraphicsScen...
void printStream(QString indentation, QTextStream &str) const
Debugging method that supports print method of this class and printStream method of some other class(...
GraphicsLinesForCurves()
Single constructor.
Model for DlgSettingsCurveProperties and CmdSettingsCurveProperties.
Definition: CurveStyles.h:22
void addPoint(const QString &curveName, const QString &pointIdentifier, double ordinal, GraphicsPoint &point)
Add new point.
void lineMembershipReset()
Mark points as unwanted. Afterwards, lineMembershipPurge gets called.
void removeTemporaryPointIfExists()
Remove temporary point if it exists.
Class that represents one digitized point. The screen-to-graph coordinate transformation is always ex...
Definition: Point.h:23
Window that displays the geometry information, as a table, for the current curve. ...
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 ...
void updatePointOrdinalsAfterDrag(const CurveStyles &curveStyles, const Transformation &transformation)
See GraphicsScene::updateOrdinalsAfterDrag.
This class stores the GraphicsLine objects for one Curve.
void updateGraphicsLinesToMatchGraphicsPoints(const CurveStyles &curveStyles)
Calls to moveLinesWithDraggedPoint have finished so update the lines correspondingly.
void print() const
Debugging method for printing directly from symbolic debugger.
Affine transformation between screen and graph coordinates, based on digitized axis points...
This class stores the GraphicsLinesForCurves objects, one per Curve.
Graphics item for drawing a circular or polygonal Point.
Definition: GraphicsPoint.h:43
void updateCurveStyles(const CurveStyles &modelCurveStyles)
Update the curve style for every curve.
Add point and line handling to generic QGraphicsScene.
Definition: GraphicsScene.h:33
void resetOnLoad()
Reset, when loading a document after the first, to same state that first document was at when loaded...
void addRemoveCurves(GraphicsScene &scene, const QStringList &curveNames)
Add new curves and remove expired curves to match the specified list.
void updateHighlightOpacity(double highlightOpacity)
Update the highlight opacity value. This may or may not affect the current display immediately depend...