Skip to content

Commit

Permalink
Allow file_io to read large point clouds depending on PCL config (#4331)
Browse files Browse the repository at this point in the history
Changed unsigned int point_index to std::size_t point_index to enable pcl::PCLPointCloud2 types with more than 2^28 points to be read and saved in ASCII format. Issues still persist with reading and saving in binary format and conversion to  pcl::PointCloud<T> types. Related to issue #4326
  • Loading branch information
mudskipper75 authored Aug 18, 2020
1 parent 809ef27 commit 60a50bc
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions io/include/pcl/io/file_io.h
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ namespace pcl
template <typename Type> inline
std::enable_if_t<std::is_floating_point<Type>::value>
copyValueString (const pcl::PCLPointCloud2 &cloud,
const unsigned int point_index,
const pcl::index_t point_index,
const int point_size,
const unsigned int field_idx,
const unsigned int fields_count,
Expand All @@ -251,7 +251,7 @@ namespace pcl
template <typename Type> inline
std::enable_if_t<std::is_integral<Type>::value>
copyValueString (const pcl::PCLPointCloud2 &cloud,
const unsigned int point_index,
const pcl::index_t point_index,
const int point_size,
const unsigned int field_idx,
const unsigned int fields_count,
Expand All @@ -264,7 +264,7 @@ namespace pcl

template <> inline void
copyValueString<std::int8_t> (const pcl::PCLPointCloud2 &cloud,
const unsigned int point_index,
const pcl::index_t point_index,
const int point_size,
const unsigned int field_idx,
const unsigned int fields_count,
Expand All @@ -278,7 +278,7 @@ namespace pcl

template <> inline void
copyValueString<std::uint8_t> (const pcl::PCLPointCloud2 &cloud,
const unsigned int point_index,
const pcl::index_t point_index,
const int point_size,
const unsigned int field_idx,
const unsigned int fields_count,
Expand All @@ -303,7 +303,7 @@ namespace pcl
template <typename Type> inline
std::enable_if_t<std::is_floating_point<Type>::value, bool>
isValueFinite (const pcl::PCLPointCloud2 &cloud,
const unsigned int point_index,
const pcl::index_t point_index,
const int point_size,
const unsigned int field_idx,
const unsigned int fields_count)
Expand All @@ -316,7 +316,7 @@ namespace pcl
template <typename Type> inline
std::enable_if_t<std::is_integral<Type>::value, bool>
isValueFinite (const pcl::PCLPointCloud2& /* cloud */,
const unsigned int /* point_index */,
const pcl::index_t /* point_index */,
const int /* point_size */,
const unsigned int /* field_idx */,
const unsigned int /* fields_count */)
Expand All @@ -337,7 +337,7 @@ namespace pcl
*/
template <typename Type> inline void
copyStringValue (const std::string &st, pcl::PCLPointCloud2 &cloud,
unsigned int point_index, unsigned int field_idx, unsigned int fields_count)
pcl::index_t point_index, unsigned int field_idx, unsigned int fields_count)
{
Type value;
if (boost::iequals(st, "nan"))
Expand All @@ -360,7 +360,7 @@ namespace pcl

template <> inline void
copyStringValue<std::int8_t> (const std::string &st, pcl::PCLPointCloud2 &cloud,
unsigned int point_index, unsigned int field_idx, unsigned int fields_count)
pcl::index_t point_index, unsigned int field_idx, unsigned int fields_count)
{
std::int8_t value;
if (boost::iequals(st, "nan"))
Expand All @@ -386,7 +386,7 @@ namespace pcl

template <> inline void
copyStringValue<std::uint8_t> (const std::string &st, pcl::PCLPointCloud2 &cloud,
unsigned int point_index, unsigned int field_idx, unsigned int fields_count)
pcl::index_t point_index, unsigned int field_idx, unsigned int fields_count)
{
std::uint8_t value;
if (boost::iequals(st, "nan"))
Expand Down

0 comments on commit 60a50bc

Please sign in to comment.