Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
mantidproject
mantid
Commits
ec485749
Commit
ec485749
authored
Jul 20, 2017
by
Matthew Bowles
Browse files
add removePeaks method to PeaksWorkspace Re #19472
parent
3750b70e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Framework/DataObjects/inc/MantidDataObjects/PeaksWorkspace.h
View file @
ec485749
...
...
@@ -98,6 +98,7 @@ public:
int
getNumberPeaks
()
const
override
;
std
::
string
getConvention
()
const
override
;
void
removePeak
(
int
peakNum
)
override
;
void
removePeaks
(
const
std
::
vector
<
Peak
*>&
it
);
void
addPeak
(
const
Geometry
::
IPeak
&
peak
)
override
;
/// Move a peak object into this peaks workspace
void
addPeak
(
Peak
&&
peak
);
...
...
Framework/DataObjects/src/PeaksWorkspace.cpp
View file @
ec485749
...
...
@@ -17,6 +17,7 @@
#include
"MantidKernel/Quat.h"
#include
"MantidKernel/Unit.h"
#include
"MantidKernel/V3D.h"
#include
<algorithm>
#include
<boost/shared_ptr.hpp>
#include
<cmath>
...
...
@@ -149,6 +150,16 @@ void PeaksWorkspace::removePeak(const int peakNum) {
peaks
.
erase
(
peaks
.
begin
()
+
peakNum
);
}
/** Removes multiple peaks
* @param badPeaks Pointers to peaks to be removed
*/
void
PeaksWorkspace
::
removePeaks
(
const
std
::
vector
<
Peak
*>&
badPeaks
)
{
peaks
.
erase
(
remove_if
(
peaks
.
begin
(),
peaks
.
end
(),
[
&
badPeaks
]
(
const
Mantid
::
DataObjects
::
Peak
&
peak
)
{
return
std
::
find
(
badPeaks
.
begin
(),
badPeaks
.
end
(),
&
peak
)
!=
badPeaks
.
end
();
}),
peaks
.
end
());
}
//---------------------------------------------------------------------------------------------
/** Add a peak to the list
* @param ipeak :: Peak object to add (copy) into this.
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment