X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;ds=inline;f=src%2F2geom%2Fcurve.h;h=65bf86ef6e7570db3f08707e5458e7e1355dcdf4;hb=a13531703adeeb1b8b4b9beca2499a51e37b36ad;hp=af02d6edba9d3afeb4db2292cfef3fccd2d5c3b7;hpb=6c3e745a94ef6b25a4ef9f018d350a7535aa45af;p=inkscape.git diff --git a/src/2geom/curve.h b/src/2geom/curve.h index af02d6edb..65bf86ef6 100644 --- a/src/2geom/curve.h +++ b/src/2geom/curve.h @@ -83,6 +83,8 @@ public: virtual int winding(Point p) const { return root_winding(*this, p); } + virtual int degreesOfFreedom() const { return 0;} + //mental: review these virtual Curve *portion(double f, double t) const = 0; virtual Curve *reverse() const { return portion(1, 0); } @@ -133,12 +135,12 @@ public: */ virtual Point unitTangentAt(Coord t, unsigned n = 3) const { - std::vector derivs = pointAndDerivatives(t, n); - for (unsigned deriv_n = 1; deriv_n < derivs.size(); deriv_n++) { + std::vector derivs = pointAndDerivatives(t, n); + for (unsigned deriv_n = 1; deriv_n < derivs.size(); deriv_n++) { Coord length = derivs[deriv_n].length(); if ( ! are_near(length, 0) ) { // length of derivative is non-zero, so return unit vector - derivs[deriv_n] / length; + return derivs[deriv_n] / length; } } return Point (0,0); @@ -170,4 +172,4 @@ Coord nearest_point(Point const& p, Curve const& c) fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 :