/
IPeaksWorkspace.h
164 lines (133 loc) · 6.2 KB
/
IPeaksWorkspace.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
#ifndef MANTID_API_IPEAKSPACE_H_
#define MANTID_API_IPEAKSPACE_H_ 1
//----------------------------------------------------------------------
// Includes
//----------------------------------------------------------------------
#include "MantidAPI/ITableWorkspace.h"
#include "MantidAPI/ExperimentInfo.h"
#include "MantidKernel/SpecialCoordinateSystem.h"
#include <boost/optional.hpp>
namespace Mantid {
namespace API {
class IPeak;
//==========================================================================================
/** Interface to the class Mantid::DataObjects::PeaksWorkspace
The class PeaksWorkspace stores information about a set of SCD peaks.
@author Ruth Mikkelson, SNS ORNL
@date 3/10/2010
Copyright © 2011 ISIS Rutherford Appleton Laboratory, NScD Oak Ridge
National Laboratory & European Spallation Source
This file is part of Mantid.
Mantid is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
Mantid is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
File change history is stored at: <https://github.com/mantidproject/mantid>
*/
class MANTID_API_DLL IPeaksWorkspace : public ITableWorkspace,
public Mantid::API::ExperimentInfo {
public:
/// Ctor
IPeaksWorkspace() : ITableWorkspace(), ExperimentInfo() {}
/// Copy constructor
IPeaksWorkspace(const IPeaksWorkspace &other)
: ITableWorkspace(other), ExperimentInfo(other) {}
/// Destructor
virtual ~IPeaksWorkspace();
// boost::shared_ptr<IPeaksWorkspace> clone() = 0;
// void appendFile( std::string filename, Mantid::Geometry::Instrument_sptr
// inst) = 0;
//---------------------------------------------------------------------------------------------
/** @return the number of peaks
*/
virtual int getNumberPeaks() const = 0;
//---------------------------------------------------------------------------------------------
/** Removes the indicated peak
* @param peakNum the peak to remove. peakNum starts at 0
*/
virtual void removePeak(int peakNum) = 0;
//---------------------------------------------------------------------------------------------
/** Add a peak to the list
* @param ipeak :: Peak object to add (copy) into this.
*/
virtual void addPeak(const IPeak &ipeak) = 0;
//---------------------------------------------------------------------------------------------
/** Return a reference to the Peak
* @param peakNum :: index of the peak to get.
* @return a reference to a Peak object.
*/
virtual IPeak &getPeak(int peakNum) = 0;
//---------------------------------------------------------------------------------------------
/** Return a reference to the Peak (const version)
* @param peakNum :: index of the peak to get.
* @return a reference to a Peak object.
*/
virtual const IPeak &getPeak(int peakNum) const = 0;
//---------------------------------------------------------------------------------------------
/** Return a pointer to the Peak
* @param peakNum :: index of the peak to get.
* @return a pointer to a Peak object.
*/
IPeak *getPeakPtr(const int peakNum) { return &this->getPeak(peakNum); }
//---------------------------------------------------------------------------------------------
/** Create an instance of a Peak
* @param QLabFrame :: Q of the center of the peak in the lab frame, in reciprocal space
* @param detectorDistance :: Optional distance between the sample and the detector. Calculated if not provided.
* @return a pointer to a new Peak object.
*/
virtual IPeak *createPeak(Mantid::Kernel::V3D QLabFrame,
boost::optional<double> detectorDistance) const = 0;
/**
* Create an instance of a peak using a V3D
* @param HKL V3D
* @return a pointer to a new Peak object.
*/
virtual IPeak *createPeakHKL(Mantid::Kernel::V3D HKL) const = 0;
//---------------------------------------------------------------------------------------------
/** Determine if the workspace has been integrated using a peaks integration
* algorithm.
* @return TRUE if the workspace has been integrated.
*/
virtual bool hasIntegratedPeaks() const = 0;
//---------------------------------------------------------------------------------------------
/**
* Creates a new TableWorkspace giving the IDs of the detectors that
* contribute to the
* peak.
* @returns A shared pointer to a TableWorkspace containing the information
*/
virtual API::ITableWorkspace_sptr createDetectorTable() const = 0;
//---------------------------------------------------------------------------------------------
/**
* Set the special coordinate system.
* @param coordinateSystem : Special Q3D coordinate system to use.
*/
virtual void setCoordinateSystem(
const Mantid::Kernel::SpecialCoordinateSystem coordinateSystem) = 0;
//---------------------------------------------------------------------------------------------
/**
* Get the special coordinate system.
* @returns special Q3D coordinate system to use being used by this
* PeaksWorkspace object. Probably the one the workspace was generated with.
*/
virtual Mantid::Kernel::SpecialCoordinateSystem
getSpecialCoordinateSystem() const = 0;
virtual std::vector<std::pair<std::string, std::string>>
peakInfo(Kernel::V3D QFrame, bool labCoords) const = 0;
virtual int peakInfoNumber(Kernel::V3D qLabFrame, bool labCoords) const = 0;
protected:
virtual const std::string toString() const;
};
/// Typedef for a shared pointer to a peaks workspace.
typedef boost::shared_ptr<IPeaksWorkspace> IPeaksWorkspace_sptr;
/// Typedef for a shared pointer to a const peaks workspace.
typedef boost::shared_ptr<const IPeaksWorkspace> IPeaksWorkspace_const_sptr;
}
}
#endif