9#include "MantidGeometry/DllConfig.h"
44 MDPlane(
const std::vector<coord_t> &normal,
const std::vector<coord_t> &point);
45 MDPlane(
const size_t nd,
const float *normal,
const float *point);
46 MDPlane(
const size_t nd,
const double *normal,
const double *point);
73 for (
size_t d = 0;
d < m_nd; ++
d) {
74 total += m_normal[
d] * coords[
d];
76 return (total >= m_inequality);
88 for (
size_t d = 0;
d < m_nd; ++
d) {
89 total += m_normal[
d] *
static_cast<coord_t>(coords[
d]);
91 return (total >= m_inequality);
103 for (
size_t d = 0;
d < m_nd; ++
d) {
104 total += m_normal[
d] * coords[
d];
106 return (total >= m_inequality);
121 for (
size_t d = 0;
d < m_nd; ++
d) {
122 total += m_normal[
d] * coords[
d];
124 return (total > m_inequality);
139 for (
size_t d = 0;
d < m_nd; ++
d) {
140 total += m_normal[
d] * coords[
d];
142 return (total > m_inequality);
155 bool AisBounded = isPointBounded(pointA);
156 bool BisBounded = isPointBounded(pointB);
159 return (AisBounded != BisBounded);
170 template <
typename IterableType>
void construct(IterableType normal, IterableType point) {
173 for (
size_t d = 0;
d < m_nd; ++
d) {
174 m_normal[
d] =
static_cast<coord_t>(normal[
d]);
175 m_inequality +=
static_cast<coord_t>(point[
d]) * m_normal[
d];
A generalized description of a N-dimensional hyperplane.
bool isPointBounded(const Mantid::Kernel::VMD &coords) const
Is a point in MDimensions bounded by this hyperplane, that is, is (a1*x1 + a2*x2 + ....
coord_t getInequality() const
coord_t m_inequality
Right-hand side of the linear equation. aka b in : a1*x1 + a2*x2 + ... < b.
bool isPointBounded(const std::vector< coord_t > &coords) const
Is a point in MDimensions bounded by this hyperplane, that is, is (a1*x1 + a2*x2 + ....
bool doesLineIntersect(const coord_t *pointA, const coord_t *pointB) const
Given two points defining the start and end point of a line, is there an intersection between the hyp...
bool isPointInside(const std::vector< coord_t > &coords) const
Is a point in MDimensions bounded by this hyperplane, that is, is (a1*x1 + a2*x2 + ....
bool isPointInside(const coord_t *coords) const
Is a point in MDimensions bounded by this hyperplane, that is, is (a1*x1 + a2*x2 + ....
void construct(IterableType normal, IterableType point)
Templated method for constructing the MDPlane.
size_t m_nd
Number of dimensions in the MDEventWorkspace.
bool isPointBounded(const coord_t *coords) const
Is a point in MDimensions bounded by this hyperplane, that is, is (a1*x1 + a2*x2 + ....
coord_t * m_normal
Coefficients to multiply each coordinate, sized m_nd.
const coord_t * getNormal() const
size_t getNumDims() const
Helper class which provides the Collimation Length for SANS instruments.
float coord_t
Typedef for the data type to use for coordinate axes in MD objects such as MDBox, MDEventWorkspace,...