File: ReParticle.h

package info (click to toggle)
bornagain 23.0-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 103,936 kB
  • sloc: cpp: 423,131; python: 40,997; javascript: 11,167; awk: 630; sh: 318; ruby: 173; xml: 130; makefile: 51; ansic: 24
file content (82 lines) | stat: -rw-r--r-- 2,769 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
//  ************************************************************************************************
//
//  BornAgain: simulate and fit reflection and scattering
//
//! @file      Resample/Particle/ReParticle.h
//! @brief     Defines class interface ReParticle.
//!
//! @homepage  http://www.bornagainproject.org
//! @license   GNU General Public License v3 or higher (see COPYING)
//! @copyright Forschungszentrum Jülich GmbH 2018
//! @authors   Scientific Computing Group at MLZ (see CITATION, AUTHORS)
//
//  ************************************************************************************************

#ifdef SWIG
#error no need to expose this header to Swig
#endif // SWIG
#ifndef BORNAGAIN_RESAMPLE_PARTICLE_REPARTICLE_H
#define BORNAGAIN_RESAMPLE_PARTICLE_REPARTICLE_H

#include "Base/Vector/RotMatrix.h"
#include "Resample/Particle/IReParticle.h"
#include <heinz/Vectors3D.h>
#include <memory>

class IFormfactor;
class Material;

//! A reprocessed simple particle, with shape m_ff.

class ReParticle : public IReParticle {
public:
    ReParticle(const IFormfactor* ff, const R3* position, const RotMatrix* rot);
    ~ReParticle() override;

#ifndef SWIG
    ReParticle* clone() const override;
#endif // SWIG

    //! Sets the material of the scatterer
    void setMaterial(const Material& material);

    //! Sets the ambient material
    void setAmbientMaterial(const Material& ambient_material) override;

    complex_t theFF(const WavevectorInfo& wavevectors) const override;
    SpinMatrix thePolFF(const WavevectorInfo& wavevectors) const override;

    double volume() const;

    double radialExtension() const override;

    Span zSpan() const override;

    bool contains(const R3& position) const;

    bool consideredEqualTo(const IReParticle& ire) const override;

    // TODO: should these pointer-returning functions be exposed to the Python interface
    const IFormfactor* ff() const { return m_ff.get(); }

    const Material* material() const { return m_material.get(); }

    const Material* ambientMaterial() const { return m_ambient_material.get(); }

    const RotMatrix* rotMatrix() const { return m_rot_matrix.get(); }

    const R3* position() const override { return m_position.get(); }

private:
    const std::unique_ptr<const IFormfactor> m_ff;
    std::unique_ptr<const Material> m_material;
    std::unique_ptr<const Material> m_ambient_material;
    const std::unique_ptr<const R3> m_position;
    const std::unique_ptr<const RotMatrix> m_rot_matrix;

    ReParticle(const std::optional<size_t>& i_layer, const IFormfactor* ff,
               const Material* material, const Material* ambient_material, const R3* position,
               const RotMatrix* rotMatrix);
};

#endif // BORNAGAIN_RESAMPLE_PARTICLE_REPARTICLE_H