summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 0593b63)
raw | patch | inline | side by side (parent: 0593b63)
author | johanengelen <johanengelen@users.sourceforge.net> | |
Wed, 7 Nov 2007 23:49:18 +0000 (23:49 +0000) | ||
committer | johanengelen <johanengelen@users.sourceforge.net> | |
Wed, 7 Nov 2007 23:49:18 +0000 (23:49 +0000) |
src/2geom/piecewise.h | patch | blob | history | |
src/2geom/rect.h | patch | blob | history |
diff --git a/src/2geom/piecewise.h b/src/2geom/piecewise.h
index 3968110507c903c59e6b095edc41e09bf79a2e79..b4f000dc4ef307864607f9376e4b09a83c7d4054 100644 (file)
--- a/src/2geom/piecewise.h
+++ b/src/2geom/piecewise.h
template<typename T>\r
inline typename FragmentConcept<T>::BoundsType bounds_fast(const Piecewise<T> &f) {\r
boost::function_requires<FragmentConcept<T> >();\r
-\r
+ \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
@@ -227,7 +227,7 @@ inline typename FragmentConcept<T>::BoundsType bounds_fast(const Piecewise<T> &f
template<typename T>\r
inline typename FragmentConcept<T>::BoundsType bounds_exact(const Piecewise<T> &f) {\r
boost::function_requires<FragmentConcept<T> >();\r
-\r
+ \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
@@ -238,20 +238,20 @@ inline typename FragmentConcept<T>::BoundsType bounds_exact(const Piecewise<T> &
template<typename T>\r
inline typename FragmentConcept<T>::BoundsType bounds_local(const Piecewise<T> &f, const Interval &m) {\r
boost::function_requires<FragmentConcept<T> >();\r
-\r
+ \r
if(f.empty()) return typename FragmentConcept<T>::BoundsType();\r
if(m.isEmpty()) return typename FragmentConcept<T>::BoundsType(f(m.min()));\r
-\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
+ \r
if(fi == ti) return bounds_local(f[fi], Interval(ft, tt));\r
-\r
+ \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
-\r
+ \r
return ret;\r
}\r
\r
diff --git a/src/2geom/rect.h b/src/2geom/rect.h
index 6a6d979a4689b4ca1a2689b238f84fb07caecf6f..86f9ec1406892eaccb92a9348bde3d58c5a304f6 100644 (file)
--- a/src/2geom/rect.h
+++ b/src/2geom/rect.h
class D2<Interval> {
private:
Interval f[2];
- D2<Interval>();// { f[X] = f[Y] = Interval(0, 0); }
-
public:
+ D2<Interval>() { f[X] = f[Y] = Interval(0, 0); }
+
D2<Interval>(Interval const &a, Interval const &b) {
f[X] = a;
f[Y] = b;