Mantid
Loading...
Searching...
No Matches
Public Member Functions | Private Member Functions | Private Attributes | List of all members
Mantid::Geometry::MDBoxImplicitFunction Class Reference

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>

Inheritance diagram for Mantid::Geometry::MDBoxImplicitFunction:
Mantid::Geometry::MDImplicitFunction

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 MDPlanegetPlane (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< MDPlanem_planes
 Vector of all the planes applying for this implict function. More...
 

Detailed Description

General N-dimensional box implicit function: Defines a cuboid in N dimensions that is aligned with the axes of a MDEventWorkspace.

Author
Janik Zikovsky
Date
2011-07-21

Definition at line 25 of file MDBoxImplicitFunction.h.

Constructor & Destructor Documentation

◆ MDBoxImplicitFunction() [1/2]

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.

Parameters
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().

◆ MDBoxImplicitFunction() [2/2]

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.

Parameters
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().

Member Function Documentation

◆ construct()

void Mantid::Geometry::MDBoxImplicitFunction::construct ( const Mantid::Kernel::VMD min,
const Mantid::Kernel::VMD max 
)
private

Constructor helper method.

Parameters
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().

◆ fraction()

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.

Parameters
boxExtentsto get fraction for
Returns
fraction 0 to 1

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().

◆ volume()

double Mantid::Geometry::MDBoxImplicitFunction::volume ( ) const

Calculate volume.

Returns
box volume

Definition at line 96 of file MDBoxImplicitFunction.cpp.

References m_volume.

Referenced by construct().

Member Data Documentation

◆ m_max

const Mantid::Kernel::VMD Mantid::Geometry::MDBoxImplicitFunction::m_max
private

Maximum extents of MDBox.

Definition at line 39 of file MDBoxImplicitFunction.h.

Referenced by fraction().

◆ m_min

const Mantid::Kernel::VMD Mantid::Geometry::MDBoxImplicitFunction::m_min
private

Minimum extents of MDBox.

Definition at line 41 of file MDBoxImplicitFunction.h.

Referenced by fraction().

◆ m_volume

double Mantid::Geometry::MDBoxImplicitFunction::m_volume
private

Box volume.

Definition at line 43 of file MDBoxImplicitFunction.h.

Referenced by construct(), and volume().


The documentation for this class was generated from the following files: