Mantid
Loading...
Searching...
No Matches
CompositeBraggScatterer.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2014 ISIS Rutherford Appleton Laboratory UKRI,
4// NScD Oak Ridge National Laboratory, European Spallation Source,
5// Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
6// SPDX - License - Identifier: GPL - 3.0 +
7#pragma once
8
10#include "MantidGeometry/DllConfig.h"
11
12namespace Mantid {
13namespace Geometry {
14
45class CompositeBraggScatterer;
46
47using CompositeBraggScatterer_sptr = std::shared_ptr<CompositeBraggScatterer>;
48
49class MANTID_GEOMETRY_DLL CompositeBraggScatterer : public BraggScatterer {
50public:
52
54 static CompositeBraggScatterer_sptr create(const std::vector<BraggScatterer_sptr> &scatterers);
55
56 std::string name() const override { return "CompositeBraggScatterer"; }
57 BraggScatterer_sptr clone() const override;
58
59 virtual void addScatterer(const BraggScatterer_sptr &scatterer);
60 void addScatterers(const std::vector<BraggScatterer_sptr> &scatterer);
61 void setScatterers(const std::vector<BraggScatterer_sptr> &scatterers);
62 size_t nScatterers() const;
63 BraggScatterer_sptr getScatterer(size_t i) const;
64 const std::vector<BraggScatterer_sptr> &getScatterers() const;
65 void removeScatterer(size_t i);
66 void removeAllScatterers();
67
68 StructureFactor calculateStructureFactor(const Kernel::V3D &hkl) const override;
69
70protected:
71 void afterPropertySet(const std::string &propertyName) override;
72 void propagateProperty(const std::string &propertyName);
73 void propagatePropertyToScatterer(BraggScatterer_sptr &scatterer, const std::string &propertyName,
74 const std::string &propertyValue);
75
76 void addScattererImplementation(const BraggScatterer_sptr &scatterer);
77 void removeScattererImplementation(size_t i);
78
79 void redeclareProperties();
80 std::map<std::string, size_t> getPropertyCountMap() const;
81
82 std::vector<BraggScatterer_sptr> m_scatterers;
83};
84} // namespace Geometry
85} // namespace Mantid
BraggScatterer is a general interface for representing scatterers in the unit cell of a periodic stru...
CompositeBraggScatterer accumulates scatterers, for easier calculation of structure factors.
std::vector< BraggScatterer_sptr > m_scatterers
Class for 3D vectors.
Definition V3D.h:34
std::unique_ptr< T > create(const P &parent, const IndexArg &indexArg, const HistArg &histArg)
This is the create() method that all the other create() methods call.
std::shared_ptr< BraggScatterer > BraggScatterer_sptr
std::shared_ptr< CompositeBraggScatterer > CompositeBraggScatterer_sptr
std::complex< double > StructureFactor
Helper class which provides the Collimation Length for SANS instruments.