Point Cloud Library (PCL)
1.7.1
|
Class responsible for serialization and deserialization of out of core point data. More...
#include <pcl/outofcore/octree_disk_container.h>
Public Types | |
typedef OutofcoreAbstractNodeContainer < PointT > ::AlignedPointTVector | AlignedPointTVector |
![]() | |
typedef std::vector< PointT, Eigen::aligned_allocator < PointT > > | AlignedPointTVector |
Public Member Functions | |
OutofcoreOctreeDiskContainer () | |
Empty constructor creates disk container and sets filename from random uuid string. More... | |
OutofcoreOctreeDiskContainer (const boost::filesystem::path &dir) | |
Creates uuid named file or loads existing file. More... | |
~OutofcoreOctreeDiskContainer () | |
flushes write buffer, then frees memory More... | |
PointT | operator[] (uint64_t idx) const |
provides random access to points based on a linear index More... | |
void | push_back (const PointT &p) |
Adds a single point to the buffer to be written to disk when the buffer grows sufficiently large, the object is destroyed, or the write buffer is manually flushed. More... | |
void | insertRange (const AlignedPointTVector &src) |
Inserts a vector of points into the disk data structure. More... | |
void | insertRange (const pcl::PCLPointCloud2::Ptr &input_cloud) |
Inserts a PCLPointCloud2 object directly into the disk container. More... | |
void | insertRange (const PointT *const *start, const uint64_t count) |
void | insertRange (const PointT *start, const uint64_t count) |
This is the primary method for serialization of blocks of point data. More... | |
void | readRange (const uint64_t start, const uint64_t count, AlignedPointTVector &dst) |
Reads count points into memory from the disk container. More... | |
void | readRange (const uint64_t, const uint64_t, pcl::PCLPointCloud2::Ptr &dst) |
int | read (pcl::PCLPointCloud2::Ptr &output_cloud) |
Reads the entire point contents from disk into output_cloud. More... | |
void | readRangeSubSample (const uint64_t start, const uint64_t count, const double percent, AlignedPointTVector &dst) |
grab percent*count random points. More... | |
void | readRangeSubSample_bernoulli (const uint64_t start, const uint64_t count, const double percent, AlignedPointTVector &dst) |
Use bernoulli trials to select points. More... | |
uint64_t | size () const |
Returns the total number of points for which this container is responsible, filelen_ + points in writebuff_ that have not yet been flushed to the disk. More... | |
bool | empty () const |
STL-like empty test. More... | |
void | flush (const bool force_cache_dealloc) |
Exposed functionality for manually flushing the write buffer during tree creation. More... | |
std::string & | path () |
Returns this objects path name. More... | |
void | clear () |
void | convertToXYZ (const boost::filesystem::path &path) |
write points to disk as ascii More... | |
boost::uint64_t | getDataSize () const |
Returns the number of points in the PCD file by reading the PCD header. More... | |
![]() | |
OutofcoreAbstractNodeContainer () | |
OutofcoreAbstractNodeContainer (const boost::filesystem::path &) | |
virtual | ~OutofcoreAbstractNodeContainer () |
Static Public Member Functions | |
static void | getRandomUUIDString (std::string &s) |
Generate a universally unique identifier (UUID) More... | |
Additional Inherited Members | |
![]() | |
OutofcoreAbstractNodeContainer (const OutofcoreAbstractNodeContainer &rval) | |
![]() | |
AlignedPointTVector | container_ |
![]() | |
static boost::mutex | rng_mutex_ |
static boost::mt19937 | rand_gen_ |
Class responsible for serialization and deserialization of out of core point data.
Definition at line 73 of file octree_disk_container.h.
typedef OutofcoreAbstractNodeContainer<PointT>::AlignedPointTVector pcl::outofcore::OutofcoreOctreeDiskContainer< PointT >::AlignedPointTVector |
Definition at line 77 of file octree_disk_container.h.
pcl::outofcore::OutofcoreOctreeDiskContainer< PointT >::OutofcoreOctreeDiskContainer | ( | ) |
Empty constructor creates disk container and sets filename from random uuid string.
Definition at line 100 of file octree_disk_container.hpp.
References pcl::outofcore::OutofcoreOctreeDiskContainer< PointT >::getRandomUUIDString().
pcl::outofcore::OutofcoreOctreeDiskContainer< PointT >::OutofcoreOctreeDiskContainer | ( | const boost::filesystem::path & | dir | ) |
Creates uuid named file or loads existing file.
If dir is a directory, this constructor will create a new uuid named file; if dir is an existing file, it will load the file metadata for accessing the tree.
[in] | dir | Path to the tree. If it is a directory, it will create the metadata. If it is a file, it will load the metadata into memory. |
Definition at line 113 of file octree_disk_container.hpp.
References pcl::outofcore::OutofcoreOctreeDiskContainer< PointT >::getRandomUUIDString(), pcl::PCLPointCloud2::height, pcl::PCDReader::readHeader(), and pcl::PCLPointCloud2::width.
pcl::outofcore::OutofcoreOctreeDiskContainer< PointT >::~OutofcoreOctreeDiskContainer | ( | ) |
flushes write buffer, then frees memory
Definition at line 160 of file octree_disk_container.hpp.
|
inlinevirtual |
Implements pcl::outofcore::OutofcoreAbstractNodeContainer< PointT >.
Definition at line 205 of file octree_disk_container.h.
|
inlinevirtual |
write points to disk as ascii
[in] | path |
Implements pcl::outofcore::OutofcoreAbstractNodeContainer< PointT >.
Definition at line 221 of file octree_disk_container.h.
References pcl::outofcore::OutofcoreOctreeDiskContainer< PointT >::size().
|
inlinevirtual |
STL-like empty test.
Implements pcl::outofcore::OutofcoreAbstractNodeContainer< PointT >.
Definition at line 185 of file octree_disk_container.h.
|
inline |
Exposed functionality for manually flushing the write buffer during tree creation.
Definition at line 192 of file octree_disk_container.h.
boost::uint64_t pcl::outofcore::OutofcoreOctreeDiskContainer< PointT >::getDataSize | ( | ) | const |
Returns the number of points in the PCD file by reading the PCD header.
Definition at line 673 of file octree_disk_container.hpp.
References pcl::PCLPointCloud2::height, pcl::PCDReader::readHeader(), and pcl::PCLPointCloud2::width.
|
static |
Generate a universally unique identifier (UUID)
A mutex lock happens to ensure uniquness
Definition at line 85 of file octree_disk_container.hpp.
Referenced by pcl::outofcore::OutofcoreOctreeBaseNode< ContainerT, PointT >::init_root_node(), pcl::outofcore::OutofcoreOctreeBaseNode< ContainerT, PointT >::OutofcoreOctreeBaseNode(), and pcl::outofcore::OutofcoreOctreeDiskContainer< PointT >::OutofcoreOctreeDiskContainer().
void pcl::outofcore::OutofcoreOctreeDiskContainer< PointT >::insertRange | ( | const AlignedPointTVector & | src | ) |
Inserts a vector of points into the disk data structure.
Definition at line 467 of file octree_disk_container.hpp.
References pcl::PointCloud< PointT >::height, pcl::PointCloud< PointT >::points, pcl::PCDReader::read(), pcl::PointCloud< PointT >::width, and pcl::PCDWriter::writeBinaryCompressed().
void pcl::outofcore::OutofcoreOctreeDiskContainer< PointT >::insertRange | ( | const pcl::PCLPointCloud2::Ptr & | input_cloud | ) |
Inserts a PCLPointCloud2 object directly into the disk container.
Definition at line 512 of file octree_disk_container.hpp.
References pcl::concatenatePointCloud(), pcl::PCDReader::read(), and pcl::PCDWriter::writeBinaryCompressed().
|
virtual |
Implements pcl::outofcore::OutofcoreAbstractNodeContainer< PointT >.
Definition at line 610 of file octree_disk_container.hpp.
|
virtual |
This is the primary method for serialization of blocks of point data.
This is called by the outofcore octree interface, opens the binary file for appending data, and writes it to disk.
[in] | start | address of the first point to insert |
[in] | count | offset from start of the last point to insert |
Implements pcl::outofcore::OutofcoreAbstractNodeContainer< PointT >.
Definition at line 629 of file octree_disk_container.hpp.
References pcl::PointCloud< PointT >::height, pcl::PointCloud< PointT >::points, pcl::PCDReader::read(), pcl::PointCloud< PointT >::width, and pcl::PCDWriter::writeBinaryCompressed().
|
inlinevirtual |
provides random access to points based on a linear index
Implements pcl::outofcore::OutofcoreAbstractNodeContainer< PointT >.
Definition at line 198 of file octree_disk_container.hpp.
|
inline |
Returns this objects path name.
Definition at line 199 of file octree_disk_container.h.
|
inline |
Adds a single point to the buffer to be written to disk when the buffer grows sufficiently large, the object is destroyed, or the write buffer is manually flushed.
Definition at line 456 of file octree_disk_container.hpp.
int pcl::outofcore::OutofcoreOctreeDiskContainer< PointT >::read | ( | pcl::PCLPointCloud2::Ptr & | output_cloud | ) |
Reads the entire point contents from disk into output_cloud.
[out] | output_cloud |
Definition at line 577 of file octree_disk_container.hpp.
References pcl::concatenatePointCloud(), and pcl::io::loadPCDFile().
|
virtual |
Reads count points into memory from the disk container.
Reads count points into memory from the disk container, reading at most 2 million elements at a time
[in] | start | index of first point to read from disk |
[in] | count | offset of last point to read from disk |
[out] | v | std::vector as destination for points read from disk into memory |
Implements pcl::outofcore::OutofcoreAbstractNodeContainer< PointT >.
Definition at line 239 of file octree_disk_container.hpp.
References pcl::PointCloud< PointT >::points, and pcl::PCDReader::read().
void pcl::outofcore::OutofcoreOctreeDiskContainer< PointT >::readRange | ( | const uint64_t | , |
const uint64_t | , | ||
pcl::PCLPointCloud2::Ptr & | dst | ||
) |
Definition at line 553 of file octree_disk_container.hpp.
References pcl::PCDReader::read().
|
virtual |
grab percent*count random points.
points are not guaranteed to be unique (could have multiple identical points!)
[in] | start | The starting index of points to select |
count[in] | The length of the range of points from which to randomly sample (i.e. from start to start+count) | |
percent[in] | The percentage of count that is enough points to make up this random sample | |
dst[out] | std::vector as destination for randomly sampled points; size will be percentage*count |
Implements pcl::outofcore::OutofcoreAbstractNodeContainer< PointT >.
Definition at line 359 of file octree_disk_container.hpp.
References pcl::outofcore::rand_gen_.
void pcl::outofcore::OutofcoreOctreeDiskContainer< PointT >::readRangeSubSample_bernoulli | ( | const uint64_t | start, |
const uint64_t | count, | ||
const double | percent, | ||
AlignedPointTVector & | dst | ||
) |
Use bernoulli trials to select points.
All points selected will be unique.
[in] | start | The starting index of points to select |
[in] | count | The length of the range of points from which to randomly sample (i.e. from start to start+count) |
[in] | percent | The percentage of count that is enough points to make up this random sample |
[out] | dst | std::vector as destination for randomly sampled points; size will be percentage*count |
Definition at line 266 of file octree_disk_container.hpp.
References pcl::outofcore::rand_gen_.
|
inlinevirtual |
Returns the total number of points for which this container is responsible, filelen_ + points in writebuff_ that have not yet been flushed to the disk.
Implements pcl::outofcore::OutofcoreAbstractNodeContainer< PointT >.
Definition at line 177 of file octree_disk_container.h.
Referenced by pcl::outofcore::OutofcoreOctreeDiskContainer< PointT >::convertToXYZ().