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

removes a value to all Y values More...

`#include <filterpass.h>`

Inheritance diagram for pappso::FilterRemoveY:

## Public Member Functions

| FilterRemoveY (const QString &strBuildParams)
| FilterRemoveY (double valueToRemove)
| FilterRemoveY (const FilterRemoveY &other)
virtual | ~FilterRemoveY ()
FilterRemoveY & | operator= (const FilterRemoveY &other)
Trace & | filter (Trace &data_points) const override
double | getValue () const
void | buildFilterFromString (const QString &strBuildParams) override
| build this filter using a string
QString | toString () const override
QString | name () const override
Public Member Functions inherited from pappso::FilterNameInterface
virtual | ~FilterNameInterface ()
Public Member Functions inherited from pappso::FilterInterface
virtual | ~FilterInterface ()

## Private Attributes

double | m_valueToRemove = 0

## Detailed Description

removes a value to all Y values

Definition at line 231 of file filterpass.h.

## Constructor & Destructor Documentation

## FilterRemoveY() [1/3]

pappso::FilterRemoveY::FilterRemoveY | ( | const QString & | strBuildParams | ) |

Definition at line 454 of file filterpass.cpp.

{
buildFilterFromString(strBuildParams);
}
pappso::FilterRemoveY::buildFilterFromString
void buildFilterFromString(const QString &strBuildParams) override
build this filter using a string
Definition filterpass.cpp:461

References buildFilterFromString().

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

## FilterRemoveY() [2/3]

FilterRemoveY::FilterRemoveY | ( | double | valueToRemove | ) |

Definition at line 476 of file filterpass.cpp.

: m_valueToRemove(valueToRemove)
{
}
pappso::FilterRemoveY::m_valueToRemove
double m_valueToRemove
Definition filterpass.h:253

References m_valueToRemove.

## FilterRemoveY() [3/3]

FilterRemoveY::FilterRemoveY | ( | const FilterRemoveY & | other | ) |

Definition at line 480 of file filterpass.cpp.

: m_valueToRemove(other.m_valueToRemove)
{
}

References FilterRemoveY(), and m_valueToRemove.

## ~FilterRemoveY()

virtual pappso::FilterRemoveY::~FilterRemoveY | ( |  | ) |

inline virtual

Definition at line 237 of file filterpass.h.

{};

## Member Function Documentation

## buildFilterFromString()

void pappso::FilterRemoveY::buildFilterFromString | ( | const QString & | strBuildParams | ) |

override virtual

build this filter using a string

Parameters

  strBuildParams | a string coding the filter and its parameters "filterName|param1;param2;param3"

Implements pappso::FilterNameInterface.

Definition at line 461 of file filterpass.cpp.

{
if(strBuildParams.startsWith(QString("%1|").arg(name())))
{
QStringList params = strBuildParams.split("|").back().split(";");
m_valueToRemove = params.at(0).toDouble();
}
else
{
throw pappso::ExceptionNotRecognized(
QString("Building of FilterRemoveY from string %1 failed").arg(strBuildParams));
}
}
pappso::FilterRemoveY::name
QString name() const override
Definition filterpass.cpp:485

References m_valueToRemove, and name().

Referenced by FilterRemoveY().

## filter()

Trace & FilterRemoveY::filter | ( | Trace & | data_points | ) | const

override virtual

Implements pappso::FilterInterface.

Definition at line 513 of file filterpass.cpp.

{
for(auto &&dataPoint : data_points)
{
if(dataPoint.y < m_valueToRemove)
dataPoint.y = 0;
else
dataPoint.y = dataPoint.y - m_valueToRemove;
}
return data_points;
}

References m_valueToRemove.

## getValue()

double FilterRemoveY::getValue | ( |  | ) | const

Definition at line 507 of file filterpass.cpp.

{
return m_valueToRemove;
}

References m_valueToRemove.

## name()

QString pappso::FilterRemoveY::name | ( |  | ) | const

override virtual

Implements pappso::FilterNameInterface.

Definition at line 485 of file filterpass.cpp.

{
return "removeY";
}

Referenced by buildFilterFromString(), and toString().

## operator=()

FilterRemoveY & FilterRemoveY::operator= | ( | const FilterRemoveY & | other | ) |

Definition at line 500 of file filterpass.cpp.

{
m_valueToRemove = other.m_valueToRemove;
return *this;
}

References FilterRemoveY(), and m_valueToRemove.

## toString()

QString pappso::FilterRemoveY::toString | ( |  | ) | const

override virtual

Implements pappso::FilterNameInterface.

Definition at line 491 of file filterpass.cpp.

{
QString strCode = QString("%1|%2").arg(name()).arg(m_valueToRemove);
return strCode;
}

References m_valueToRemove, and name().

## Member Data Documentation

## m_valueToRemove

double pappso::FilterRemoveY::m_valueToRemove = 0

private

Definition at line 253 of file filterpass.h.

Referenced by FilterRemoveY(), FilterRemoveY(), buildFilterFromString(), filter(), getValue(), operator=(), and toString().

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

- pappsomspp/core/processing/filters/filterpass.h
- pappsomspp/core/processing/filters/filterpass.cpp