40#ifndef PCL_OUTOFCORE_RAM_CONTAINER_IMPL_H_
41#define PCL_OUTOFCORE_RAM_CONTAINER_IMPL_H_
47#include <pcl/outofcore/octree_ram_container.h>
53 template<
typename Po
intT>
56 template<
typename Po
intT>
59 template<
typename Po
intT>
void
64 FILE* fxyz = fopen (path.string ().c_str (),
"we");
66 std::uint64_t num =
size ();
67 for (std::uint64_t i = 0; i < num; i++)
74 ss << p.x <<
"\t" << p.y <<
"\t" << p.z <<
"\n";
76 fwrite (ss.str ().c_str (), 1, ss.str ().size (), fxyz);
79 assert ( fclose (fxyz) == 0 );
85 template<
typename Po
intT>
void
93 template<
typename Po
intT>
void
98 for (std::uint64_t i = 0; i < count; i++)
107 template<
typename Po
intT>
void
117 template<
typename Po
intT>
void
119 const std::uint64_t count,
120 const double percent,
123 auto samplesize =
static_cast<std::uint64_t
> (percent *
static_cast<double> (count));
125 std::lock_guard<std::mutex> lock (
rng_mutex_);
127 std::uniform_int_distribution < std::uint64_t > buffdist (start, start + count);
129 for (std::uint64_t i = 0; i < samplesize; i++)
131 std::uint64_t buffstart = buffdist (
rng_);
std::uint64_t size() const
returns the size of the vector of points stored in this class
void readRange(const std::uint64_t start, const std::uint64_t count, AlignedPointTVector &v)
AlignedPointTVector container_
linear container to hold the points
void convertToXYZ(const boost::filesystem::path &path)
Writes ascii x,y,z point data to path.string().c_str().
void readRangeSubSample(const std::uint64_t start, const std::uint64_t count, const double percent, AlignedPointTVector &v)
grab percent*count random points.
void insertRange(const PointT *start, const std::uint64_t count)
inserts count number of points into container; uses the container_ type's insert function
static std::mutex rng_mutex_
typename OutofcoreAbstractNodeContainer< PointT >::AlignedPointTVector AlignedPointTVector