A filter that passes through points that satisfy some criterion.
Pass through filters allow a user defined function to choose which points are allowed to be passed through the filter. In addition, the filter can either invert its output, passing through those that fail a test, or it can choose to replace values that pass some criterion instead of passing them through the filter.
A pass through filter does not allow for a call to filter() with no additional arguments. A criterion function, along with an optional value to use in replacement, are required.
Criterion functions must take in the field type under consideration and return true if the parameter passes some test, or false if it fails.
An example of such a function that passes through geometry data that falls within some range could look like:
The above code will filter a point cloud with a pass through filter, letting through any point with an x value in the range [0.0, 1.0].
Criterion functions can be as complicated as you wish, so long as they only operate on one point at a time
- Examples:
- tests/test-PointCloud2Filter.C.
Definition at line 68 of file PassThroughFilter.H.
|
| PassThroughFilter (bool replaceValue=false, bool invertResult=false) |
| Create a pass through filter that lets through only certain points. More...
|
|
PointCloud2 | filter (PointCloud2 const input, std::function< bool(PointCloud2::Geometry const &)> &&func, PointCloud2::Geometry const &replaceValue=PointCloud2::Geometry()) |
| Filter the input, applying func to every point to see what to do. More...
|
|
PointCloud2 | filter (PointCloud2 const input, Indices const indices, std::function< bool(PointCloud2::Geometry const &)> &&func, PointCloud2::Geometry const &replaceValue=PointCloud2::Geometry()) |
| Filter the input, applying func to every point in a subset to see what to do. More...
|
|
template<class Field > |
PointCloud2 | filter (PointCloud2 const input, std::function< bool(Field const &)> &&func, Field const &replaceValue=Field()) |
| Filter the input on a specific field, applying func to every point to see what to do. More...
|
|
template<class Field > |
PointCloud2 | filter (PointCloud2 const input, Indices const indices, std::function< bool(Field const &)> &&func, Field const &replaceValue=Field()) |
| Filter the input on a specific field, applying func to every point in a subset to see what to do. More...
|
|
template<class Field > |
auto | filter (PointCloud2 const input, std::function< bool(Field const &)> &&func, Field const &replaceValue) -> PointCloud2 |
|
template<class Field > |
auto | filter (PointCloud2 const input, Indices const indices, std::function< bool(Field const &)> &&func, Field const &replaceValue) -> PointCloud2 |
|
template<class Field > |
auto | filterImpl (size_t const inputSize, PointCloud2::Iterator< Field > outputEnd, std::function< bool(Field const &)> &&func, Field const &replaceValue) -> Indices |
|
virtual | ~FilterBase () |
| Virtual destruction.
|
|
template<class Field > |
PointCloud2 | filter (PointCloud2 const input) |
| Force the filter to operate on a specific field, if supported. More...
|
|
template<class Field > |
PointCloud2 | filter (PointCloud2 const input, Indices const indices) |
| Force the filter to operate on a specific field of a subset, if supported. More...
|
|
|
PointCloud2 | filter (PointCloud2 const input) |
| Normal filtering not supported, must specify additional arguments.
|
|
PointCloud2 | filter (PointCloud2 const input, Indices const indices) |
| Normal filtering not supported, must specify additional arguments.
|
|
Indices | filterImpl (size_t const inputSize, PointCloud2::Iterator<> outputEnd, std::function< bool(PointCloud2::Geometry const &)> &&func, PointCloud2::Geometry const &replaceValue) |
| Figures out which indices we'll have to remove, if any. More...
|
|
template<class Field > |
Indices | filterImpl (size_t const inputSize, PointCloud2::Iterator< Field > outputEnd, std::function< bool(Field const &)> &&func, Field const &replaceValue) |
| Figures out which indices we'll have to remove, if any, templated version. More...
|
|