From 12195ae69e60137e28c7c61a620c1617565269a0 Mon Sep 17 00:00:00 2001 From: cilix42 Date: Sun, 18 May 2008 18:31:07 +0000 Subject: [PATCH] Convenience access functions for first and last value of a Geom::Piecewise<> --- src/2geom/piecewise.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/2geom/piecewise.h b/src/2geom/piecewise.h index d548ea0e9..3b115cb95 100644 --- a/src/2geom/piecewise.h +++ b/src/2geom/piecewise.h @@ -73,6 +73,12 @@ class Piecewise { unsigned n = segN(t); return segs[n](segT(t, n)); } + inline output_type firstValue() const { + return valueAt(cuts.front()); + } + inline output_type lastValue() const { + return valueAt(cuts.back()); + } std::vector valueAndDerivatives(double t, unsigned cnt) const { unsigned n = segN(t); std::vector ret, val = segs[n].valueAndDerivatives(segT(t, n), cnt); -- 2.30.2