BornAgain  1.19.79
Open-source research software to simulate and fit neutron and x-ray reflectometry and grazing-incidence small-angle scattering
Pyramid4.h
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file Sample/HardParticle/Pyramid4.h
6 //! @brief Defines class Pyramid4
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_PYRAMID4_H
16 #define BORNAGAIN_SAMPLE_HARDPARTICLE_PYRAMID4_H
17 
19 
20 //! A frustum with a quadratic base.
21 //! @ingroup hardParticle
22 
24 public:
25  Pyramid4(double base_edge, double height, double alpha);
26 #ifndef USER_API
27  Pyramid4(std::vector<double> P);
28 
29  Pyramid4* clone() const override { return new Pyramid4(m_base_edge, m_height, m_alpha); }
30  std::string className() const final { return "Pyramid4"; }
31  // const auto tooltip = "frustum with quadratic base";
32  std::vector<ParaMeta> parDefs() const final
33  {
34  return {{"BaseEdge", "nm", "base edge length", 0, +INF, 0},
35  {"Height", "nm", "height", 0, +INF, 0},
36  {"Alpha", "rad", "angle between base and a side face", 0., M_PI, 0}};
37  }
38 
39  double height() const { return m_height; }
40  double baseEdge() const { return m_base_edge; }
41  double alpha() const { return m_alpha; }
42 
43 private:
44  static const ff::PolyhedralTopology topology;
45 
46  const double& m_base_edge;
47  const double& m_height;
48  const double& m_alpha;
49 #endif // USER_API
50 };
51 
52 #endif // BORNAGAIN_SAMPLE_HARDPARTICLE_PYRAMID4_H
#define M_PI
Definition: Constants.h:44
Defines interface IFormFactorPolyhedron.
const double INF
Definition: INode.h:26
A polyhedron, for form factor computation.
A frustum with a quadratic base.
Definition: Pyramid4.h:23
double height() const
Definition: Pyramid4.h:39
double alpha() const
Definition: Pyramid4.h:41
const double & m_height
Definition: Pyramid4.h:47
const double & m_base_edge
Definition: Pyramid4.h:46
double baseEdge() const
Definition: Pyramid4.h:40
std::vector< ParaMeta > parDefs() const final
Returns the parameter definitions, to be hard-coded in each leaf class.
Definition: Pyramid4.h:32
std::string className() const final
Returns the class name, to be hard-coded in each leaf class that inherits from INode.
Definition: Pyramid4.h:30
Pyramid4 * clone() const override
Returns a clone of this ISampleNode object.
Definition: Pyramid4.h:29
Pyramid4(double base_edge, double height, double alpha)
Definition: Pyramid4.cpp:68
const double & m_alpha
Definition: Pyramid4.h:48
static const ff::PolyhedralTopology topology
Definition: Pyramid4.h:44