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 +
9
10namespace Mantid::Geometry {
11
12//----------------------------------------------------------------------------------------------
15MDImplicitFunction::MDImplicitFunction() : m_nd(0), m_numPlanes(0) {}
16
17//----------------------------------------------------------------------------------------------
23 // Number of dimensions must match
24 if (!m_planes.empty()) {
25 if (m_nd != plane.getNumDims())
26 throw std::invalid_argument("MDImplicitFunction::addPlane(): cannot add "
27 "a plane with different number of dimensions "
28 "as the previous ones.");
29 }
30 m_planes.emplace_back(plane);
31 m_nd = plane.getNumDims();
32 m_numPlanes = m_planes.size();
33}
34
35} // 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