Point Cloud Library (PCL)  1.12.0-dev
List of all members | Public Types | Public Member Functions | Protected Member Functions | Protected Attributes
pcl::experimental::advanced::FunctorFilter< PointT, FunctionObject > Class Template Reference

Filter point clouds and indices based on a function object passed in the ctor. More...

#include <pcl/filters/experimental/functor_filter.h>

+ Inheritance diagram for pcl::experimental::advanced::FunctorFilter< PointT, FunctionObject >:

Public Types

using FunctionObjectT = FunctionObject
 
- Public Types inherited from pcl::FilterIndices< PointT >
using PointCloud = pcl::PointCloud< PointT >
 
using Ptr = shared_ptr< FilterIndices< PointT > >
 
using ConstPtr = shared_ptr< const FilterIndices< PointT > >
 
- Public Types inherited from pcl::Filter< PointT >
using Ptr = shared_ptr< Filter< PointT > >
 
using ConstPtr = shared_ptr< const Filter< PointT > >
 
using PointCloud = pcl::PointCloud< PointT >
 
using PointCloudPtr = typename PointCloud::Ptr
 
using PointCloudConstPtr = typename PointCloud::ConstPtr
 
- Public Types inherited from pcl::PCLBase< PointT >
using PointCloud = pcl::PointCloud< PointT >
 
using PointCloudPtr = typename PointCloud::Ptr
 
using PointCloudConstPtr = typename PointCloud::ConstPtr
 
using PointIndicesPtr = PointIndices::Ptr
 
using PointIndicesConstPtr = PointIndices::ConstPtr
 

Public Member Functions

 FunctorFilter (FunctionObjectT function_object, bool extract_removed_indices=false)
 Constructor. More...
 
const FunctionObjectTgetFunctionObject () const noexcept
 
FunctionObjectTgetFunctionObject () noexcept
 
void applyFilter (Indices &indices) override
 Filtered results are indexed by an indices array. More...
 
- Public Member Functions inherited from pcl::FilterIndices< PointT >
 FilterIndices (bool extract_removed_indices=false)
 Constructor. More...
 
void filter (Indices &indices)
 Calls the filtering method and returns the filtered point cloud indices. More...
 
void setNegative (bool negative)
 Set whether the regular conditions for points filtering should apply, or the inverted conditions. More...
 
bool getNegative () const
 Get whether the regular conditions for points filtering should apply, or the inverted conditions. More...
 
void setKeepOrganized (bool keep_organized)
 Set whether the filtered points should be kept and set to the value given through setUserFilterValue (default: NaN), or removed from the PointCloud, thus potentially breaking its organized structure. More...
 
bool getKeepOrganized () const
 Get whether the filtered points should be kept and set to the value given through setUserFilterValue (default = NaN), or removed from the PointCloud, thus potentially breaking its organized structure. More...
 
void setUserFilterValue (float value)
 Provide a value that the filtered points should be set to instead of removing them. More...
 
- Public Member Functions inherited from pcl::Filter< PointT >
 Filter (bool extract_removed_indices=false)
 Empty constructor. More...
 
const IndicesConstPtr getRemovedIndices () const
 Get the point indices being removed. More...
 
void getRemovedIndices (PointIndices &pi)
 Get the point indices being removed. More...
 
void filter (PointCloud &output)
 Calls the filtering method and returns the filtered dataset in output. More...
 
- Public Member Functions inherited from pcl::PCLBase< PointT >
 PCLBase ()
 Empty constructor. More...
 
 PCLBase (const PCLBase &base)
 Copy constructor. More...
 
virtual ~PCLBase ()=default
 Destructor. More...
 
virtual void setInputCloud (const PointCloudConstPtr &cloud)
 Provide a pointer to the input dataset. More...
 
const PointCloudConstPtr getInputCloud () const
 Get a pointer to the input point cloud dataset. More...
 
virtual void setIndices (const IndicesPtr &indices)
 Provide a pointer to the vector of indices that represents the input data. More...
 
virtual void setIndices (const IndicesConstPtr &indices)
 Provide a pointer to the vector of indices that represents the input data. More...
 
virtual void setIndices (const PointIndicesConstPtr &indices)
 Provide a pointer to the vector of indices that represents the input data. More...
 
virtual void setIndices (std::size_t row_start, std::size_t col_start, std::size_t nb_rows, std::size_t nb_cols)
 Set the indices for the points laying within an interest region of the point cloud. More...
 
IndicesPtr getIndices ()
 Get a pointer to the vector of indices used. More...
 
const IndicesConstPtr getIndices () const
 Get a pointer to the vector of indices used. More...
 
const PointToperator[] (std::size_t pos) const
 Override PointCloud operator[] to shorten code. More...
 

Protected Member Functions

 FunctorFilter (bool extract_removed_indices=false)
 ctor to be used by derived classes with member function as FilterFunction More...
 
void setFunctionObject (FunctionObjectT function_object) const noexcept
 utility function for derived class More...
 
- Protected Member Functions inherited from pcl::FilterIndices< PointT >
void applyFilter (PointCloud &output) override
 Abstract filter method for point cloud. More...
 
- Protected Member Functions inherited from pcl::Filter< PointT >
const std::string & getClassName () const
 Get a string representation of the name of this class. More...
 
- Protected Member Functions inherited from pcl::PCLBase< PointT >
bool initCompute ()
 This method should get called before starting the actual computation. More...
 
bool deinitCompute ()
 This method should get called after finishing the actual computation. More...
 

Protected Attributes

