BornAgain  1.18.0
Simulate and fit neutron and x-ray scattering at grazing incidence
FormFactorBox.h
Go to the documentation of this file.
1 // ************************************************************************** //
2 //
3 // BornAgain: simulate and fit scattering at grazing incidence
4 //
5 //! @file Sample/HardParticle/FormFactorBox.h
6 //! @brief Defines class FormFactorBox.
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_CORE_HARDPARTICLE_FORMFACTORBOX_H
16 #define BORNAGAIN_CORE_HARDPARTICLE_FORMFACTORBOX_H
17 
19 
20 //! A rectangular prism (parallelepiped).
21 //! @ingroup hardParticle
22 
24 {
25 public:
26  FormFactorBox(const std::vector<double> P);
27  FormFactorBox(double length, double width, double height);
28 
29  FormFactorBox* clone() const override final
30  {
31  return new FormFactorBox(m_length, m_width, m_height);
32  }
33 
34  void accept(INodeVisitor* visitor) const override final { visitor->visit(this); }
35 
36  double getLength() const { return m_length; }
37  double getWidth() const { return m_width; }
38 
39  double volume() const override final { return m_length * m_height * m_width; }
40  double radialExtension() const override final { return m_length / 2.0; }
41  complex_t evaluate_for_q(cvector_t q) const override final;
42 
43 protected:
44  IFormFactor* sliceFormFactor(ZLimits limits, const IRotation& rot,
45  kvector_t translation) const override final;
46 
47  void onChange() override final;
48  double height() const final { return m_height; }
49 
50 private:
51  const double& m_length;
52  const double& m_width;
53  const double& m_height;
54 };
55 
56 #endif // BORNAGAIN_CORE_HARDPARTICLE_FORMFACTORBOX_H
Defines class IFormFactorPrism.
A rectangular prism (parallelepiped).
Definition: FormFactorBox.h:24
void onChange() override final
Action to be taken in inherited class when a parameter has changed.
void accept(INodeVisitor *visitor) const override final
Calls the INodeVisitor's visit method.
Definition: FormFactorBox.h:34
complex_t evaluate_for_q(cvector_t q) const override final
Returns scattering amplitude for complex scattering wavevector q=k_i-k_f.
IFormFactor * sliceFormFactor(ZLimits limits, const IRotation &rot, kvector_t translation) const override final
Actually slices the form factor or throws an exception.
double radialExtension() const override final
Returns the (approximate in some cases) radial size of the particle of this form factor's shape.
Definition: FormFactorBox.h:40
FormFactorBox * clone() const override final
Returns a clone of this ISample object.
Definition: FormFactorBox.h:29
double volume() const override final
Returns the total volume of the particle of this form factor's shape.
Definition: FormFactorBox.h:39
A prism with a polygonal base, for form factor computation.
Pure virtual base class for all form factors.
Definition: IFormFactor.h:40
Visitor interface to visit ISample objects.
Definition: INodeVisitor.h:149
Pure virtual interface for rotations.
Definition: Rotations.h:27
Class that contains upper and lower limits of the z-coordinate for the slicing of form factors.
Definition: ZLimits.h:41