Commit 423d6018 authored by Whitfield, Ross's avatar Whitfield, Ross
Browse files

Add method to create a default Peak/LeanElasticPeak for the workspace

parent 5cb09c3d
......@@ -134,6 +134,12 @@ public:
virtual std::unique_ptr<Geometry::IPeak>
createPeakHKL(const Mantid::Kernel::V3D &HKL) const = 0;
/**
* Create an instance of a peak using default constructor
* @return a pointer to a new Peak object.
*/
virtual std::unique_ptr<Geometry::IPeak> createPeak() const = 0;
//---------------------------------------------------------------------------------------------
/** Determine if the workspace has been integrated using a peaks integration
* algorithm.
......
......@@ -106,6 +106,8 @@ public:
std::unique_ptr<Geometry::IPeak>
createPeakHKL(const Kernel::V3D &HKL) const override;
std::unique_ptr<Geometry::IPeak> createPeak() const override;
int peakInfoNumber(const Kernel::V3D &qFrame, bool labCoords) const override;
std::vector<LeanElasticPeak> &getPeaks();
......
......@@ -104,6 +104,8 @@ public:
std::unique_ptr<Geometry::IPeak>
createPeakHKL(const Kernel::V3D &HKL) const override;
std::unique_ptr<Geometry::IPeak> createPeak() const override;
int peakInfoNumber(const Kernel::V3D &qFrame, bool labCoords) const override;
std::vector<Peak> &getPeaks();
......
......@@ -327,6 +327,15 @@ LeanElasticPeaksWorkspace::createPeakHKL(const V3D &HKL) const {
return peak;
}
/**
* Create a Peak using default values
*
* @return a point to a new peak object
*/
std::unique_ptr<IPeak> LeanElasticPeaksWorkspace::createPeak() const {
return std::make_unique<LeanElasticPeak>();
}
/**
* Returns selected information for a "peak" at QLabFrame.
*
......
......@@ -509,6 +509,15 @@ std::unique_ptr<IPeak> PeaksWorkspace::createPeakHKL(const V3D &HKL) const {
return peak;
}
/**
* Create a Peak using default values
*
* @return a point to a new peak object
*/
std::unique_ptr<IPeak> PeaksWorkspace::createPeak() const {
return std::make_unique<Peak>();
}
/**
* Returns selected information for a "peak" at QLabFrame.
*
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment