summaryrefslogtreecommitdiffstats
path: root/src/2geom/piecewise.h
diff options
context:
space:
mode:
authorJohan B. C. Engelen <jbc.engelen@swissonline.ch>2009-11-23 21:15:06 +0000
committerjohanengelen <johanengelen@users.sourceforge.net>2009-11-23 21:15:06 +0000
commitb0a9bcb9e1da6e5192cf37aedcd3b87a4041b911 (patch)
treeb302be68624c043cb13d55f9f17d0eb993cf1acb /src/2geom/piecewise.h
parentwork on the lpe group undo bug. it's not solved, but i think LPE code does ev... (diff)
downloadinkscape-b0a9bcb9e1da6e5192cf37aedcd3b87a4041b911.tar.gz
inkscape-b0a9bcb9e1da6e5192cf37aedcd3b87a4041b911.zip
update 2geom. needed for extrude lpe
(bzr r8840)
Diffstat (limited to '')
-rw-r--r--src/2geom/piecewise.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/2geom/piecewise.h b/src/2geom/piecewise.h
index a5be42587..a0628daf1 100644
--- a/src/2geom/piecewise.h
+++ b/src/2geom/piecewise.h
@@ -58,7 +58,7 @@ namespace Geom {
* \begin{array}{cc}
* s_1,& t <= c_2 \\
* s_2,& c_2 <= t <= c_3\\
- * \ldots
+ * \ldots \\
* s_n,& c_n <= t
* \end{array}\right.
* \f]
@@ -105,6 +105,10 @@ class Piecewise {
inline output_type lastValue() const {
return valueAt(cuts.back());
}
+
+ /**
+ * The size of the returned vector equals n_derivs+1.
+ */
std::vector<output_type> valueAndDerivatives(double t, unsigned n_derivs) const {
unsigned n = segN(t);
std::vector<output_type> ret, val = segs[n].valueAndDerivatives(segT(t, n), n_derivs);
@@ -115,6 +119,7 @@ class Piecewise {
}
return ret;
}
+
//TODO: maybe it is not a good idea to have this?
Piecewise<T> operator()(SBasis f);
Piecewise<T> operator()(Piecewise<SBasis>f);
@@ -773,10 +778,10 @@ Piecewise<T> reverse(Piecewise<T> const &f) {
return ret;
}
-
/**
* Interpolates between a and b.
* \return a if t = 0, b if t = 1, or an interpolation between a and b for t in [0,1]
+ * \relates Piecewise
*/
template<typename T>
Piecewise<T> lerp(double t, Piecewise<T> const &a, Piecewise<T> b) {