libpappsomspp
Library for mass spectrometry
Loading...
Searching...
No Matches
pappso::FilterResampleRemoveXRange Class Reference

#include <filterresample.h>

Inheritance diagram for pappso::FilterResampleRemoveXRange:
pappso::FilterInterface

Public Member Functions

 FilterResampleRemoveXRange (double min_x, double max_x)
 FilterResampleRemoveXRange (const FilterResampleRemoveXRange &other)
virtual ~FilterResampleRemoveXRange ()
FilterResampleRemoveXRangeoperator= (const FilterResampleRemoveXRange &other)
Tracefilter (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 71 of file filterresample.h.

Constructor & Destructor Documentation

◆ FilterResampleRemoveXRange() [1/2]

pappso::FilterResampleRemoveXRange::FilterResampleRemoveXRange ( double min_x,
double max_x )

Definition at line 91 of file filterresample.cpp.

References m_maxX, and m_minX.

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

◆ FilterResampleRemoveXRange() [2/2]

pappso::FilterResampleRemoveXRange::FilterResampleRemoveXRange ( const FilterResampleRemoveXRange & other)

Definition at line 96 of file filterresample.cpp.

97 : FilterResampleRemoveXRange(other.m_minX, other.m_maxX)
98{
99}
FilterResampleRemoveXRange(double min_x, double max_x)

References FilterResampleRemoveXRange(), m_maxX, and m_minX.

◆ ~FilterResampleRemoveXRange()

virtual pappso::FilterResampleRemoveXRange::~FilterResampleRemoveXRange ( )
inlinevirtual

Definition at line 80 of file filterresample.h.

80{};

Member Function Documentation

◆ filter()

Trace & pappso::FilterResampleRemoveXRange::filter ( Trace & trace) const
overridevirtual

Implements pappso::FilterInterface.

Definition at line 113 of file filterresample.cpp.

114{
115
116 // qDebug() << __FILE__ << " " << __FUNCTION__ << " " << __LINE__
117 // << " m_min_x=" << m_min_x;
118 // qDebug() << __FILE__ << " " << __FUNCTION__ << " " << __LINE__
119 // << " m_max_x=" << m_max_x;
120 auto begin_it = findFirstEqualOrGreaterX(spectrum.begin(), spectrum.end(), m_minX);
121 // qDebug() << __FILE__ << " " << __FUNCTION__ << " " << __LINE__
122 // << " begin_it->x=" << begin_it->x;
123 auto end_it = findFirstGreaterX(begin_it, spectrum.end(), m_maxX);
124 // qDebug() << __FILE__ << " " << __FUNCTION__ << " " << __LINE__
125 // << " end_it->x=" << end_it->x;
126 spectrum.erase(begin_it, end_it);
127
128 // qDebug() << __FILE__ << " " << __FUNCTION__ << " " << __LINE__
129 // << " spectrum.size()=" << spectrum.size();
130 return spectrum;
131}
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:65
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:93

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

◆ operator=()

FilterResampleRemoveXRange & pappso::FilterResampleRemoveXRange::operator= ( const FilterResampleRemoveXRange & other)

Definition at line 103 of file filterresample.cpp.

104{
105 m_minX = other.m_minX;
106 m_maxX = other.m_maxX;
107
108 return *this;
109}

References FilterResampleRemoveXRange(), m_maxX, and m_minX.

Member Data Documentation

◆ m_maxX

double pappso::FilterResampleRemoveXRange::m_maxX
private

◆ m_minX

double pappso::FilterResampleRemoveXRange::m_minX
private

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