X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;ds=sidebyside;f=source%2Fgeometry%2Funion.h;h=738f1f240f3de600dac9d63e1e048fe786bc3d75;hb=44bd1d1ab256d397be4e2169c4ca5efdd0569d31;hp=13eb7080442c625369f2c565fbb71405df5c9955;hpb=f7dcf3f0be55316bf20ac0c318dd90cb78a75c80;p=libs%2Fmath.git diff --git a/source/geometry/union.h b/source/geometry/union.h index 13eb708..738f1f2 100644 --- a/source/geometry/union.h +++ b/source/geometry/union.h @@ -6,20 +6,16 @@ namespace Msp { namespace Geometry { -/** -Joins component shapes together into one. -*/ template struct UnionOps { - static HyperBox combine_aabb(const HyperBox &, const HyperBox &); - 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 BoundingBox combine_aabb(const BoundingBox &a, const BoundingBox &b) { return a|b; } + static bool shortcircuit(bool c) { return c; } }; +/** +Joins component shapes together into one. +*/ template class Union: public CompositeShape > { @@ -54,16 +50,6 @@ inline Union *Union::clone() const return new Union(*this); } - -template -inline HyperBox UnionOps::combine_aabb(const HyperBox &box1, const HyperBox &box2) -{ - LinAl::Vector dimensions; - for(unsigned i=0; i(dimensions); -} - } // namespace Geometry } // namespace Msp