Engauge Digitizer  2
SplineDrawer.h
1 /******************************************************************************************************
2  * (C) 2018 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 SPLINE_DRAWER_H
8 #define SPLINE_DRAWER_H
9 
10 #include "SplinePair.h"
11 #include "Transformation.h"
12 #include <QVector>
13 
14 class Spline;
15 
16 enum SplineDrawerOperation {
17  SPLINE_DRAWER_ENUM_INVISIBLE_MOVE, // Move to final point in segment
18  SPLINE_DRAWER_ENUM_VISIBLE_DRAW // Draw to final point in segment
19 };
20 
21 typedef QVector<SplineDrawerOperation> SegmentOperations;
22 
35 {
36  public:
38  SplineDrawer(const Transformation &transformation);
39 
41  void bindToSpline (int numSegments,
42  const Spline &spline);
43 
45  SplineDrawerOperation segmentOperation (int segment) const;
46 
47 private:
48  SplineDrawer();
49 
50  bool segmentIsMultiValued (const Spline &spline,
51  int numSegments,
52  int segment) const;
53 
54  const Transformation m_transformation;
55 
56  SegmentOperations m_segmentOperations;
57 };
58 
59 #endif // SPLINE_DRAWER_H
Cubic interpolation given independent and dependent value vectors.
Definition: Spline.h:29
void bindToSpline(int numSegments, const Spline &spline)
Analyze each segment in the Spline.
Affine transformation between screen and graph coordinates, based on digitized axis points...
SplineDrawerOperation segmentOperation(int segment) const
Indicate if, and how, segment is to be drawn.
This class takes the output from Spline and uses that to draw the curve in the graphics window...
Definition: SplineDrawer.h:34