bool negative_
 False = normal filter behavior (default), true = inverted behavior. More...
 
IndicesPtr indices_
 A pointer to the vector of point indices to use. More...
 
PointCloudConstPtr input_
 The input point cloud dataset. More...
 
- Protected Attributes inherited from pcl::FilterIndices< PointT >
bool negative_
 False = normal filter behavior (default), true = inverted behavior. More...
 
bool keep_organized_
 False = remove points (default), true = redefine points, keep structure. More...
 
float user_filter_value_
 The user given value that the filtered point dimensions should be set to (default = NaN). More...
 
- Protected Attributes inherited from pcl::Filter< PointT >
IndicesPtr removed_indices_
 Indices of the points that are removed. More...
 
std::string filter_name_
 The filter name. More...
 
bool extract_removed_indices_
 Set to true if we want to return the indices of the removed points. More...
 
- Protected Attributes inherited from pcl::PCLBase< PointT >
PointCloudConstPtr input_
 The input point cloud dataset. More...
 
IndicesPtr indices_
 A pointer to the vector of point indices to use. More...
 
bool use_indices_
 Set to true if point indices are used. More...
 
bool fake_indices_
 If no set of indices are given, we construct a set of fake indices that mimic the input PointCloud. More...
 

Detailed Description

template<typename PointT, typename FunctionObject>
class pcl::experimental::advanced::FunctorFilter< PointT, FunctionObject >

Filter point clouds and indices based on a function object passed in the ctor.

The function object can be anything (lambda, std::function, invocable class, etc.) that can be moved into the class. Additionally, it must satisfy the condition is_function_object_for_filter_v

Definition at line 35 of file functor_filter.h.

Member Typedef Documentation

◆ FunctionObjectT

template<typename PointT , typename FunctionObject >
using pcl::experimental::advanced::FunctorFilter< PointT, FunctionObject >::FunctionObjectT = FunctionObject

Definition at line 40 of file functor_filter.h.

Constructor & Destructor Documentation

◆ FunctorFilter() [1/2]

template<typename PointT , typename FunctionObject >
pcl::experimental::advanced::FunctorFilter< PointT, FunctionObject >::FunctorFilter ( FunctionObjectT  function_object,
bool  extract_removed_indices = false 
)
inline

Constructor.

Parameters
[in]function_objectObject of effective type FilterFunction in order to filter out the indices for which it returns false
[in]extract_removed_indicesSet to true if you want to be able to extract the indices of points being removed (default = false).

Definition at line 65 of file functor_filter.h.

References pcl::Filter< PointT >::filter_name_.

◆ FunctorFilter() [2/2]

template<typename PointT , typename FunctionObject >
pcl::experimental::advanced::FunctorFilter< PointT, FunctionObject >::FunctorFilter ( bool  extract_removed_indices = false)
inlineprotected

ctor to be used by derived classes with member function as FilterFunction

Parameters
[in]extract_removed_indicesSet to true if you want to be able to extract the indices of points being removed (default = false).
Note
The class would be ill-defined until setFunctionObject has been called Do not call any filter routine until then

Definition at line 116 of file functor_filter.h.

References pcl::Filter< PointT >::filter_name_.

Member Function Documentation

◆ applyFilter()

template<typename PointT , typename FunctionObject >
void pcl::experimental::advanced::FunctorFilter< PointT, FunctionObject >::applyFilter ( Indices indices)
inlineoverridevirtual

Filtered results are indexed by an indices array.

Parameters
[out]indicesThe resultant indices.

Implements pcl::FilterIndices< PointT >.

Definition at line 88 of file functor_filter.h.

References pcl::Filter< PointT >::extract_removed_indices_, pcl::PCLBase< PointT >::indices_, pcl::PCLBase< PointT >::input_, pcl::FilterIndices< PointT >::negative_, and pcl::Filter< PointT >::removed_indices_.

◆ getFunctionObject() [1/2]

template<typename PointT , typename FunctionObject >
const FunctionObjectT& pcl::experimental::advanced::FunctorFilter< PointT, FunctionObject >::getFunctionObject ( ) const
inlinenoexcept

Definition at line 72 of file functor_filter.h.

◆ getFunctionObject() [2/2]

template<typename PointT , typename FunctionObject >
FunctionObjectT& pcl::experimental::advanced::FunctorFilter< PointT, FunctionObject >::getFunctionObject ( )
inlinenoexcept

Definition at line 78 of file functor_filter.h.

◆ setFunctionObject()

template<typename PointT , typename FunctionObject >
void pcl::experimental::advanced::FunctorFilter< PointT, FunctionObject >::setFunctionObject ( FunctionObjectT  function_object) const
inlineprotectednoexcept

utility function for derived class

Parameters
[in]function_objectObject of effective type FilterFunction in order to filter out the indices for which it returns false

Definition at line 127 of file functor_filter.h.

Member Data Documentation

◆ indices_

template<typename PointT , typename FunctionObject >
IndicesPtr pcl::PCLBase< PointT >::indices_
protected

A pointer to the vector of point indices to use.

Definition at line 150 of file pcl_base.h.

◆ input_

template<typename PointT , typename FunctionObject >
PointCloudConstPtr pcl::PCLBase< PointT >::input_
protected

The input point cloud dataset.

Definition at line 147 of file pcl_base.h.

◆ negative_

template<typename PointT , typename FunctionObject >
bool pcl::FilterIndices< PointT >::negative_
protected

False = normal filter behavior (default), true = inverted behavior.

Definition at line 168 of file filter_indices.h.


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