const Shape<T, D> &get_shape() const { return *shape; }
const AffineTransformation<T, D> &get_transformation() const { return transformation; }
- virtual BoundingBox<T, D> get_axis_aligned_bounding_box() const;
+ virtual BoundingBox<T, D> get_axis_aligned_bounding_box(unsigned = 0) const;
virtual bool contains(const LinAl::Vector<T, D> &) const;
virtual unsigned get_max_ray_intersections() const { return shape->get_max_ray_intersections(); }
virtual unsigned get_intersections(const Ray<T, D> &, SurfacePoint<T, D> *, unsigned) const;
+ virtual Coverage get_coverage(const BoundingBox<T, D> &) const;
};
template<typename T, unsigned D>
}
template<typename T, unsigned D>
-inline BoundingBox<T, D> TransformedShape<T, D>::get_axis_aligned_bounding_box() const
+inline BoundingBox<T, D> TransformedShape<T, D>::get_axis_aligned_bounding_box(unsigned detail) const
{
+ if(detail)
+ return this->bisect_axis_aligned_bounding_box(detail);
+
return transformation.transform(shape->get_axis_aligned_bounding_box());
}
return count;
}
+template<typename T, unsigned D>
+inline Coverage TransformedShape<T, D>::get_coverage(const BoundingBox<T, D> &bbox) const
+{
+ return shape->get_coverage(inverse_trans.transform(bbox));
+}
+
} // namespace Geometry
} // namespace Msp