8#include "MantidJson/Json.h"
27 :
PeakShapeBase(frame,
std::move(algorithmName), algorithmVersion), m_detectorBinList(detectorBinList) {
29 if (detectorBinList.size() == 0) {
30 throw std::invalid_argument(
"No data provided for detector data");
41 Json::Value detBinList;
43 Json::Value detBinVal;
44 detBinVal[
"detId"] = Json::Value(detectorId);
45 detBinVal[
"startX"] = Json::Value(startX);
46 detBinVal[
"endX"] = Json::Value(endX);
47 detBinList.append(detBinVal);
50 root[
"detectors"] = detBinList;
51 return Mantid::JsonHelpers::jsonToString(root);
PeakShapeBase : Base class for concrete PeakShapes containing common code.
void buildCommon(Json::Value &root) const
Build common parts of outgoing JSON serialization.
bool operator==(const PeakShapeBase &other) const
Equals operator.
PeakShapeDetectorBin : PeakShape representing detector ids and integration limits of a peak.
std::string toJSON() const override
PeakShape interface.
PeakShapeDetectorBin(const std::vector< std::tuple< int32_t, double, double > > &detectorBinList, Kernel::SpecialCoordinateSystem frame, std::string algorithmName=std::string(), int algorithmVersion=-1)
Create PeakShapeDetectorBin.
std::vector< std::tuple< int32_t, double, double > > m_detectorBinList
Mantid::Geometry::PeakShape * clone() const override
Clone PeakShapeDetectorBin.
bool operator==(const PeakShapeDetectorBin &other) const
Equals operator.
static const std::string detectorBinShapeName()
std::string shapeName() const override
Get the peak shape.
PeakShape : Abstract type to describes the shape of a peak.
SpecialCoordinateSystem
Special coordinate systems for Q3D.