BornAgain  1.19.79
Open-source research software to simulate and fit neutron and x-ray reflectometry and grazing-incidence small-angle scattering
TruncatedCube.h
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file Sample/HardParticle/TruncatedCube.h
6 //! @brief Defines class TruncatedCube.
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_TRUNCATEDCUBE_H
16 #define BORNAGAIN_SAMPLE_HARDPARTICLE_TRUNCATEDCUBE_H
17 
19 
20 //! A cube, with tetrahedral truncation of all corners
21 //! @ingroup hardParticle
22 
24 public:
25  TruncatedCube(double length, double removed_length);
26 #ifndef USER_API
27  TruncatedCube(std::vector<double> P);
28 
29  TruncatedCube* clone() const override { return new TruncatedCube(m_length, m_removed_length); }
30  std::string className() const final { return "TruncatedCube"; }
31  // const auto tooltip = "class_tooltip";
32  std::vector<ParaMeta> parDefs() const final
33  {
34  return {{"Length", "nm", "untruncated edge length", 0, +INF, 0},
35  {"RemovedLength", "nm", "edge length removed from one corner", 0, +INF, 0}};
36  }
37 
38  double length() const { return m_length; }
39  double removedLength() const { return m_removed_length; }
40 
41 private:
42  static const ff::PolyhedralTopology topology;
43  const double& m_length;
44  const double& m_removed_length;
45 #endif // USER_API
46 };
47 
48 #endif // BORNAGAIN_SAMPLE_HARDPARTICLE_TRUNCATEDCUBE_H
Defines interface IFormFactorPolyhedron.
const double INF
Definition: INode.h:26
A polyhedron, for form factor computation.
A cube, with tetrahedral truncation of all corners.
Definition: TruncatedCube.h:23
const double & m_removed_length
Definition: TruncatedCube.h:44
std::string className() const final
Returns the class name, to be hard-coded in each leaf class that inherits from INode.
Definition: TruncatedCube.h:30
std::vector< ParaMeta > parDefs() const final
Returns the parameter definitions, to be hard-coded in each leaf class.
Definition: TruncatedCube.h:32
static const ff::PolyhedralTopology topology
Definition: TruncatedCube.h:42
double length() const
Definition: TruncatedCube.h:38
TruncatedCube * clone() const override
Returns a clone of this ISampleNode object.
Definition: TruncatedCube.h:29
TruncatedCube(double length, double removed_length)
const double & m_length
Definition: TruncatedCube.h:43
double removedLength() const
Definition: TruncatedCube.h:39