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 setScatterers(const std::vector<BraggScatterer_sptr> &scatterers);
61 size_t nScatterers() const;
62 BraggScatterer_sptr getScatterer(size_t i) const;
63 void removeScatterer(size_t i);
64 void removeAllScatterers();
65
66 StructureFactor calculateStructureFactor(const Kernel::V3D &hkl) const override;
67
68protected:
69 void afterPropertySet(const std::string &propertyName) override;
70 void propagateProperty(const std::string &propertyName);
71 void propagatePropertyToScatterer(BraggScatterer_sptr &scatterer, const std::string &propertyName,
72 const std::string &propertyValue);
73
74 void addScattererImplementation(const BraggScatterer_sptr &scatterer);
75 void removeScattererImplementation(size_t i);
76
77 void redeclareProperties();
78 std::map<std::string, size_t> getPropertyCountMap() const;
79
80 std::vector<BraggScatterer_sptr> m_scatterers;
81};
82} // namespace Geometry
83} // 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.