Mantid
|
A general N-dimensional plane implicit function. More...
#include <MDPlaneImplicitFunction.h>
Public Member Functions | |
void | addPlane (const MDPlane &plane) |
Overriding the addPlane for check. More... | |
std::string | getName () const override |
MDPlaneImplicitFunction () | |
Default constructor. More... | |
MDPlaneImplicitFunction (const size_t nd, const double *normal, const double *point) | |
This parameter constructor is used for when the origin of the implicit plane is needed in the future. More... | |
MDPlaneImplicitFunction (const size_t nd, const float *normal, const float *point) | |
Parameter constructor for setting origin. More... | |
std::string | toXMLString () const override |
Public Member Functions inherited from Mantid::Geometry::MDImplicitFunction | |
void | addPlane (const MDPlane &plane) |
Add a bounded plane to this implicit function. More... | |
eContact | boxContact (const coord_t *vertexes, const size_t numPoints) const |
Determine how a box (consisting of a number of vertexes) is in contact with the implicit function. More... | |
virtual std::string | getName () const |
size_t | getNumDims () const |
size_t | getNumPlanes () const |
const MDPlane & | getPlane (size_t index) const |
bool | isBoxTouching (const coord_t *vertexes, const size_t numPoints) |
Same as isBoxTouching(vector), except that it takes a bare array of coordinates. More... | |
bool | isBoxTouching (const std::vector< std::vector< coord_t > > &vertexes) |
Is there a chance that the box defined by these vertexes touches the implicit function volume? More... | |
virtual bool | isPointContained (const coord_t *coords) |
Is a point in MDimensions contained by this ImplicitFunction? If the point is bounded by ALL planes contained, then this returns true. More... | |
virtual bool | isPointContained (const Mantid::Kernel::VMD &coords) |
Is a point in MDimensions contained by this ImplicitFunction? If the point is bounded by ALL planes contained, then this returns true. More... | |
virtual bool | isPointContained (const std::vector< coord_t > &coords) |
Is a point in MDimensions contained by this ImplicitFunction? If the point is bounded by ALL planes contained, then this returns true. More... | |
MDImplicitFunction () | |
Constructor. More... | |
virtual std::string | toXMLString () const |
virtual | ~MDImplicitFunction ()=default |
Private Member Functions | |
void | checkOrigin () |
Set defaults to origin if not used. More... | |
std::string | coordValue (const coord_t *arr) const |
Create string for coordinate values. More... | |
Private Attributes | |
std::vector< coord_t > | origin |
The origin point of the implicit plane. More... | |
Additional Inherited Members | |
Public Types inherited from Mantid::Geometry::MDImplicitFunction | |
enum | eContact { NOT_TOUCHING = 0 , TOUCHING = 1 , CONTAINED = 2 } |
Enum for describing the contact between a box and an implicit function. More... | |
Protected Attributes inherited from Mantid::Geometry::MDImplicitFunction | |
size_t | m_nd |
number of dimensions for which this object can be applied More... | |
size_t | m_numPlanes |
Cached number of planes (for a sligh speed-up) More... | |
std::vector< MDPlane > | m_planes |
Vector of all the planes applying for this implict function. More... | |
A general N-dimensional plane implicit function.
This relies on MDPlane to do the heavy lifting. The main thing for this class is to be able to specify itself via XML.
Definition at line 20 of file MDPlaneImplicitFunction.h.
Mantid::Geometry::MDPlaneImplicitFunction::MDPlaneImplicitFunction | ( | ) |
Default constructor.
Definition at line 22 of file MDPlaneImplicitFunction.cpp.
Mantid::Geometry::MDPlaneImplicitFunction::MDPlaneImplicitFunction | ( | const size_t | nd, |
const float * | normal, | ||
const float * | point | ||
) |
Parameter constructor for setting origin.
This parameter constructor is used for when the origin of the implicit plane is needed in the future.
The coordinate arrays MUST be the same length and match the specified number of dimensions.
nd | the number of dimensions for the implicit plane |
normal | array of coordinates for the plane normal |
point | array of coorindates for the plane origin |
Definition at line 32 of file MDPlaneImplicitFunction.cpp.
References addPlane(), and origin.
Mantid::Geometry::MDPlaneImplicitFunction::MDPlaneImplicitFunction | ( | const size_t | nd, |
const double * | normal, | ||
const double * | point | ||
) |
This parameter constructor is used for when the origin of the implicit plane is needed in the future.
The coordinate arrays MUST be the same length and match the specified number of dimensions.
nd | the number of dimensions for the implicit plane |
normal | array of coordinates for the plane normal |
point | array of coorindates for the plane origin |
Definition at line 48 of file MDPlaneImplicitFunction.cpp.
References addPlane(), and origin.
void Mantid::Geometry::MDPlaneImplicitFunction::addPlane | ( | const MDPlane & | plane | ) |
Overriding the addPlane for check.
This function overrides the inherited one in order to make sure that only one plane is set on the implicit function.
plane | the object containing the information for the implicit plane |
Definition at line 61 of file MDPlaneImplicitFunction.cpp.
References Mantid::Geometry::MDImplicitFunction::addPlane(), checkOrigin(), and Mantid::Geometry::MDImplicitFunction::getNumPlanes().
Referenced by MDPlaneImplicitFunction().
|
private |
Set defaults to origin if not used.
Definition at line 135 of file MDPlaneImplicitFunction.cpp.
References Mantid::Geometry::MDImplicitFunction::getNumDims(), and origin.
Referenced by addPlane().
|
private |
Create string for coordinate values.
This is a helper function for converting a list of coordinate values into a space separated string for the XML definition.
arr | the array of coordinates to convert |
Definition at line 125 of file MDPlaneImplicitFunction.cpp.
References Mantid::Geometry::MDImplicitFunction::getNumDims().
Referenced by toXMLString().
|
overridevirtual |
Reimplemented from Mantid::Geometry::MDImplicitFunction.
Definition at line 70 of file MDPlaneImplicitFunction.cpp.
Referenced by toXMLString().
|
overridevirtual |
Reimplemented from Mantid::Geometry::MDImplicitFunction.
Definition at line 72 of file MDPlaneImplicitFunction.cpp.
References coordValue(), getName(), Mantid::Geometry::MDPlane::getNormal(), Mantid::Geometry::MDImplicitFunction::getPlane(), and origin.
|
private |
The origin point of the implicit plane.
Definition at line 42 of file MDPlaneImplicitFunction.h.
Referenced by checkOrigin(), MDPlaneImplicitFunction(), and toXMLString().