libpappsomspp
Library for mass spectrometry
pappso::FilterResampleKeepGreater Class Reference

#include <filterresample.h>

Inheritance diagram for pappso::FilterResampleKeepGreater:
pappso::FilterInterface

Public Member Functions

 FilterResampleKeepGreater (double x_value)
 
 FilterResampleKeepGreater (const FilterResampleKeepGreater &other)
 
virtual ~FilterResampleKeepGreater ()
 
FilterResampleKeepGreateroperator= (const FilterResampleKeepGreater &other)
 
Tracefilter (Trace &trace) const override
 
double getThresholdX () const
 

Private Attributes

double m_value
 

Detailed Description

Definition at line 68 of file filterresample.h.

Constructor & Destructor Documentation

◆ FilterResampleKeepGreater() [1/2]

FilterResampleKeepGreater::FilterResampleKeepGreater ( double  x_value)

Definition at line 55 of file filterresample.cpp.

56  : m_value(x_value)
57 {
58 }

◆ FilterResampleKeepGreater() [2/2]

FilterResampleKeepGreater::FilterResampleKeepGreater ( const FilterResampleKeepGreater other)

Definition at line 60 of file filterresample.cpp.

63 {
64 }

◆ ~FilterResampleKeepGreater()

virtual pappso::FilterResampleKeepGreater::~FilterResampleKeepGreater ( )
inlinevirtual

Definition at line 76 of file filterresample.h.

82 : public FilterInterface

Member Function Documentation

◆ filter()

Trace & FilterResampleKeepGreater::filter ( Trace trace) const
overridevirtual

Implements pappso::FilterInterface.

Definition at line 82 of file filterresample.cpp.

83 {
84  qDebug() << __FILE__ << " " << __FUNCTION__ << " " << __LINE__
85  << " spectrum.size()=" << spectrum.size();
86  auto last_it = findFirstGreaterX(spectrum.begin(), spectrum.end(), m_value);
87  spectrum.erase(spectrum.begin(), last_it);
88  qDebug() << __FILE__ << " " << __FUNCTION__ << " " << __LINE__
89  << " spectrum.size()=" << spectrum.size();
90  return spectrum;
91 }

References pappso::findFirstGreaterX(), and m_value.

◆ getThresholdX()

double FilterResampleKeepGreater::getThresholdX ( ) const

Definition at line 68 of file filterresample.cpp.

69 {
70  return m_value;
71 }

References m_value.

◆ operator=()

FilterResampleKeepGreater & FilterResampleKeepGreater::operator= ( const FilterResampleKeepGreater other)

Definition at line 74 of file filterresample.cpp.

75 {
76  m_value = other.m_value;
77 
78  return *this;
79 }

References m_value.

Member Data Documentation

◆ m_value

double pappso::FilterResampleKeepGreater::m_value
private

Definition at line 71 of file filterresample.h.

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


The documentation for this class was generated from the following files:
pappso::FilterResampleKeepGreater::FilterResampleKeepGreater
FilterResampleKeepGreater(double x_value)
Definition: filterresample.cpp:55
pappso::FilterResampleKeepGreater::m_value
double m_value
Definition: filterresample.h: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:59