From f5b0c2b6acb660712ef0c1ab29d6e8c7554c163e Mon Sep 17 00:00:00 2001 From: johanengelen Date: Tue, 6 Nov 2007 18:38:31 +0000 Subject: [PATCH] 2geom update to 2Geom-SVN-rev. 1161 --- src/2geom/path.h | 2 ++ src/2geom/piecewise.h | 20 ++++++++++---------- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/src/2geom/path.h b/src/2geom/path.h index 8930a8a7f..46d7f230a 100644 --- a/src/2geom/path.h +++ b/src/2geom/path.h @@ -301,6 +301,7 @@ public: return std::pair(a, b); } +// TODO: how are the flags affected by reducing an arc from more than 180deg to less than 180deg? Curve *portion(double f, double t) const { SVGEllipticalArc *ret = new SVGEllipticalArc (*this); ret->initial_ = pointAt(f); @@ -308,6 +309,7 @@ public: return ret; } +// TODO: incomplete/buggy Curve *reverse(double /*f*/, double /*t*/) const { SVGEllipticalArc *ret = new SVGEllipticalArc (*this); ret->initial_ = final_; diff --git a/src/2geom/piecewise.h b/src/2geom/piecewise.h index 8823c21dd..396811050 100644 --- a/src/2geom/piecewise.h +++ b/src/2geom/piecewise.h @@ -214,40 +214,40 @@ class Piecewise { }; template -inline Interval bounds_fast(const Piecewise &f) { +inline typename FragmentConcept::BoundsType bounds_fast(const Piecewise &f) { boost::function_requires >(); - if(f.empty()) return Interval(0); - Interval ret(bounds_fast(f[0])); + if(f.empty()) return typename FragmentConcept::BoundsType(); + typename FragmentConcept::BoundsType ret(bounds_fast(f[0])); for(unsigned i = 1; i < f.size(); i++) ret.unionWith(bounds_fast(f[i])); return ret; } template -inline Interval bounds_exact(const Piecewise &f) { +inline typename FragmentConcept::BoundsType bounds_exact(const Piecewise &f) { boost::function_requires >(); - if(f.empty()) return Interval(0); - Interval ret(bounds_exact(f[0])); + if(f.empty()) return typename FragmentConcept::BoundsType(); + typename FragmentConcept::BoundsType ret(bounds_exact(f[0])); for(unsigned i = 1; i < f.size(); i++) ret.unionWith(bounds_exact(f[i])); return ret; } template -inline Interval bounds_local(const Piecewise &f, const Interval &m) { +inline typename FragmentConcept::BoundsType bounds_local(const Piecewise &f, const Interval &m) { boost::function_requires >(); - if(f.empty()) return Interval(0); - if(m.isEmpty()) return Interval(f(m.min())); + if(f.empty()) return typename FragmentConcept::BoundsType(); + if(m.isEmpty()) return typename FragmentConcept::BoundsType(f(m.min())); unsigned fi = f.segN(m.min()), ti = f.segN(m.max()); double ft = f.segT(m.min(), fi), tt = f.segT(m.max(), ti); if(fi == ti) return bounds_local(f[fi], Interval(ft, tt)); - Interval ret(bounds_local(f[fi], Interval(ft, 1.))); + typename FragmentConcept::BoundsType ret(bounds_local(f[fi], Interval(ft, 1.))); for(unsigned i = fi + 1; i < ti; i++) ret.unionWith(bounds_exact(f[i])); if(tt != 0.) ret.unionWith(bounds_local(f[ti], Interval(0., tt))); -- 2.30.2