A class to select subsets in an array.
More...
#include <OGF/mesh/commands/filter.h>
|
void | parse_items (const std::string &destription) |
| used in 'items' mode (ctor, floating_point = false)
|
|
void | parse_values (const std::string &destription) |
| used in 'values' mode (ctor, floating_point = true)
|
|
A class to select subsets in an array.
Definition at line 53 of file filter.h.
◆ Filter()
OGF::Filter::Filter |
( |
index_t |
size, |
|
|
const std::string & |
description, |
|
|
bool |
floating_point = false |
|
) |
| |
Filter constructor.
Throws an exception if description cannot be parsed
- Parameters
-
[in] | size | size of the array |
[in] | description | description of the subset, as a ';'-separated list of selections:
- '*' selects all elements
- 'nnn' selects an individual element
- 'nnn-mmm' selects the interval [nnn,mmm]
- '!nnn' unselects an individual element
- '!nnn-mmm' unselects the interval [nnn,mmm] Example: "*;!5" selects everything but element number 5
|
[in] | floating_point | if set, values to be tested are floating point values, else they are element indices. |
◆ test() [1/2]
bool OGF::Filter::test |
( |
double |
value | ) |
const |
Tests an element by value.
- Parameters
-
[in] | item | the element to be tested |
- Return values
-
true | if the element is in the subset |
false | otherwise |
◆ test() [2/2]
bool OGF::Filter::test |
( |
index_t |
item | ) |
const |
Tests an element.
- Parameters
-
[in] | item | the element to be tested |
- Return values
-
true | if the element is in the subset |
false | otherwise |
The documentation for this class was generated from the following file: