40#ifndef PCL_FILTERS_IMPL_PASSTHROUGH_HPP_
41#define PCL_FILTERS_IMPL_PASSTHROUGH_HPP_
43#include <pcl/filters/passthrough.h>
46template <
typename Po
intT>
void
55 if (filter_field_name_.empty ())
61 if (!std::isfinite ((*
input_)[ii].x) ||
62 !std::isfinite ((*
input_)[ii].y) ||
63 !std::isfinite ((*
input_)[ii].z))
66 (*removed_indices_)[rii++] = ii;
75 std::vector<pcl::PCLPointField>
fields;
77 if (distance_idx == -1)
79 PCL_WARN (
"[pcl::%s::applyFilter] Unable to find field name in point type.\n",
getClassName ().c_str ());
89 if (!std::isfinite ((*
input_)[ii].x) ||
90 !std::isfinite ((*
input_)[ii].y) ||
91 !std::isfinite ((*
input_)[ii].z))
94 (*removed_indices_)[rii++] = ii;
99 const std::uint8_t* pt_data =
reinterpret_cast<const std::uint8_t*
> (&(*input_)[ii]);
100 float field_value = 0;
101 memcpy (&field_value, pt_data +
fields[distance_idx].offset,
sizeof (
float));
104 if (!std::isfinite (field_value))
107 (*removed_indices_)[rii++] = ii;
112 if (!
negative_ && (field_value < filter_limit_min_ || field_value > filter_limit_max_))
115 (*removed_indices_)[rii++] = ii;
120 if (
negative_ && field_value >= filter_limit_min_ && field_value <= filter_limit_max_)
123 (*removed_indices_)[rii++] = ii;
133 indices.resize (oii);
137#define PCL_INSTANTIATE_PassThrough(T) template class PCL_EXPORTS pcl::PassThrough<T>;
bool extract_removed_indices_
Set to true if we want to return the indices of the removed points.
const std::string & getClassName() const
Get a string representation of the name of this class.
IndicesPtr removed_indices_
Indices of the points that are removed.
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.
void applyFilterIndices(Indices &indices)
Filtered results are indexed by an indices array.
int getFieldIndex(const pcl::PointCloud< PointT > &, const std::string &field_name, std::vector< pcl::PCLPointField > &fields)
IndicesAllocator<> Indices
Type used for indices in PCL.