BornAgain  1.19.79
Open-source research software to simulate and fit neutron and x-ray reflectometry and grazing-incidence small-angle scattering
PolyhedralUtil Namespace Reference

Functions

double BottomZ (const std::vector< R3 > &vertices, const IRotation *rotation)
 Calculates the z-coordinate of the lowest vertex after rotation. More...
 
double TopZ (const std::vector< R3 > &vertices, const IRotation *rotation)
 Calculates the z-coordinate of the highest vertex after rotation. More...
 

Function Documentation

◆ BottomZ()

double PolyhedralUtil::BottomZ ( const std::vector< R3 > &  vertices,
const IRotation rotation 
)

Calculates the z-coordinate of the lowest vertex after rotation.

Definition at line 21 of file PolyhedralUtil.cpp.

22 {
23  ASSERT(vertices.size());
25  vertices.begin(), vertices.end(), [&](const R3& vertex) -> double {
26  return (rotation ? rotation->transformed(vertex) : vertex).z();
27  });
28 }
#define ASSERT(condition)
Definition: Assert.h:45
double min_value(const Iterator &begin, const Iterator &end, const Evaluator &evaluate)
Returns the minimum value of function evaluate as applied to the elements of an iterator range.
Definition: Algorithms.h:58

References ASSERT, and BaseUtils::algo::min_value().

Referenced by IFormFactor::bottomZ(), IFormFactorPolyhedron::bottomZ(), and IFormFactorPrism::bottomZ().

Here is the call graph for this function:

◆ TopZ()

double PolyhedralUtil::TopZ ( const std::vector< R3 > &  vertices,
const IRotation rotation 
)

Calculates the z-coordinate of the highest vertex after rotation.

Definition at line 30 of file PolyhedralUtil.cpp.

31 {
32  ASSERT(vertices.size());
34  vertices.begin(), vertices.end(), [&](const R3& vertex) -> double {
35  return (rotation ? rotation->transformed(vertex) : vertex).z();
36  });
37 }
double max_value(const Iterator &begin, const Iterator &end, const Evaluator &evaluate)
Returns the maximum value of function evaluate as applied to the elements of an iterator range.
Definition: Algorithms.h:70

References ASSERT, and BaseUtils::algo::max_value().

Referenced by IFormFactor::topZ(), IFormFactorPolyhedron::topZ(), and IFormFactorPrism::topZ().

Here is the call graph for this function: