Engauge Digitizer 2
|
This class takes the output from Spline and uses that to draw the curve in the graphics window, as a sequence of moves and draws. More...
#include <SplineDrawer.h>
Public Member Functions | |
SplineDrawer (const Transformation &transformation) | |
Single constructor. | |
void | bindToSpline (const LineStyle &lineStyle, int numSegments, const Spline &spline) |
Analyze each segment in the Spline. | |
bool | segmentIsMultiValued (const Spline &spline, int numSegments, int segment) const |
Return true if specified segment is multi-valued, else false. | |
SplineDrawerOperation | segmentOperation (int segment) const |
Indicate if, and how, segment is to be drawn. | |
Friends | |
class | TestSplineDrawer |
This class takes the output from Spline and uses that to draw the curve in the graphics window, as a sequence of moves and draws.
The moves and draws by themselves would be trivial (move,draw,draw,draw...) but this actually draws, when needed, differently styled curve segments to indicate each curve segment should be CONNECT_AS_FUNCTION_SMOOTH but actually is not single-valued (=not a function)
This class is aware of the Transformation, unlike the Spline class which is decoupled from that for simplicity. Specifically, this class converts the screen coordinates to graph coordinates to check for single-valuedness.
The algorithm used here has to work in cartesian, polar, linear and/or log coordinates. This requirement, along with the goal of keeping the Spline class simple, pretty much requires using the Transformation and working in graph coordinates.
Definition at line 35 of file SplineDrawer.h.
SplineDrawer::SplineDrawer | ( | const Transformation & | transformation | ) |
Single constructor.
Definition at line 13 of file SplineDrawer.cpp.
void SplineDrawer::bindToSpline | ( | const LineStyle & | lineStyle, |
int | numSegments, | ||
const Spline & | spline ) |
Analyze each segment in the Spline.
Definition at line 18 of file SplineDrawer.cpp.
bool SplineDrawer::segmentIsMultiValued | ( | const Spline & | spline, |
int | numSegments, | ||
int | segment ) const |
Return true if specified segment is multi-valued, else false.
Definition at line 48 of file SplineDrawer.cpp.
SplineDrawerOperation SplineDrawer::segmentOperation | ( | int | segment | ) | const |
Indicate if, and how, segment is to be drawn.
Definition at line 110 of file SplineDrawer.cpp.
|
friend |
Definition at line 38 of file SplineDrawer.h.