8#include "MantidJson/Json.h"
17 const std::vector<double> &abcRadiiBackgroundInner,
18 const std::vector<double> &abcRadiiBackgroundOuter,
20 int algorithmVersion,
const Kernel::V3D &translation)
21 :
PeakShapeBase(frame,
std::move(algorithmName), algorithmVersion), m_directions(directions), m_abc_radii(abcRadii),
22 m_abc_radiiBackgroundInner(abcRadiiBackgroundInner), m_abc_radiiBackgroundOuter(abcRadiiBackgroundOuter),
23 m_translation(translation) {
26 throw std::invalid_argument(
"directions must be of size 3");
29 throw std::invalid_argument(
"radii must be of size 3");
32 throw std::invalid_argument(
"radii inner must be of size 3");
35 throw std::invalid_argument(
"radii outer must be of size 3");
56std::vector<Kernel::V3D>
61 throw std::invalid_argument(
"The inverted goniometer matrix is not "
62 "compatible with the direction vector");
65 std::vector<Kernel::V3D> directionsInFrame;
68 [&invertedGoniometerMatrix](
const auto &direction) { return invertedGoniometerMatrix * direction; });
69 return directionsInFrame;
95 return Mantid::JsonHelpers::jsonToString(root);
103 std::vector<double>::const_iterator it;
115 return boost::optional<double>{*it};
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.
PeakShapeEllipsoid : PeakShape representing a 3D ellipsoid.
std::string toJSON() const override
PeakShape interface.
Mantid::Kernel::V3D m_translation
translation of center
PeakShapeEllipsoid(const std::vector< Mantid::Kernel::V3D > &directions, const std::vector< double > &abcRadii, const std::vector< double > &abcRadiiBackgroundInner, const std::vector< double > &abcRadiiBackgroundOuter, Kernel::SpecialCoordinateSystem frame, std::string algorithmName=std::string(), int algorithmVersion=-1, const Mantid::Kernel::V3D &translation={0.0, 0.0, 0.0})
Constructor.
const Kernel::V3D & translation() const
Get translation of center.
std::vector< Mantid::Kernel::V3D > m_directions
principle axis
const std::vector< Mantid::Kernel::V3D > & directions() const
Get ellipsoid directions.
bool operator==(const PeakShapeEllipsoid &other) const
Equals operator.
std::vector< double > m_abc_radiiBackgroundInner
inner radii
static const std::string ellipsoidShapeName()
boost::optional< double > radius(RadiusType type=RadiusType::Radius) const override
PeakBase interface.
PeakShapeEllipsoid * clone() const override
Clone ellipsoid.
const std::vector< double > & abcRadiiBackgroundOuter() const
Get background outer radii.
std::vector< double > m_abc_radii
radii
const std::vector< double > & abcRadii() const
Get radii.
std::vector< double > m_abc_radiiBackgroundOuter
outer radii
std::string shapeName() const override
Get the peak shape.
const std::vector< double > & abcRadiiBackgroundInner() const
Get background inner radii.
std::vector< Kernel::V3D > getDirectionInSpecificFrame(Kernel::Matrix< double > &invertedGoniometerMatrix) const
Get ellipsoid directions in a specified frame.
RadiusType
For selecting different radius types.
size_t numRows() const
Return the number of rows in the matrix.
size_t numCols() const
Return the number of columns in the matrix.
SpecialCoordinateSystem
Special coordinate systems for Q3D.