49 void addPlane(
const MDPlane &plane);
63 throw std::runtime_error(
"Cannot call MDImplicitFunction does not implement getName()");
68 throw std::runtime_error(
"Cannot call MDImplicitFunction does not implement toXMLString()");
95 for (
size_t i = 0; i < m_numPlanes; i++) {
96 if (!m_planes[i].isPointBounded(coords))
111 for (
size_t i = 0; i < m_numPlanes; i++) {
112 if (!m_planes[i].isPointBounded(coords))
127 for (
size_t i = 0; i < m_numPlanes; i++) {
128 if (!m_planes[i].isPointBounded(coords))
162 size_t numPoints = vertexes.size();
166 for (
size_t i = 0; i < m_numPlanes; i++) {
167 size_t numBounded = 0;
168 for (
size_t j = 0; j < numPoints; j++) {
169 if (m_planes[i].isPointBounded(vertexes[j])) {
198 for (
size_t i = 0; i < m_numPlanes; i++) {
199 size_t numBounded = 0;
200 for (
size_t j = 0; j < numPoints; j++) {
201 if (m_planes[i].isPointBounded(vertexes + j * m_nd)) {
232 bool lookForFullyContained =
true;
236 for (
size_t i = 0; i < m_numPlanes; i++) {
237 size_t numBounded = 0;
238 for (
size_t j = 0; j < numPoints; j++) {
239 if (m_planes[i].isPointBounded(vertexes + j * m_nd)) {
243 if (!lookForFullyContained)
248 lookForFullyContained =
false;
256 if (numBounded != numPoints)
257 lookForFullyContained =
false;
261 if (lookForFullyContained)
std::map< DeltaEMode::Type, std::string > index
An "ImplicitFunction" defining a hyper-cuboid-shaped region in N dimensions.
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.
eContact
Enum for describing the contact between a box and an implicit function.
size_t getNumDims() const
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 c...
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 c...
size_t m_numPlanes
Cached number of planes (for a sligh speed-up)
virtual std::string getName() const
virtual bool isPointContained(const coord_t *coords)
Is a point in MDimensions contained by this ImplicitFunction? If the point is bounded by ALL planes c...
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?
size_t getNumPlanes() const
std::vector< MDPlane > m_planes
Vector of all the planes applying for this implict function.
virtual ~MDImplicitFunction()=default
size_t m_nd
number of dimensions for which this object can be applied
virtual std::string toXMLString() 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.
A generalized description of a N-dimensional hyperplane.
std::shared_ptr< MDImplicitFunction > MDImplicitFunction_sptr
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,...