Loading...
Searching...
No Matches
pappso::FilterResampleKeepXRange Class Reference

`#include <filterresample.h>`

Inheritance diagram for pappso::FilterResampleKeepXRange:

## Public Member Functions

| FilterResampleKeepXRange (double min_x=0, double max_x=0)
| FilterResampleKeepXRange (const FilterResampleKeepXRange &other)
virtual | ~FilterResampleKeepXRange ()
FilterResampleKeepXRange & | operator= (const FilterResampleKeepXRange &other)
Trace & | filter (Trace &trace) const override
Public Member Functions inherited from pappso::FilterInterface
virtual | ~FilterInterface ()

## Private Attributes

double | m_minX
double | m_maxX

## Detailed Description

Definition at line 88 of file filterresample.h.

## Constructor & Destructor Documentation

## FilterResampleKeepXRange() [1/2]

pappso::FilterResampleKeepXRange::FilterResampleKeepXRange | ( | double | min_x = `0`,
|  | double | max_x = `0`
| ) |  |

Definition at line 142 of file filterresample.cpp.

: m_minX(min_x), m_maxX(max_x)
{
}
pappso::FilterResampleKeepXRange::m_maxX
double m_maxX
Definition filterresample.h:92
pappso::FilterResampleKeepXRange::m_minX
double m_minX
Definition filterresample.h:91

## FilterResampleKeepXRange() [2/2]

pappso::FilterResampleKeepXRange::FilterResampleKeepXRange | ( | const FilterResampleKeepXRange & | other | ) |

Definition at line 147 of file filterresample.cpp.

: m_minX(other.m_minX), m_maxX(other.m_maxX)
{
}

## ~FilterResampleKeepXRange()

virtual pappso::FilterResampleKeepXRange::~FilterResampleKeepXRange | ( |  | ) |

inline virtual

Definition at line 97 of file filterresample.h.

{};

## Member Function Documentation

## filter()

Trace & pappso::FilterResampleKeepXRange::filter | ( | Trace & | trace | ) | const

override virtual

Implements pappso::FilterInterface.

Definition at line 168 of file filterresample.cpp.

{
// qDebug() << "The range to keep:" << m_minX << "-" << m_maxX;
auto begin_it =
findFirstEqualOrGreaterX(spectrum.begin(), spectrum.end(), m_minX);
// qDebug() << "Found begin iterator (for m_minX) having:" << begin_it->x
//<< "x (m/z) value";
auto end_it = findFirstGreaterX(begin_it, spectrum.end(), m_maxX);
if(end_it == spectrum.end())
{
// qDebug() << "The end iterator (for m_maxX) is the end(). The prev "
//"iterator has"
//<< std::prev(end_it)->x << " x(m / z) value.";
}
else
{
// qDebug() << "Found end iterator (for m_maxX) having:" << end_it->x
//<< "x (m/z) value";
}
// qDebug() << "Only keeping range" << begin_it->x << "-"
//<< std::prev(end_it)->x;
spectrum.erase(end_it, spectrum.end());
spectrum.erase(spectrum.begin(), begin_it);
return spectrum;
}
pappso::findFirstEqualOrGreaterX
std::vector< DataPoint >::iterator findFirstEqualOrGreaterX(std::vector< DataPoint >::iterator begin, std::vector< DataPoint >::iterator end, const double &value)
find the first element in which X is equal or greater than the value searched important : it implies ...
Definition trace.cpp:71
pappso::findFirstGreaterX
std::vector< DataPoint >::iterator findFirstGreaterX(std::vector< DataPoint >::iterator begin, std::vector< DataPoint >::iterator end, const double &value)
find the first element in which X is greater than the value searched important : it implies that Trac...
Definition trace.cpp:99

References pappso::findFirstEqualOrGreaterX(), pappso::findFirstGreaterX(), m_maxX, and m_minX.

Referenced by pappso::MsRunXicExtractor::extractOneXicCoord(), pappso::MassSpectrumFilterResampleKeepMzRange::filter(), and pappso::FilterResampleKeepPointInPolygon::filter().

## operator=()

FilterResampleKeepXRange & pappso::FilterResampleKeepXRange::operator= | ( | const FilterResampleKeepXRange & | other | ) |

Definition at line 155 of file filterresample.cpp.

{
if(&other == this)
return *this;
m_minX = other.m_minX;
m_maxX = other.m_maxX;
return *this;
}

References m_maxX, and m_minX.

## Member Data Documentation

## m_maxX

double pappso::FilterResampleKeepXRange::m_maxX

private

Definition at line 92 of file filterresample.h.

Referenced by filter(), and operator=().

## m_minX

double pappso::FilterResampleKeepXRange::m_minX

private

Definition at line 91 of file filterresample.h.

Referenced by filter(), and operator=().

The documentation for this class was generated from the following files:

- pappsomspp/processing/filters/filterresample.h
- pappsomspp/processing/filters/filterresample.cpp