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>
bool extract_removed_indices_
Set to true if we want to return the indices of the removed points.
std::string filter_name_
The filter name.
IndicesPtr removed_indices_
Indices of the points that are removed.
FilterIndices represents the base class for filters that are about binary point removal.
bool negative_
False = normal filter behavior (default), true = inverted behavior.
PointCloudConstPtr input_
The input point cloud dataset.
IndicesPtr indices_
A pointer to the vector of point indices to use.
PointCloud represents the base class in PCL for storing collections of 3D points.
Filter point clouds and indices based on a function object passed in the ctor.
void applyFilter(Indices &indices) override
Filtered results are indexed by an indices array.
PointCloudConstPtr input_
The input point cloud dataset.
FunctorFilter(FunctionObjectT function_object, bool extract_removed_indices=false)
Constructor.
FunctorFilter(bool extract_removed_indices=false)
ctor to be used by derived classes with member function as FilterFunction
bool negative_
False = normal filter behavior (default), true = inverted behavior.
const FunctionObjectT & getFunctionObject() const noexcept
IndicesPtr indices_
A pointer to the vector of point indices to use.
void setFunctionObject(FunctionObjectT function_object) const noexcept
utility function for derived class
FunctionObjectT & getFunctionObject() noexcept
FunctionObject FunctionObjectT
std::function< bool(const PointCloud< PointT > &, index_t)> FilterFunction
constexpr static bool is_function_object_for_filter_v
Checks if the function object meets the usage in FunctorFilter class.
detail::int_type_t< detail::index_type_size, detail::index_type_signed > index_t
Type used for an index in PCL.
IndicesAllocator<> Indices
Type used for indices in PCL.