Mantid
Loading...
Searching...
No Matches
MDImplicitFunction.cpp
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2018 ISIS Rutherford Appleton Laboratory UKRI,
4// NScD Oak Ridge National Laboratory, European Spallation Source,
5// Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
6// SPDX - License - Identifier: GPL - 3.0 +
8
9namespace Mantid::Geometry {
10
11//----------------------------------------------------------------------------------------------
14MDImplicitFunction::MDImplicitFunction() : m_nd(0), m_numPlanes(0) {}
15
16//----------------------------------------------------------------------------------------------
22 // Number of dimensions must match
23 if (!m_planes.empty()) {
24 if (m_nd != plane.getNumDims())
25 throw std::invalid_argument("MDImplicitFunction::addPlane(): cannot add "
26 "a plane with different number of dimensions "
27 "as the previous ones.");
28 }
29 m_planes.emplace_back(plane);
30 m_nd = plane.getNumDims();
31 m_numPlanes = m_planes.size();
32}
33
34} // namespace Mantid::Geometry
void addPlane(const MDPlane &plane)
Add a bounded plane to this implicit function.
size_t m_numPlanes
Cached number of planes (for a sligh speed-up)
std::vector< MDPlane > m_planes
Vector of all the planes applying for this implict function.
size_t m_nd
number of dimensions for which this object can be applied
A generalized description of a N-dimensional hyperplane.
Definition MDPlane.h:41
size_t getNumDims() const
Definition MDPlane.h:54