Mantid
|
General N-dimensional box implicit function: Defines a cuboid in N dimensions that is aligned with the axes of a MDEventWorkspace. More...
#include <MDBoxImplicitFunction.h>
Public Member Functions | |
double | fraction (const std::vector< boost::tuple< Mantid::coord_t, Mantid::coord_t > > &boxExtents) const |
Calculate the fraction of a box residing inside this implicit function. More... | |
MDBoxImplicitFunction (const Mantid::Kernel::VMD &min, const Mantid::Kernel::VMD &max) | |
Constructor with min/max dimensions. More... | |
MDBoxImplicitFunction (const std::vector< coord_t > &min, const std::vector< coord_t > &max) | |
Constructor with min/max dimensions. More... | |
double | volume () const |
Calculate volume. More... | |
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 | construct (const Mantid::Kernel::VMD &min, const Mantid::Kernel::VMD &max) |
Constructor helper method. More... | |
Private Attributes | |
const Mantid::Kernel::VMD | m_max |
Maximum extents of MDBox. More... | |
const Mantid::Kernel::VMD | m_min |
Minimum extents of MDBox. More... | |
double | m_volume |
Box volume. 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... | |
General N-dimensional box implicit function: Defines a cuboid in N dimensions that is aligned with the axes of a MDEventWorkspace.
Definition at line 25 of file MDBoxImplicitFunction.h.
Mantid::Geometry::MDBoxImplicitFunction::MDBoxImplicitFunction | ( | const Mantid::Kernel::VMD & | min, |
const Mantid::Kernel::VMD & | max | ||
) |
Constructor with min/max dimensions.
The dimensions must be IN THE SAME ORDER and the SAME LENGTH as the nd dimensions of the MDEventWorkspace on which they will be applied.
min | :: nd-sized vector of the minimum edge of the box in each dimension |
max | :: nd-sized vector of the maximum edge of the box |
Definition at line 43 of file MDBoxImplicitFunction.cpp.
References construct().
Mantid::Geometry::MDBoxImplicitFunction::MDBoxImplicitFunction | ( | const std::vector< coord_t > & | min, |
const std::vector< coord_t > & | max | ||
) |
Constructor with min/max dimensions.
The dimensions must be IN THE SAME ORDER and the SAME LENGTH as the nd dimensions of the MDEventWorkspace on which they will be applied.
min | :: nd-sized vector of the minimum edge of the box in each dimension |
max | :: nd-sized vector of the maximum edge of the box |
Definition at line 28 of file MDBoxImplicitFunction.cpp.
References construct().
|
private |
Constructor helper method.
min | :: nd-sized vector of the minimum edge of the box in each dimension |
max | :: nd-sized vector of the maximum edge of the box |
Definition at line 54 of file MDBoxImplicitFunction.cpp.
References Mantid::Geometry::MDImplicitFunction::addPlane(), Mantid::Geometry::d, m_volume, Mantid::Kernel::VMDBase< TYPE >::size(), and volume().
Referenced by MDBoxImplicitFunction().
double Mantid::Geometry::MDBoxImplicitFunction::fraction | ( | const std::vector< boost::tuple< Mantid::coord_t, Mantid::coord_t > > & | boxExtents | ) | const |
Calculate the fraction of a box residing inside this implicit function.
boxExtents | to get fraction for |
Definition at line 104 of file MDBoxImplicitFunction.cpp.
References Mantid::Geometry::d, m_max, m_min, and Mantid::Kernel::VMDBase< TYPE >::size().
Referenced by performWeightedSum().
double Mantid::Geometry::MDBoxImplicitFunction::volume | ( | ) | const |
Calculate volume.
Definition at line 96 of file MDBoxImplicitFunction.cpp.
References m_volume.
Referenced by construct().
|
private |
Maximum extents of MDBox.
Definition at line 39 of file MDBoxImplicitFunction.h.
Referenced by fraction().
|
private |
Minimum extents of MDBox.
Definition at line 41 of file MDBoxImplicitFunction.h.
Referenced by fraction().
|
private |
Box volume.
Definition at line 43 of file MDBoxImplicitFunction.h.
Referenced by construct(), and volume().