38 #ifndef PCL_FILTERS_IMPL_FILTER_INDICES_H_
39 #define PCL_FILTERS_IMPL_FILTER_INDICES_H_
42 #include <pcl/filters/filter_indices.h>
44 template <
typename Po
intT>
void
46 std::vector<int> &index)
49 index.resize (cloud_in.
points.size ());
54 for (
int j = 0; j < static_cast<int> (cloud_in.
points.size ()); ++j)
60 for (
int i = 0; i < static_cast<int> (cloud_in.
points.size ()); ++i)
62 if (!std::isfinite (cloud_in.
points[i].x) ||
63 !std::isfinite (cloud_in.
points[i].y) ||
64 !std::isfinite (cloud_in.
points[i].z))
69 if (j !=
static_cast<int> (cloud_in.
points.size ()))
77 template<
typename Po
intT>
void
80 std::vector<int> indices;
83 if (!extract_removed_indices_)
85 PCL_WARN (
"[pcl::FilterIndices<PointT>::applyFilter] extract_removed_indices_ was set to 'true' to keep the point cloud organized.\n");
86 extract_removed_indices_ =
true;
88 applyFilter (indices);
96 const PointXYZ ufv (user_filter_value_, user_filter_value_, user_filter_value_);
97 for (
const auto ri : *removed_indices_)
99 if (!std::isfinite (user_filter_value_))
105 applyFilter (indices);
111 #define PCL_INSTANTIATE_removeNanFromPointCloud(T) template PCL_EXPORTS void pcl::removeNaNFromPointCloud<T>(const pcl::PointCloud<T>&, std::vector<int>&);
112 #define PCL_INSTANTIATE_FilterIndices(T) template class PCL_EXPORTS pcl::FilterIndices<T>;
virtual void applyFilter(std::vector< int > &indices)=0
Abstract filter method for point cloud indices.
PointCloud represents the base class in PCL for storing collections of 3D points.
bool is_dense
True if no points are invalid (e.g., have NaN or Inf values in any of their floating point fields).
std::vector< PointT, Eigen::aligned_allocator< PointT > > points
The point data.
void copyPoint(const PointInT &point_in, PointOutT &point_out)
Copy the fields of a source point into a target point.
void copyPointCloud(const pcl::PointCloud< PointInT > &cloud_in, pcl::PointCloud< PointOutT > &cloud_out)
Copy all the fields from a given point cloud into a new point cloud.
void removeNaNFromPointCloud(const pcl::PointCloud< PointT > &cloud_in, pcl::PointCloud< PointT > &cloud_out, std::vector< int > &index)
Removes points with x, y, or z equal to NaN.
Defines all the PCL and non-PCL macros used.
A point structure representing Euclidean xyz coordinates.