Graphite Version 3
An experimental 3D geometry processing program
Loading...
Searching...
No Matches
OGF::Filter Class Reference

A class to select subsets in an array. More...

#include <OGF/mesh/commands/filter.h>

Public Member Functions

 Filter (index_t size, const std::string &description, bool floating_point=false)
 Filter constructor.
bool test (index_t item) const
 Tests an element.
bool test (double value) const
 Tests an element by value.

Protected Member Functions

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)

Detailed Description

A class to select subsets in an array.

Definition at line 53 of file filter.h.

Constructor & Destructor Documentation

◆ 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]sizesize of the array
[in]descriptiondescription 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: "</em>;!5" selects everything but element number 5
[in]floating_pointif set, values to be tested are floating point values, else they are element indices.

Member Function Documentation

◆ test() [1/2]

bool OGF::Filter::test ( double value) const

Tests an element by value.

Parameters
[in]valuethe element value to be tested
Return values
trueif the element is in the subset
falseotherwise

◆ test() [2/2]

bool OGF::Filter::test ( index_t item) const

Tests an element.

Parameters
[in]itemthe element to be tested
Return values
trueif the element is in the subset
falseotherwise

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