40#ifndef PCL_FILTERS_IMPL_EXTRACT_INDICES_HPP_
41#define PCL_FILTERS_IMPL_EXTRACT_INDICES_HPP_
43#include <pcl/filters/extract_indices.h>
47template <
typename Po
intT>
void
51 bool temp = extract_removed_indices_;
52 extract_removed_indices_ =
true;
53 this->setInputCloud (cloud);
54 applyFilterIndices (indices);
55 extract_removed_indices_ =
temp;
57 std::vector<pcl::PCLPointField> fields;
59 for (
const auto&
rii : (*removed_indices_))
64 PCL_ERROR (
"[pcl::%s::filterDirectly] The index exceeds the size of the input. Do nothing.\n",
65 getClassName ().
c_str ());
69 std::uint8_t*
pt_data =
reinterpret_cast<std::uint8_t*
> (&(*cloud)[
pt_index]);
70 for (
const auto &
field : fields)
73 if (!std::isfinite (user_filter_value_))
74 cloud->is_dense =
false;
78template <
typename Po
intT>
void
84 bool temp = extract_removed_indices_;
85 extract_removed_indices_ =
true;
86 applyFilterIndices (indices);
87 extract_removed_indices_ =
temp;
90 std::vector<pcl::PCLPointField> fields;
92 for (
const auto ri : *removed_indices_)
97 PCL_ERROR (
"[pcl::%s::applyFilter] The index exceeds the size of the input. Do nothing.\n",
98 getClassName ().
c_str ());
103 for (
const auto &
field : fields)
106 if (!std::isfinite (user_filter_value_))
111 applyFilterIndices (indices);
117template <
typename Po
intT>
void
120 if (indices_->size () > input_->size ())
122 PCL_ERROR (
"[pcl::%s::applyFilter] The indices size exceeds the size of the input.\n", getClassName ().
c_str ());
124 removed_indices_->clear ();
132 if (extract_removed_indices_)
143 removed_indices_->clear ();
161 if (extract_removed_indices_)
162 removed_indices_ = indices_;
166#define PCL_INSTANTIATE_ExtractIndices(T) template class PCL_EXPORTS pcl::ExtractIndices<T>;
Iterator class for point clouds with or without given indices.
ConstCloudIterator(const PointCloud< PointT > &cloud)
std::size_t size() const
Size of the range the iterator is going through.
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.
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.
detail::int_type_t< detail::index_type_size, false > uindex_t
Type used for an unsigned index in PCL.