11#include "MantidDataObjects/DllConfig.h"
28namespace DataObjects {
42 const std::string
id()
const override {
return "PeaksWorkspace"; }
61 std::unique_ptr<PeaksWorkspace>
clone()
const {
return std::unique_ptr<PeaksWorkspace>(doClone()); }
64 std::unique_ptr<PeaksWorkspace>
cloneEmpty()
const {
return std::unique_ptr<PeaksWorkspace>(doCloneEmpty()); }
72 void sort(std::vector<ColumnAndDirection> &criteria)
override;
74 int getNumberPeaks()
const override;
75 std::string getConvention()
const override;
76 void removePeak(
int peakNum)
override;
77 void removePeaks(std::vector<int> badPeaks)
override;
80 void addPeak(
Peak &&peak);
82 Peak &getPeak(
int peakNum)
override;
83 const Peak &getPeak(
int peakNum)
const override;
86 boost::optional<double> detectorDistance = boost::none)
const override;
92 std::vector<std::pair<std::string, std::string>> peakInfo(
const Kernel::V3D &qFrame,
bool labCoords)
const override;
98 int peakInfoNumber(
const Kernel::V3D &qFrame,
bool labCoords)
const override;
100 std::vector<Peak> &getPeaks();
101 const std::vector<Peak> &getPeaks()
const;
102 bool hasIntegratedPeaks()
const override;
103 size_t getMemorySize()
const override;
119 size_t columnCount()
const override {
return static_cast<int>(m_columns.size()); }
122 size_t rowCount()
const override {
return getNumberPeaks(); }
125 std::shared_ptr<Mantid::API::Column>
getColumn(
const std::string &name)
override {
126 return getColumn(getColumnIndex(name));
130 std::shared_ptr<const Mantid::API::Column>
getColumn(
const std::string &name)
const override {
131 return getColumn(getColumnIndex(name));
135 virtual size_t getColumnIndex(
const std::string &name)
const;
138 std::shared_ptr<Mantid::API::Column> getColumn(
size_t index)
override;
148 std::vector<std::string>
getColumnNames()
const override {
return this->m_columnNames; }
154 void saveNexus(::NeXus::File *file)
const override;
163 ITableWorkspace *doCloneColumns(
const std::vector<std::string> &colNames)
const override;
168 void addPeakColumn(
const std::string &name);
178 bool addColumns(
const std::string & ,
const std::string & ,
size_t )
override {
184 "PeaksWorkspace structure is read-only. Cannot remove column.");
200 void find(
size_t ,
size_t & ,
size_t )
override {
204 void find(
double ,
size_t & ,
size_t )
override {
208 void find(
float ,
size_t & ,
size_t )
override {
218 void find(
const std::string & ,
size_t & ,
size_t )
override {
234 std::vector<std::shared_ptr<Mantid::DataObjects::PeakColumn<Peak>>>
m_columns;
std::map< DeltaEMode::Type, std::string > index
Interface to the class Mantid::DataObjects::PeaksWorkspace.
ITableWorkspace is an implementation of Workspace in which the data are organised in columns of same ...
Structure describing a single-crystal peak.
The class PeaksWorkspace stores information about a set of SCD peaks.
void find(API::Boolean, size_t &, size_t) override
find method to get the index of API::Boolean value cell in a table workspace
const std::string id() const override
Return the workspace typeID.
void find(float, size_t &, size_t) override
find method to get the index of float cell value in a table workspace
void setRowCount(size_t) override
Resizes the workspace.
std::vector< std::shared_ptr< Mantid::DataObjects::PeakColumn< Peak > > > m_columns
Column shared pointers.
std::pair< std::string, bool > ColumnAndDirection
void removeColumn(const std::string &) override
Removes a column.
std::vector< Peak > m_peaks
Vector of Peak contained within.
PeaksWorkspace * doClone() const override
Virtual clone method. Not implemented to force implementation in children.
std::vector< std::string > getColumnNames() const override
Returns a vector of all column names.
PeaksWorkspace & operator=(const PeaksWorkspace &other)=delete
bool customSort() const override
std::vector< std::string > m_columnNames
Column names.
std::shared_ptr< Mantid::API::Column > getColumn(const std::string &name) override
Gets the shared pointer to a column by name.
bool addColumns(const std::string &, const std::string &, size_t) override
Creates n new columns of the same type.
void find(double, size_t &, size_t) override
find method to get the index of double cell value in a table workspace
size_t insertRow(size_t) override
Inserts a row before row pointed to by index and fills it with default vales.
std::unique_ptr< PeaksWorkspace > cloneEmpty() const
Returns a default-initialized clone of the workspace.
void find(size_t, size_t &, size_t) override
find method to get the index of integer cell value in a table workspace
API::Column_sptr addColumn(const std::string &, const std::string &) override
Creates a new column.
void removeRow(size_t) override
Delets a row if it exists.
std::unique_ptr< PeaksWorkspace > clone() const
Returns a clone of the workspace.
bool threadSafe() const override
This is always threadsafe.
PeaksWorkspace * doCloneEmpty() const override
Virtual cloneEmpty method.
void find(const Mantid::Kernel::V3D &, size_t &, size_t) override
find method to get the index of Mantid::Kernel::V3D cell value in a table workspace
std::shared_ptr< const Mantid::API::Column > getColumn(const std::string &name) const override
Gets the shared pointer to a column by name.
void find(const std::string &, size_t &, size_t) override
find method to get the index of cellstd::string value in a table workspace
void appendFile(std::string filename, Geometry::Instrument_sptr inst)
size_t columnCount() const override
Number of columns in the workspace.
Kernel::SpecialCoordinateSystem m_coordSystem
Coordinates.
size_t rowCount() const override
Number of rows in the workspace.
Structure describing a single-crystal peak.
Marks code as not implemented yet.
std::shared_ptr< const LogManager > LogManager_const_sptr
shared pointer to the logManager base class (const version)
std::shared_ptr< Column > Column_sptr
std::shared_ptr< LogManager > LogManager_sptr
shared pointer to the logManager base class
std::shared_ptr< ITableWorkspace > ITableWorkspace_sptr
shared pointer to Mantid::API::ITableWorkspace
std::shared_ptr< const Column > Column_const_sptr
std::shared_ptr< const PeaksWorkspace > PeaksWorkspace_const_sptr
Typedef for a shared pointer to a const peaks workspace.
std::shared_ptr< PeaksWorkspace > PeaksWorkspace_sptr
Typedef for a shared pointer to a peaks workspace.
std::shared_ptr< Instrument > Instrument_sptr
Shared pointer to an instrument object.
std::unique_ptr< IPeak > IPeak_uptr
SpecialCoordinateSystem
Special coordinate systems for Q3D.
Helper class which provides the Collimation Length for SANS instruments.
As TableColumn stores its data in a std::vector bool type cannot be used in the same way as the other...