BornAgain  1.19.79
Open-source research software to simulate and fit neutron and x-ray reflectometry and grazing-incidence small-angle scattering
Pyramid2.h
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file Sample/HardParticle/Pyramid2.h
6 //! @brief Defines class Pyramid2
7 //!
8 //! @homepage http://www.bornagainproject.org
9 //! @license GNU General Public License v3 or higher (see COPYING)
10 //! @copyright Forschungszentrum Jülich GmbH 2018
11 //! @authors Scientific Computing Group at MLZ (see CITATION, AUTHORS)
12 //
13 // ************************************************************************************************
14 
15 #ifndef BORNAGAIN_SAMPLE_HARDPARTICLE_PYRAMID2_H
16 #define BORNAGAIN_SAMPLE_HARDPARTICLE_PYRAMID2_H
17 
19 
20 //! A frustum (truncated pyramid) with rectangular base.
21 //! @ingroup hardParticle
22 
24 public:
25  Pyramid2(double length, double width, double height, double alpha);
26 #ifndef USER_API
27  Pyramid2(std::vector<double> P);
28 
29  Pyramid2* clone() const override { return new Pyramid2(m_length, m_width, m_height, m_alpha); }
30  std::string className() const final { return "Pyramid2"; }
31  // const auto tooltip = "frustum with rectangular base";
32  std::vector<ParaMeta> parDefs() const final
33  {
34  return {{"Length", "nm", "side length of base in x direction", 0, +INF, 0},
35  {"Width", "nm", "side length of base in y direction", 0, +INF, 0},
36  {"Height", "nm", "height", 0, +INF, 0},
37  {"Alpha", "rad", "angle between base and any side face", 0., M_PI_2, 0}};
38  }
39 
40  double length() const { return m_length; }
41  double width() const { return m_width; }
42  double height() const { return m_height; }
43  double alpha() const { return m_alpha; }
44 
45 private:
46  static const ff::PolyhedralTopology topology;
47 
48  const double& m_length;
49  const double& m_width;
50  const double& m_height;
51  const double& m_alpha;
52 #endif // USER_API
53 };
54 
55 #endif // BORNAGAIN_SAMPLE_HARDPARTICLE_PYRAMID2_H
#define M_PI_2
Definition: Constants.h:45
Defines interface IFormFactorPolyhedron.
const double INF
Definition: INode.h:26
A polyhedron, for form factor computation.
A frustum (truncated pyramid) with rectangular base.
Definition: Pyramid2.h:23
Pyramid2(double length, double width, double height, double alpha)
Definition: Pyramid2.cpp:72
double width() const
Definition: Pyramid2.h:41
const double & m_length
Definition: Pyramid2.h:48
double length() const
Definition: Pyramid2.h:40
const double & m_alpha
Definition: Pyramid2.h:51
std::vector< ParaMeta > parDefs() const final
Returns the parameter definitions, to be hard-coded in each leaf class.
Definition: Pyramid2.h:32
double height() const
Definition: Pyramid2.h:42
const double & m_width
Definition: Pyramid2.h:49
const double & m_height
Definition: Pyramid2.h:50
Pyramid2 * clone() const override
Returns a clone of this ISampleNode object.
Definition: Pyramid2.h:29
std::string className() const final
Returns the class name, to be hard-coded in each leaf class that inherits from INode.
Definition: Pyramid2.h:30
static const ff::PolyhedralTopology topology
Definition: Pyramid2.h:46
double alpha() const
Definition: Pyramid2.h:43