Engauge Digitizer 2
Loading...
Searching...
No Matches
SplineDrawer.h
Go to the documentation of this file.
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
14class LineStyle;
15class Spline;
16
18 SPLINE_DRAWER_ENUM_INVISIBLE_MOVE, // Move to final point in segment
19 SPLINE_DRAWER_ENUM_VISIBLE_DRAW // Draw to final point in segment
20};
21
22typedef QVector<SplineDrawerOperation> SegmentOperations;
23
36{
37 // For unit testing
38 friend class TestSplineDrawer;
39
40 public:
42 SplineDrawer(const Transformation &transformation);
43
45 void bindToSpline (const LineStyle &lineStyle,
46 int numSegments,
47 const Spline &spline);
48
50 bool segmentIsMultiValued (const Spline &spline,
51 int numSegments,
52 int segment) const;
53
55 SplineDrawerOperation segmentOperation (int segment) const;
56
57private:
59
60 const Transformation m_transformation;
61
62 SegmentOperations m_segmentOperations;
63};
64
65#endif // SPLINE_DRAWER_H
SplineDrawerOperation
@ SPLINE_DRAWER_ENUM_INVISIBLE_MOVE
@ SPLINE_DRAWER_ENUM_VISIBLE_DRAW
QVector< SplineDrawerOperation > SegmentOperations
Details for a specific Line.
Definition LineStyle.h:20
void bindToSpline(const LineStyle &lineStyle, int numSegments, const Spline &spline)
Analyze each segment in the Spline.
SplineDrawer(const Transformation &transformation)
Single constructor.
friend class TestSplineDrawer
SplineDrawerOperation segmentOperation(int segment) const
Indicate if, and how, segment is to be drawn.
bool segmentIsMultiValued(const Spline &spline, int numSegments, int segment) const
Return true if specified segment is multi-valued, else false.
Cubic interpolation given independent and dependent value vectors.
Definition Spline.h:30
Affine transformation between screen and graph coordinates, based on digitized axis points.