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

A general N-dimensional plane implicit function. More...

#include <MDPlaneImplicitFunction.h>

Inheritance diagram for Mantid::Geometry::MDPlaneImplicitFunction:
Mantid::Geometry::MDImplicitFunction

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

Detailed Description

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.

Date
2011-13-12

Definition at line 20 of file MDPlaneImplicitFunction.h.

Constructor & Destructor Documentation

◆ MDPlaneImplicitFunction() [1/3]

Mantid::Geometry::MDPlaneImplicitFunction::MDPlaneImplicitFunction ( )

Default constructor.

Definition at line 22 of file MDPlaneImplicitFunction.cpp.

◆ MDPlaneImplicitFunction() [2/3]

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.

Parameters
ndthe number of dimensions for the implicit plane
normalarray of coordinates for the plane normal
pointarray of coorindates for the plane origin

Definition at line 32 of file MDPlaneImplicitFunction.cpp.

References addPlane(), and origin.

◆ MDPlaneImplicitFunction() [3/3]

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.

Parameters
ndthe number of dimensions for the implicit plane
normalarray of coordinates for the plane normal
pointarray of coorindates for the plane origin

Definition at line 48 of file MDPlaneImplicitFunction.cpp.

References addPlane(), and origin.

Member Function Documentation

◆ addPlane()

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.

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

◆ checkOrigin()

void Mantid::Geometry::MDPlaneImplicitFunction::checkOrigin ( )
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().

◆ coordValue()

std::string Mantid::Geometry::MDPlaneImplicitFunction::coordValue ( const coord_t arr) const
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.

Parameters
arrthe array of coordinates to convert
Returns
the resulting values in a space separated string

Definition at line 125 of file MDPlaneImplicitFunction.cpp.

References Mantid::Geometry::MDImplicitFunction::getNumDims().

Referenced by toXMLString().

◆ getName()

std::string Mantid::Geometry::MDPlaneImplicitFunction::getName ( ) const
overridevirtual
Returns
the MDPlaneImplicitFunction type name.

Reimplemented from Mantid::Geometry::MDImplicitFunction.

Definition at line 70 of file MDPlaneImplicitFunction.cpp.

Referenced by toXMLString().

◆ toXMLString()

std::string Mantid::Geometry::MDPlaneImplicitFunction::toXMLString ( ) const
overridevirtual

Member Data Documentation

◆ origin

std::vector<coord_t> Mantid::Geometry::MDPlaneImplicitFunction::origin
private

The origin point of the implicit plane.

Definition at line 42 of file MDPlaneImplicitFunction.h.

Referenced by checkOrigin(), MDPlaneImplicitFunction(), and toXMLString().


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