X-Git-Url: http://git.tdb.fi/?p=libs%2Fmath.git;a=blobdiff_plain;f=source%2Fgeometry%2Funion.h;h=8c02f2b808dc8a18301653c77e8175e83b2ea555;hp=8461f8484ee5d085560b6fb70f522447d9a95c6e;hb=2826730b5d68d1ad74dc6363af43ca796f96caa2;hpb=09cc3a8648dd20e9a07d669b353c4a120b67c1c4 diff --git a/source/geometry/union.h b/source/geometry/union.h index 8461f84..8c02f2b 100644 --- a/source/geometry/union.h +++ b/source/geometry/union.h @@ -6,20 +6,17 @@ namespace Msp { namespace Geometry { -/** -Joins component shapes together into one. -*/ template struct UnionOps { static BoundingBox combine_aabb(const BoundingBox &a, const BoundingBox &b) { return a|b; } - static bool init_inside() { return false; } - static bool combine_inside(bool a, bool b) { return a || b; } - static bool is_inside_decided(bool a) { return a; } - static bool init_surface() { return true; } - static bool combine_surface(bool a, bool b) { return a && !b; } + static Coverage combine_coverage(Coverage a, Coverage b) { return std::max(a, b); } + static bool shortcircuit(bool c) { return c; } }; +/** +Joins component shapes together into one. +*/ template class Union: public CompositeShape > {