BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
FormFactorFullSphere.h
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file Sample/HardParticle/FormFactorFullSphere.h
6 //! @brief Defines class FormFactorFullSphere.
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_FORMFACTORFULLSPHERE_H
16 #define BORNAGAIN_SAMPLE_HARDPARTICLE_FORMFACTORFULLSPHERE_H
17 
19 
20 //! A full sphere.
21 //! @ingroup hardParticle
22 
23 class FormFactorFullSphere : public IBornFF {
24 public:
25  FormFactorFullSphere(const std::vector<double> P, bool position_at_center = false);
26  FormFactorFullSphere(double radius, bool position_at_center = false);
27 
28  FormFactorFullSphere* clone() const final
29  {
31  }
32  void accept(INodeVisitor* visitor) const final { visitor->visit(this); }
33 
34  double getRadius() const { return m_radius; }
35 
36  double radialExtension() const final { return m_radius; }
37 
38  double bottomZ(const IRotation& rotation) const final;
39 
40  double topZ(const IRotation& rotation) const final;
41 
42  complex_t evaluate_for_q(cvector_t q) const final;
43 
44 protected:
45  bool canSliceAnalytically(const IRotation&) const final { return true; }
46 
47  IFormFactor* sliceFormFactor(ZLimits limits, const IRotation& rot,
48  kvector_t translation) const final;
49 
50  void onChange() final;
51 
52 private:
53  const double& m_radius;
55 };
56 
57 #endif // BORNAGAIN_SAMPLE_HARDPARTICLE_FORMFACTORFULLSPHERE_H
std::complex< double > complex_t
Definition: Complex.h:20
Defines interface IBornFF.
double bottomZ(const IRotation &rotation) const final
Returns the z-coordinate of the lowest point in this shape after a given rotation.
void accept(INodeVisitor *visitor) const final
Calls the INodeVisitor's visit method.
complex_t evaluate_for_q(cvector_t q) const final
Returns scattering amplitude for complex scattering wavevector q=k_i-k_f.
bool canSliceAnalytically(const IRotation &) const final
Checks if slicing has a fast analytical solution.
void onChange() final
Action to be taken in inherited class when a parameter has changed.
IFormFactor * sliceFormFactor(ZLimits limits, const IRotation &rot, kvector_t translation) const final
Actually slices the form factor or throws an exception.
FormFactorFullSphere * clone() const final
Returns a clone of this ISampleNode object.
double radialExtension() const final
Returns the (approximate in some cases) radial size of the particle of this form factor's shape.
double topZ(const IRotation &rotation) const final
Returns the z-coordinate of the lowest point in this shape after a given rotation.
FormFactorFullSphere(const std::vector< double > P, bool position_at_center=false)
Abstract base class for Born form factors.
Definition: IBornFF.h:41
Abstract base class for all form factors.
Definition: IFormFactor.h:36
Visitor interface to visit ISampleNode objects.
Definition: INodeVisitor.h:146
Abstract base class for rotations.
Definition: Rotations.h:28
Class that contains upper and lower limits of the z-coordinate for the slicing of form factors.
Definition: ZLimits.h:45