27 if (Mantid::JsonHelpers::parse(source, &root)) {
28 const std::string shape = root[
"shape"].asString();
31 const std::string algorithmName(root[
"algorithm_name"].asString());
32 const int algorithmVersion(root[
"algorithm_version"].asInt());
34 PeakEllipsoidExtent abcRadii{root[
"radius0"].asDouble(), root[
"radius1"].asDouble(), root[
"radius2"].asDouble()};
36 root[
"background_inner_radius1"].asDouble(),
37 root[
"background_inner_radius2"].asDouble()};
39 root[
"background_outer_radius1"].asDouble(),
40 root[
"background_outer_radius2"].asDouble()};
42 directions[0].fromString(root[
"direction0"].asString());
43 directions[1].fromString(root[
"direction1"].asString());
44 directions[2].fromString(root[
"direction2"].asString());
46 product =
new PeakShapeEllipsoid(directions, abcRadii, abcRadiiBackgroundInner, abcRadiiBackgroundOuter, frame,
47 algorithmName, algorithmVersion);
53 throw std::invalid_argument(
"PeakShapeSphericalFactory:: No successor "
54 "factory able to process : " +
61 throw std::invalid_argument(
"PeakShapeSphericalFactory:: Source JSON for "
62 "the peak shape is not valid: " +