55 size_t nd = min.
size();
57 throw std::invalid_argument(
"MDBoxImplicitFunction::ctor(): Min and max vector sizes must match!");
58 if (nd == 0 || nd > 100)
59 throw std::invalid_argument(
"MDBoxImplicitFunction::ctor(): Invalid number of dimensions!");
62 for (
size_t d = 0;
d < nd;
d++) {
68 std::vector<coord_t> normal_min(nd, 0);
72 std::vector<coord_t> origin_min(nd, 0);
73 origin_min[
d] =
static_cast<coord_t>(min[
d]);
75 MDPlane p_min(normal_min, origin_min);
79 std::vector<coord_t> normal_max(nd, 0);
83 std::vector<coord_t> origin_max(nd, 0);
84 origin_max[
d] =
static_cast<coord_t>(max[
d]);
86 MDPlane p_max(normal_max, origin_max);
109 for (
size_t d = 0;
d < nd; ++
d) {
111 const coord_t min = boxExtents[
d].get<0>();
112 const coord_t max = boxExtents[
d].get<1>();
121 const coord_t dBoxRange = (max - min);
124 const coord_t dOverlap = dInnerMax - dInnerMin;
126 frac *= dOverlap / dBoxRange;
MDBoxImplicitFunction(const Mantid::Kernel::VMD &min, const Mantid::Kernel::VMD &max)
Constructor with min/max dimensions.
void construct(const Mantid::Kernel::VMD &min, const Mantid::Kernel::VMD &max)
Constructor helper method.
const Mantid::Kernel::VMD m_max
Maximum extents of MDBox.
const Mantid::Kernel::VMD m_min
Minimum extents of MDBox.
double volume() const
Calculate volume.
double m_volume
Box volume.
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.
void addPlane(const MDPlane &plane)
Add a bounded plane to this implicit function.
A generalized description of a N-dimensional hyperplane.
VMDBase< VMD_t > VMD
Define the VMD as using the double or float data type.
float coord_t
Typedef for the data type to use for coordinate axes in MD objects such as MDBox, MDEventWorkspace,...