9#include "MantidGeometry/DllConfig.h"
13#include <boost/optional.hpp>
17class PseudoRandomNumberGenerator;
25namespace RandomPoint {
37MANTID_GEOMETRY_DLL boost::optional<Kernel::V3D>
41 double polarAngle,
double radialLength);
43template <Kernel::V3D (*T)(const detail::ShapeInfo &, Kernel::PseudoRandomNumberGenerator &)>
47MANTID_GEOMETRY_DLL boost::optional<Kernel::V3D>
61template <Kernel::V3D (*randomInShape)(const detail::ShapeInfo &, Kernel::PseudoRandomNumberGenerator &)>
64 boost::optional<Kernel::V3D> point;
65 for (
size_t attempt{0}; attempt < maxAttempts; ++attempt) {
66 const Kernel::V3D pt{randomInShape(shapeInfo, rng)};
A simple structure that defines an axis-aligned cuboid shaped bounding box for a geometrical object.
bool isPointInside(const Kernel::V3D &point) const
Is the given point within the bounding box?
IObject : Interface for geometry objects.
Defines a 1D pseudo-random number generator, i.e.
MANTID_GEOMETRY_DLL Kernel::V3D inCylinder(const detail::ShapeInfo &shapeInfo, Kernel::PseudoRandomNumberGenerator &rng)
Return a random point in cylinder.
MANTID_GEOMETRY_DLL Kernel::V3D inCuboid(const detail::ShapeInfo &shapeInfo, Kernel::PseudoRandomNumberGenerator &rng)
Return a random point in a cuboid shape.
MANTID_GEOMETRY_DLL Kernel::V3D inSphere(const detail::ShapeInfo &shapeInfo, Kernel::PseudoRandomNumberGenerator &rng)
Return a random point in sphere.
MANTID_GEOMETRY_DLL Kernel::V3D inHollowCylinder(const detail::ShapeInfo &shapeInfo, Kernel::PseudoRandomNumberGenerator &rng)
Return a random point in a hollow cylinder.
MANTID_GEOMETRY_DLL Kernel::V3D localPointInCylinder(const Kernel::V3D &basis, const Kernel::V3D &alongAxis, double polarAngle, double radialLength)
Return a local point in a cylinder shape.
MANTID_GEOMETRY_DLL boost::optional< Kernel::V3D > inGenericShape(const IObject &object, Kernel::PseudoRandomNumberGenerator &rng, size_t maxAttempts)
Return a random point in a generic shape.
boost::optional< Kernel::V3D > bounded(const detail::ShapeInfo &shapeInfo, Kernel::PseudoRandomNumberGenerator &rng, const BoundingBox &box, size_t maxAttempts)
Return a random point in a known shape restricted by a bounding box.
Helper class which provides the Collimation Length for SANS instruments.