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
62 if (!container_.empty ())
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++)
69 const PointT& p = container_[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
88 container_.insert (container_.end (), start, start + count);
93 template<
typename Po
intT>
void
98 for (std::uint64_t i = 0; i < count; i++)
102 container_.insert (container_.end (), temp.begin (), temp.end ());
107 template<
typename Po
intT>
void
112 std::copy(container_.cbegin() + start, container_.cbegin() + start + count, v.begin());
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_);
132 v.push_back (container_[buffstart]);
void readRange(const std::uint64_t start, const std::uint64_t count, AlignedPointTVector &v)
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
A point structure representing Euclidean xyz coordinates, and the RGB color.