Mantid
Loading...
Searching...
No Matches
BoundingBox.cpp
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2018 ISIS Rutherford Appleton Laboratory UKRI,
4// NScD Oak Ridge National Laboratory, European Spallation Source,
5// Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
6// SPDX - License - Identifier: GPL - 3.0 +
8#include <boost/python/class.hpp>
9#include <boost/python/copy_const_reference.hpp>
10
13using namespace boost::python;
14
16 class_<BoundingBox>("BoundingBox", "Constructs a zero-sized box")
17 .def(init<double, double, double, double, double, double>(
18 (arg("self"), arg("xmax"), arg("ymax"), arg("zmax"), arg("xmin"), arg("ymin"), arg("zmin")),
19 "Constructs a box from the six given points"))
20
21 .def("minPoint", &BoundingBox::minPoint, arg("self"), return_value_policy<copy_const_reference>(),
22 "Returns a V3D containing the values of the minimum of the box. See "
23 "mantid.kernel.V3D")
24
25 .def("maxPoint", &BoundingBox::maxPoint, arg("self"), return_value_policy<copy_const_reference>(),
26 "Returns a V3D containing the values of the minimum of the box. See "
27 "mantid.kernel.V3D")
28
29 .def("centrePoint", &BoundingBox::centrePoint, arg("self"),
30 "Returns a V3D containing the coordinates of the centre point. See "
31 "mantid.kernel.V3D")
32
33 .def("width", &BoundingBox::width, arg("self"),
34 "Returns a V3D containing the widths "
35 "for each dimension. See "
36 "mantid.kernel.V3D")
37
38 .def("isNull", &BoundingBox::isNull, arg("self"), "Returns true if the box has no dimensions that have been set")
39
40 .def("isPointInside", &BoundingBox::isPointInside, (arg("self"), arg("point")),
41 "Returns true if the given point is inside the object. See "
42 "mantid.kernel.V3D")
43
44 .def("doesLineIntersect",
45 (bool (BoundingBox::*)(const V3D &, const V3D &) const) & BoundingBox::doesLineIntersect,
46 (arg("self"), arg("startPoint"), arg("lineDir")),
47 "Returns true if the line given by the starting point & direction "
48 "vector passes through the box");
49}
void export_BoundingBox()
Definition: BoundingBox.cpp:15
A simple structure that defines an axis-aligned cuboid shaped bounding box for a geometrical object.
Definition: BoundingBox.h:34
bool isPointInside(const Kernel::V3D &point) const
Is the given point within the bounding box?
Definition: BoundingBox.cpp:28
const Kernel::V3D & minPoint() const
Returns the min point of the box.
Definition: BoundingBox.h:90
bool isNull() const
Is this a default constructed box?
Definition: BoundingBox.h:104
Kernel::V3D width() const
Returns the width of the box.
Definition: BoundingBox.h:98
bool doesLineIntersect(const Track &track) const
Does a specified track intersect the bounding box.
Definition: BoundingBox.cpp:44
Kernel::V3D centrePoint() const
Returns the centre of the bounding box.
Definition: BoundingBox.h:94
const Kernel::V3D & maxPoint() const
Returns the min point of the box.
Definition: BoundingBox.h:92
Class for 3D vectors.
Definition: V3D.h:34