9#include "MantidJson/Json.h"
26 if (Mantid::JsonHelpers::parse(source, &root)) {
27 const std::string shape = root[
"shape"].asString();
30 const std::string algorithmName(root[
"algorithm_name"].asString());
31 const int algorithmVersion(root[
"algorithm_version"].asInt());
33 const double radius(root[
"radius"].asDouble());
35 if (!root[
"background_outer_radius"].empty() && !root[
"background_inner_radius"].empty()) {
36 const double backgroundOuterRadius(root[
"background_outer_radius"].asDouble());
37 const double backgroundInnerRadius(root[
"background_inner_radius"].asDouble());
50 throw std::invalid_argument(
"PeakShapeSphericalFactory:: No successor "
51 "factory able to process : " +
57 throw std::invalid_argument(
"PeakShapeSphericalFactory:: Source JSON for "
58 "the peak shape is not valid: " +
Mantid::Geometry::PeakShape * create(const std::string &source) const override
Make product.
PeakShapeFactory_const_sptr m_successor
Successor factory.
void setSuccessor(PeakShapeFactory_const_sptr successorFactory) override
Set a successor should this factory be unsuitable.
PeakShapeSpherical : PeakShape for a spherical peak.
static const std::string sphereShapeName()
Non-instance shape name.
PeakShape : Abstract type to describes the shape of a peak.
std::shared_ptr< const PeakShapeFactory > PeakShapeFactory_const_sptr
Helper typedef.
SpecialCoordinateSystem
Special coordinate systems for Q3D.