16using Geometry::BoundingBox;
31 : m_name(
std::move(name)), m_components(1, container) {}
35 std::stringstream msg;
36 msg <<
"Requested SampleEnvironment element that is out of range: " <<
index <<
" < " << this->
nelements();
37 throw std::out_of_range(msg.str());
44 std::stringstream msg;
45 msg <<
"Requested SampleEnvironment element that is out of range: " <<
index <<
" < " << this->
nelements();
46 throw std::out_of_range(msg.str());
57 box.
grow(component->getBoundingBox());
69 [&point](
const auto &component) { return component->isValid(point); });
80 [&track](
int sum,
const auto &component) { return sum + component->interceptSurface(track); });
std::map< DeltaEMode::Type, std::string > index
A simple structure that defines an axis-aligned cuboid shaped bounding box for a geometrical object.
void grow(const BoundingBox &other)
Grow the bounding box so that it also encompasses the given box.
IObject : Interface for geometry objects.
std::vector< IObject_const_sptr > m_components
const IObject & getComponent(const size_t index) const
Returns the requested IObject.
bool isValid(const Kernel::V3D &point) const
Is the point given a valid point within the environment.
SampleEnvironment(std::string name, const Container_const_sptr &getContainer)
Constructor specifying a name for the environment.
void add(const IObject_const_sptr &component)
Geometry::BoundingBox boundingBox() const
int interceptSurfaces(Track &track) const
Update the given track with intersections within the environment.
const IObject_const_sptr getComponentPtr(const size_t index) const
Defines a track as a start point and a direction.
std::shared_ptr< const Container > Container_const_sptr
Typdef for a shared pointer to a const object.
std::shared_ptr< const IObject > IObject_const_sptr
Typdef for a shared pointer to a const object.