64 if (startPoint.
X() >
xMax()) {
65 if (lineDir.
X() < -tol) {
72 if (startPoint.
X() <
xMin()) {
73 if (lineDir.
X() > tol) {
80 if (startPoint.
Y() >
yMax()) {
81 if (lineDir.
Y() < -tol) {
88 if (startPoint.
Y() <
yMin()) {
89 if (lineDir.
Y() > tol) {
96 if (startPoint.
Z() >
zMax()) {
97 if (lineDir.
Z() < -tol) {
104 if (startPoint.
Z() <
zMin()) {
105 if (lineDir.
Z() > tol) {
124 std::vector<Kernel::V3D> pts;
127 std::vector<Kernel::V3D>::const_iterator ip;
128 double centre_norm_inv = 1.0 / centre.
norm();
129 double thetaMax(-1.0);
130 for (ip = pts.begin(); ip != pts.end(); ++ip) {
131 double theta = acos(ip->scalar_prod(centre) * centre_norm_inv / ip->norm());
132 if (theta > thetaMax)
173 for (
int i = 0; i < 3; i++) {
182 for (
unsigned int i = 0; i < pCS->size(); i++) {
196 std::vector<V3D> BBpoints;
202 for (
unsigned int i = 0; i < 8; i++) {
241 V3D otherPoint = other.minPoint();
242 for (
size_t i = 0; i < 3; ++i) {
247 otherPoint = other.maxPoint();
248 for (
size_t i = 0; i < 3; ++i) {
268 os <<
"X from " << box.
xMin() <<
" to " << box.
xMax() <<
"; Y from " << box.
yMin() <<
" to " << box.
yMax()
269 <<
"; Z from " << box.
zMin() <<
" to " << box.
zMax();
const std::vector< double > * lambda
A simple structure that defines an axis-aligned cuboid shaped bounding box for a geometrical object.
void setBoxAlignment(const Kernel::V3D &R0, const std::vector< Kernel::V3D > &orts)
change the BB alighnment, providing new coordinate system to alighn it to.
bool isPointInside(const Kernel::V3D &point) const
Is the given point within the bounding box?
bool m_null
Flag marking if we've been initialized using the default constructor, with values or default values a...
double angularWidth(const Kernel::V3D &observer) const
Calculate the angular half width from the given point.
void getFullBox(std::vector< Kernel::V3D > &box, const Kernel::V3D &observer) const
returns the expanded box consisting of all 8 box points, shifted into the coordinate system with the ...
double xMax() const
Return the maximum value of X.
double zMin() const
Return the minimum value of Z.
Kernel::V3D m_maxPoint
The maximum point of the axis-aligned box.
Kernel::V3D generatePointInside(double r1, double r2, double r3) const
Generate a random point within the box.
double zMax() const
Return the maximum value of Z.
double yMax() const
Return the maximum value of Y.
bool isAxisAligned() const
Check if it is normal axis aligned bounding box or not.
double xMin() const
Return the minimum value of X.
void nullify()
set BB in to undefined state with min=FLT_MAX>max=-FLT_MAX
bool doesLineIntersect(const Track &track) const
Does a specified track intersect the bounding box.
Kernel::V3D centrePoint() const
Returns the centre of the bounding box.
double yMin() const
Return the minimum value of Y.
std::vector< Kernel::V3D > coord_system
if the bounding box is not axis aligned, the vector below describes the coordinate system,...
Kernel::V3D m_minPoint
The minimum point of the axis-aligned box.
void grow(const BoundingBox &other)
Grow the bounding box so that it also encompasses the given box.
void realign(std::vector< Kernel::V3D > const *const pCS=nullptr)
reallign the BB according to new coordinate system, provided earlier or specified as parameter;
bool is_axis_aligned
the parameter which describe if the bounding box is axis aligned or not
Defines a track as a start point and a direction.
const Kernel::V3D & startPoint() const
Returns the starting point.
const Kernel::V3D & direction() const
Returns the direction as a unit vector.
Marks code as not implemented yet.
constexpr double X() const noexcept
Get x.
constexpr double Y() const noexcept
Get y.
double norm() const noexcept
constexpr double Z() const noexcept
Get z.
MANTID_GEOMETRY_DLL std::ostream & operator<<(std::ostream &stream, const PointGroup &self)
Returns a streamed representation of the PointGroup object.
constexpr double Tolerance
Standard tolerance value.