Mantid
Loading...
Searching...
No Matches
BraggScatterer.cpp
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2018 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 +
8
9namespace Mantid::Geometry {
10
11using namespace Kernel;
12
15 : PropertyManager(), m_propagatingGroupName("PropagatingProperty"), m_isInitialized(false) {}
16
21
22 m_isInitialized = true;
23}
24
27
29double BraggScatterer::calculateFSquared(const V3D &hkl) const {
30 double modulusF = std::abs(calculateStructureFactor(hkl));
31
32 return modulusF * modulusF;
33}
34
37bool BraggScatterer::isPropertyExposedToComposite(const std::string &propertyName) const {
38 Property *property = getProperty(propertyName);
39
40 return isPropertyExposedToComposite(property);
41}
42
46 if (!property) {
47 throw std::invalid_argument("Cannot determine propagation behavior of null-property.");
48 }
49
50 return property->getGroup() == getPropagatingGroupName();
51}
52
62void BraggScatterer::exposePropertyToComposite(const std::string &propertyName) {
64}
65
67void BraggScatterer::unexposePropertyFromComposite(const std::string &propertyName) {
68 setPropertyGroup(propertyName, "");
69}
70
73
74} // namespace Mantid::Geometry
bool isPropertyExposedToComposite(const std::string &propertyName) const
Checks whether a property with the given name is exposed to BraggScattererComposite.
double calculateFSquared(const Kernel::V3D &hkl) const
Returns |F(hkl)|^2.
virtual StructureFactor calculateStructureFactor(const Kernel::V3D &hkl) const =0
void initialize()
Initialization method that calls declareProperties() and sets initialized state to true.
void unexposePropertyFromComposite(const std::string &propertyName)
Removes exposure to composite for specified property.
BraggScatterer()
Default constructor.
const std::string & getPropagatingGroupName() const
Returns the group name that is used to mark properties that are propagated.
void exposePropertyToComposite(const std::string &propertyName)
Exposes the property with the supplied name to BraggScattererComposite.
virtual void declareProperties()
Base implementation does nothing - for implementing classes only.
bool isInitialized()
Returns whether the instance has been initialized.
void setPropertyGroup(const std::string &name, const std::string &group)
Set the group for a given property.
Property manager helper class.
TypedValue getProperty(const std::string &name) const override
Get the value of a property.
Base class for properties.
Definition: Property.h:94
Class for 3D vectors.
Definition: V3D.h:34