summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 4550d1a)
raw | patch | inline | side by side (parent: 4550d1a)
author | johanengelen <johanengelen@users.sourceforge.net> | |
Tue, 6 Nov 2007 18:38:31 +0000 (18:38 +0000) | ||
committer | johanengelen <johanengelen@users.sourceforge.net> | |
Tue, 6 Nov 2007 18:38:31 +0000 (18:38 +0000) |
src/2geom/path.h | patch | blob | history | |
src/2geom/piecewise.h | patch | blob | history |
diff --git a/src/2geom/path.h b/src/2geom/path.h
index 8930a8a7fe05ce7a96d83b61dc7112b330dc5eb7..46d7f230aa87e02a36a090596c4fb04e1aeaf777 100644 (file)
--- a/src/2geom/path.h
+++ b/src/2geom/path.h
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);
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 8823c21dd562d543a55ebcde7d7805ca24b1479e..3968110507c903c59e6b095edc41e09bf79a2e79 100644 (file)
--- a/src/2geom/piecewise.h
+++ b/src/2geom/piecewise.h
};\r
\r
template<typename T>\r
-inline Interval bounds_fast(const Piecewise<T> &f) {\r
+inline typename FragmentConcept<T>::BoundsType bounds_fast(const Piecewise<T> &f) {\r
boost::function_requires<FragmentConcept<T> >();\r
\r
- if(f.empty()) return Interval(0);\r
- Interval ret(bounds_fast(f[0]));\r
+ if(f.empty()) return typename FragmentConcept<T>::BoundsType();\r
+ typename FragmentConcept<T>::BoundsType ret(bounds_fast(f[0]));\r
for(unsigned i = 1; i < f.size(); i++)\r
ret.unionWith(bounds_fast(f[i])); \r
return ret;\r
}\r
\r
template<typename T>\r
-inline Interval bounds_exact(const Piecewise<T> &f) {\r
+inline typename FragmentConcept<T>::BoundsType bounds_exact(const Piecewise<T> &f) {\r
boost::function_requires<FragmentConcept<T> >();\r
\r
- if(f.empty()) return Interval(0);\r
- Interval ret(bounds_exact(f[0]));\r
+ if(f.empty()) return typename FragmentConcept<T>::BoundsType();\r
+ typename FragmentConcept<T>::BoundsType ret(bounds_exact(f[0]));\r
for(unsigned i = 1; i < f.size(); i++)\r
ret.unionWith(bounds_exact(f[i])); \r
return ret;\r
}\r
\r
template<typename T>\r
-inline Interval bounds_local(const Piecewise<T> &f, const Interval &m) {\r
+inline typename FragmentConcept<T>::BoundsType bounds_local(const Piecewise<T> &f, const Interval &m) {\r
boost::function_requires<FragmentConcept<T> >();\r
\r
- if(f.empty()) return Interval(0);\r
- if(m.isEmpty()) return Interval(f(m.min()));\r
+ if(f.empty()) return typename FragmentConcept<T>::BoundsType();\r
+ if(m.isEmpty()) return typename FragmentConcept<T>::BoundsType(f(m.min()));\r
\r
unsigned fi = f.segN(m.min()), ti = f.segN(m.max());\r
double ft = f.segT(m.min(), fi), tt = f.segT(m.max(), ti);\r
\r
if(fi == ti) return bounds_local(f[fi], Interval(ft, tt));\r
\r
- Interval ret(bounds_local(f[fi], Interval(ft, 1.)));\r
+ typename FragmentConcept<T>::BoundsType ret(bounds_local(f[fi], Interval(ft, 1.)));\r
for(unsigned i = fi + 1; i < ti; i++)\r
ret.unionWith(bounds_exact(f[i]));\r
if(tt != 0.) ret.unionWith(bounds_local(f[ti], Interval(0., tt)));\r