]> git.tdb.fi Git - libs/math.git/blobdiff - source/geometry/shape.h
Add a function to test whether a shapes covers a bounding box
[libs/math.git] / source / geometry / shape.h
index 22b18876620657e9f2858ea568196cc66a2d3f9c..ded8f13d8b7464b896e8d0510fe8146de2e68a85 100644 (file)
 namespace Msp {
 namespace Geometry {
 
+enum Coverage
+{
+       NO_COVERAGE,
+       PARTIAL_COVERAGE,
+       FULL_COVERAGE
+};
+
 /**
 Base class and interface for geometric shapes.  Shapes may be bounded or
 unbounded.  They are always considered to be solid, i.e. have a distinct inside
@@ -31,6 +38,7 @@ public:
        virtual unsigned get_max_ray_intersections() const = 0;
        virtual unsigned get_intersections(const Ray<T, D> &, SurfacePoint<T, D> *, unsigned) const = 0;
        std::vector<SurfacePoint<T, D> > get_intersections(const Ray<T, D> &) const;
+       virtual Coverage get_coverage(const BoundingBox<T, D> &) const = 0;
 };
 
 template<typename T, unsigned D>