libpappsomspp
Library for mass spectrometry
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 69 of file filterresample.h.

Constructor & Destructor Documentation

◆ FilterResampleRemoveXRange() [1/2]

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

Definition at line 96 of file filterresample.cpp.

98  : m_minX(min_x), m_maxX(max_x)
99 {
100 }

◆ FilterResampleRemoveXRange() [2/2]

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

Definition at line 102 of file filterresample.cpp.

104  : FilterResampleRemoveXRange(other.m_minX, other.m_maxX)
105 {
106 }
FilterResampleRemoveXRange(double min_x, double max_x)

◆ ~FilterResampleRemoveXRange()

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

Definition at line 78 of file filterresample.h.

78 {};

Member Function Documentation

◆ filter()

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

Implements pappso::FilterInterface.

Definition at line 120 of file filterresample.cpp.

121 {
122 
123  // qDebug() << __FILE__ << " " << __FUNCTION__ << " " << __LINE__
124  // << " m_min_x=" << m_min_x;
125  // qDebug() << __FILE__ << " " << __FUNCTION__ << " " << __LINE__
126  // << " m_max_x=" << m_max_x;
127  auto begin_it =
128  findFirstEqualOrGreaterX(spectrum.begin(), spectrum.end(), m_minX);
129  // qDebug() << __FILE__ << " " << __FUNCTION__ << " " << __LINE__
130  // << " begin_it->x=" << begin_it->x;
131  auto end_it = findFirstGreaterX(begin_it, spectrum.end(), m_maxX);
132  // qDebug() << __FILE__ << " " << __FUNCTION__ << " " << __LINE__
133  // << " end_it->x=" << end_it->x;
134  spectrum.erase(begin_it, end_it);
135 
136  // qDebug() << __FILE__ << " " << __FUNCTION__ << " " << __LINE__
137  // << " spectrum.size()=" << spectrum.size();
138  return spectrum;
139 }
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:69
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:97

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

Referenced by pappso::MassSpectrumFilterResampleRemoveMzRange::filter().

◆ operator=()

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

Definition at line 110 of file filterresample.cpp.

111 {
112  m_minX = other.m_minX;
113  m_maxX = other.m_maxX;
114 
115  return *this;
116 }

References m_maxX, and m_minX.

Member Data Documentation

◆ m_maxX

double pappso::FilterResampleRemoveXRange::m_maxX
private

Definition at line 73 of file filterresample.h.

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

◆ m_minX

double pappso::FilterResampleRemoveXRange::m_minX
private

Definition at line 72 of file filterresample.h.

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


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