summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJohan B. C. Engelen <jbc.engelen@swissonline.ch>2007-11-06 18:38:31 +0000
committerjohanengelen <johanengelen@users.sourceforge.net>2007-11-06 18:38:31 +0000
commit1fc3cfa533434bd14032f88e0d68908d28134e13 (patch)
tree8ff49fbce5ccfb5a0204f87ea7141438e202fda8 /src
parentImprove the user interaction for snapping of bounding boxes, and add an new t... (diff)
downloadinkscape-1fc3cfa533434bd14032f88e0d68908d28134e13.tar.gz
inkscape-1fc3cfa533434bd14032f88e0d68908d28134e13.zip
2geom update to 2Geom-SVN-rev. 1161
(bzr r4034)
Diffstat (limited to 'src')
-rw-r--r--src/2geom/path.h2
-rw-r--r--src/2geom/piecewise.h20
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<SVGEllipticalArc, SVGEllipticalArc>(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<typename T>
-inline Interval bounds_fast(const Piecewise<T> &f) {
+inline typename FragmentConcept<T>::BoundsType bounds_fast(const Piecewise<T> &f) {
boost::function_requires<FragmentConcept<T> >();
- if(f.empty()) return Interval(0);
- Interval ret(bounds_fast(f[0]));
+ if(f.empty()) return typename FragmentConcept<T>::BoundsType();
+ typename FragmentConcept<T>::BoundsType ret(bounds_fast(f[0]));
for(unsigned i = 1; i < f.size(); i++)
ret.unionWith(bounds_fast(f[i]));
return ret;
}
template<typename T>
-inline Interval bounds_exact(const Piecewise<T> &f) {
+inline typename FragmentConcept<T>::BoundsType bounds_exact(const Piecewise<T> &f) {
boost::function_requires<FragmentConcept<T> >();
- if(f.empty()) return Interval(0);
- Interval ret(bounds_exact(f[0]));
+ if(f.empty()) return typename FragmentConcept<T>::BoundsType();
+ typename FragmentConcept<T>::BoundsType ret(bounds_exact(f[0]));
for(unsigned i = 1; i < f.size(); i++)
ret.unionWith(bounds_exact(f[i]));
return ret;
}
template<typename T>
-inline Interval bounds_local(const Piecewise<T> &f, const Interval &m) {
+inline typename FragmentConcept<T>::BoundsType bounds_local(const Piecewise<T> &f, const Interval &m) {
boost::function_requires<FragmentConcept<T> >();
- if(f.empty()) return Interval(0);
- if(m.isEmpty()) return Interval(f(m.min()));
+ if(f.empty()) return typename FragmentConcept<T>::BoundsType();
+ if(m.isEmpty()) return typename FragmentConcept<T>::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<T>::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)));