X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fgeometry%2Fnegation.h;h=d90c4deb5a7de767b2f36cb0ed165d53f8a5c851;hb=a29d2c17ca70a3ed5df1e863c92ccd851d5dba6b;hp=ce2f7873d6aed3eeff7304e67abe7598b5c274c7;hpb=54f265afb8a9f27a05a287116379e6f829560e6c;p=libs%2Fmath.git diff --git a/source/geometry/negation.h b/source/geometry/negation.h index ce2f787..d90c4de 100644 --- a/source/geometry/negation.h +++ b/source/geometry/negation.h @@ -30,6 +30,7 @@ public: virtual bool contains(const LinAl::Vector &) const; virtual unsigned get_max_ray_intersections() const { return shape->get_max_ray_intersections(); } virtual unsigned get_intersections(const Ray &, SurfacePoint *, unsigned) const; + virtual Coverage get_coverage(const BoundingBox &) const; }; template @@ -79,10 +80,25 @@ inline unsigned Negation::get_intersections(const Ray &ray, SurfaceP { unsigned count = shape->get_intersections(ray, points, size); for(unsigned i=0; i +inline Coverage Negation::get_coverage(const BoundingBox &bbox) const +{ + Coverage coverage = shape->get_coverage(bbox); + if(coverage==FULL_COVERAGE) + return NO_COVERAGE; + else if(coverage==NO_COVERAGE) + return FULL_COVERAGE; + else + return PARTIAL_COVERAGE; +} + } // namespace Geometry } // namespace Msp