DataFilter array providing some convenience functions. More...
#include <OpenMS/FILTERING/DATAREDUCTION/DataFilters.h>
Classes | |
| struct | DataFilter |
| Representation of a peak/feature filter combining FilterType, FilterOperation and a value. More... | |
Public Types | |
| enum | FilterType { INTENSITY, QUALITY, CHARGE, SIZE, META_DATA } |
Information to filter. More... | |
| enum | FilterOperation { GREATER_EQUAL, EQUAL, LESS_EQUAL, EXISTS } |
Filter operation. More... | |
Public Member Functions | |
| DataFilters () | |
| Size | size () const |
| Filter count. | |
| const DataFilter & | operator[] (Size index) const |
| Filter accessor. | |
| void | add (const DataFilter &filter) |
| Adds a filter. | |
| void | remove (Size index) |
Removes the filter corresponding to index. | |
| void | replace (Size index, const DataFilter &filter) |
Replaces the filter corresponding to index. | |
| void | clear () |
| Removes all filters. | |
| void | setActive (bool is_active) |
| Enables/disables the all the filters. | |
| bool | isActive () const |
| Returns if the filters are enabled. | |
| bool | passes (const Feature &feature) const |
Returns if the feature fulfills the current filter criteria. | |
| bool | passes (const ConsensusFeature &consensus_feature) const |
Returns if the consensus_feature fulfills the current filter criteria. | |
| template<class PeakType > | |
| bool | passes (const MSSpectrum< PeakType > &spectrum, Size peak_index) const |
Returns if the peak fulfills the current filter criteria. | |
Protected Member Functions | |
| bool | metaPasses_ (const MetaInfoInterface &meta_interface, const DataFilters::DataFilter &filter, Size index) const |
Returns if the meta value at index of meta_interface (a peak or feature) passes the filter. | |
Protected Attributes | |
| std::vector< DataFilter > | filters_ |
| Array of DataFilters. | |
| std::vector< Size > | meta_indices_ |
| Vector of meta indices acting as index cache. | |
| bool | is_active_ |
| Determines if the filters are activated. | |
DataFilter array providing some convenience functions.
| enum FilterOperation |
| enum FilterType |
| DataFilters | ( | ) | [inline] |
| void add | ( | const DataFilter & | filter | ) |
Adds a filter.
Referenced by TOPPViewBase::addData(), and TOPPViewBase::filterContextMenu().
| void clear | ( | ) |
Removes all filters.
| bool isActive | ( | ) | const [inline] |
Returns if the filters are enabled.
They are automatically enabled when a filter is added and automatically disabled when the last filter is removed
Referenced by TOPPViewBase::updateFilterBar().
| bool metaPasses_ | ( | const MetaInfoInterface & | meta_interface, | |
| const DataFilters::DataFilter & | filter, | |||
| Size | index | |||
| ) | const [inline, protected] |
Returns if the meta value at index of meta_interface (a peak or feature) passes the filter.
References MetaInfoInterface::getMetaValue(), MetaInfoInterface::metaValueExists(), DataFilters::DataFilter::op, DataValue::STRING_VALUE, DataValue::toString(), DataFilters::DataFilter::value, DataFilters::DataFilter::value_is_numerical, DataFilters::DataFilter::value_string, and DataValue::valueType().
| const DataFilter& operator[] | ( | Size | index | ) | const |
Filter accessor.
| Exception::IndexOverflow | is thrown for invalid indices |
| bool passes | ( | const MSSpectrum< PeakType > & | spectrum, | |
| Size | peak_index | |||
| ) | const [inline] |
Returns if the peak fulfills the current filter criteria.
References DataFilters::DataFilter::field, MSSpectrum< PeakT >::getFloatDataArrays(), MSSpectrum< PeakT >::getIntegerDataArrays(), DataFilters::DataFilter::meta_name, DataFilters::DataFilter::op, and DataFilters::DataFilter::value.
| bool passes | ( | const Feature & | feature | ) | const |
Returns if the feature fulfills the current filter criteria.
| bool passes | ( | const ConsensusFeature & | consensus_feature | ) | const |
Returns if the consensus_feature fulfills the current filter criteria.
| void remove | ( | Size | index | ) |
Removes the filter corresponding to index.
| Exception::IndexOverflow | is thrown for invalid indices |
Referenced by TOPPViewBase::filterContextMenu().
| void replace | ( | Size | index, | |
| const DataFilter & | filter | |||
| ) |
Replaces the filter corresponding to index.
| Exception::IndexOverflow | is thrown for invalid indices |
Referenced by TOPPViewBase::filterEdit().
| void setActive | ( | bool | is_active | ) |
Enables/disables the all the filters.
| Size size | ( | ) | const |
Filter count.
Referenced by TOPPViewBase::updateFilterBar().
std::vector<DataFilter> filters_ [protected] |
Array of DataFilters.
bool is_active_ [protected] |
Determines if the filters are activated.
std::vector<Size> meta_indices_ [protected] |
Vector of meta indices acting as index cache.
| OpenMS / TOPP release 1.10.0 | Documentation generated on Thu Mar 7 2013 09:42:53 using doxygen 1.7.1 |