1 #ifndef MSP_GEOMETRY_UNION_H_
2 #define MSP_GEOMETRY_UNION_H_
4 #include "compositeshape.h"
9 template<typename T, unsigned D>
12 static BoundingBox<T, D> combine_aabb(const BoundingBox<T, D> &a, const BoundingBox<T, D> &b) { return a|b; }
13 static bool shortcircuit(bool c) { return c; }
17 Joins component shapes together into one.
19 template<typename T, unsigned D>
20 class Union: public CompositeShape<T, D, UnionOps<T, D> >
25 Union(const Shape<T, D> &, const Shape<T, D> &);
27 template<typename Iter>
28 static Union from_iterator_range(const Iter &, const Iter &);
30 virtual Union *clone() const;
33 template<typename T, unsigned D>
34 inline Union<T, D>::Union(const Shape<T, D> &s1, const Shape<T, D> &s2):
35 CompositeShape<T, D, UnionOps<T, D> >(s1, s2)
38 template<typename T, unsigned D>
39 template<typename Iter>
40 inline Union<T, D> Union<T, D>::from_iterator_range(const Iter &begin, const Iter &end)
43 shape.init_from_iter_range(begin, end);
47 template<typename T, unsigned D>
48 inline Union<T, D> *Union<T, D>::clone() const
50 return new Union<T, D>(*this);
53 } // namespace Geometry