12 #include <pcl/filters/filter_indices.h>
13 #include <pcl/type_traits.h>
16 namespace experimental {
22 template <
typename Po
intT,
typename Function>
24 is_invocable_r_v<bool, Function, const PointCloud<PointT>&,
index_t>;
34 template <
typename Po
intT,
typename FunctionObject>
42 static_assert(is_function_object_for_filter_v<PointT, FunctionObjectT>,
43 "Function object signature must be similar to `bool(const "
44 "PointCloud<PointT>&, index_t)`");
66 :
Base(extract_removed_indices), functionObject_(std::move(function_object))
74 return functionObject_;
80 return functionObject_;
100 indices.push_back(index);
129 functionObject_ = std::move(function_object);
134 template <
class Po
intT>
137 template <
class Po
intT>
FunctorFilter(bool extract_removed_indices=false)
ctor to be used by derived classes with member function as FilterFunction
FunctionObjectT & getFunctionObject() noexcept
FunctionObject FunctionObjectT
IndicesPtr indices_
A pointer to the vector of point indices to use.
detail::int_type_t< detail::index_type_size, detail::index_type_signed > index_t
Type used for an index in PCL.
bool negative_
False = normal filter behavior (default), true = inverted behavior.
std::function< bool(const PointCloud< PointT > &, index_t)> FilterFunction
FilterIndices represents the base class for filters that are about binary point removal.
void applyFilter(Indices &indices) override
Filtered results are indexed by an indices array.
IndicesPtr removed_indices_
Indices of the points that are removed.
static constexpr bool is_function_object_for_filter_v
Checks if the function object meets the usage in FunctorFilter class.
const FunctionObjectT & getFunctionObject() const noexcept
void setFunctionObject(FunctionObjectT function_object) const noexcept
utility function for derived class
IndicesAllocator<> Indices
Type used for indices in PCL.
bool extract_removed_indices_
Set to true if we want to return the indices of the removed points.
PointCloudConstPtr input_
The input point cloud dataset.
std::string filter_name_
The filter name.
FunctorFilter(FunctionObjectT function_object, bool extract_removed_indices=false)
Constructor.
Filter point clouds and indices based on a function object passed in the ctor.