Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes
pcl::outofcore::OutofcoreOctreeDiskContainer< PointT > Class Template Reference

Class responsible for serialization and deserialization of out of core point data. More...

#include <octree_disk_container.h>

Inheritance diagram for pcl::outofcore::OutofcoreOctreeDiskContainer< PointT >:
Inheritance graph
[legend]

List of all members.

Public Types

typedef
OutofcoreAbstractNodeContainer
< PointT >
::AlignedPointTVector 
AlignedPointTVector

Public Member Functions

void clear ()
void convertToXYZ (const boost::filesystem::path &path)
 write points to disk as ascii
bool empty () const
 STL-like empty test.
void flush (const bool force_cache_dealloc)
 Exposed functionality for manually flushing the write buffer during tree creation.
boost::uint64_t getDataSize () const
 Returns the number of points in the PCD file by reading the PCD header.
void insertRange (const AlignedPointTVector &src)
 Inserts a vector of points into the disk data structure.
void insertRange (const pcl::PCLPointCloud2::Ptr &input_cloud)
 Inserts a PCLPointCloud2 object directly into the disk container.
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. This is called by the outofcore octree interface, opens the binary file for appending data, and writes it to disk.
PointT operator[] (uint64_t idx) const
 provides random access to points based on a linear index
 OutofcoreOctreeDiskContainer ()
 Empty constructor creates disk container and sets filename from random uuid string.
 OutofcoreOctreeDiskContainer (const boost::filesystem::path &dir)
 Creates uuid named file or loads existing file.
std::stringpath ()
 Returns this objects path name.
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.
int read (pcl::PCLPointCloud2::Ptr &output_cloud)
 Reads the entire point contents from disk into output_cloud.
void readRange (const uint64_t start, const uint64_t count, AlignedPointTVector &dst)
 Reads count points into memory from the disk container.
void readRange (const uint64_t, const uint64_t, pcl::PCLPointCloud2::Ptr &dst)
void readRangeSubSample (const uint64_t start, const uint64_t count, const double percent, AlignedPointTVector &dst)
 grab percent*count random points. points are not guaranteed to be unique (could have multiple identical points!)
void 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.
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.
 ~OutofcoreOctreeDiskContainer ()
 flushes write buffer, then frees memory

Static Public Member Functions

static void getRandomUUIDString (std::string &s)
 Generate a universally unique identifier (UUID)

Private Member Functions

void flushWritebuff (const bool force_cache_dealloc)
OutofcoreOctreeDiskContaineroperator= (const OutofcoreOctreeDiskContainer &rval)
 OutofcoreOctreeDiskContainer (const OutofcoreOctreeDiskContainer &rval)

Private Attributes

boost::shared_ptr< std::stringdisk_storage_filename_
 Name of the storage file on disk (i.e., the PCD file)
uint64_t filelen_
AlignedPointTVector writebuff_
 elements [0,...,size()-1] map to [filelen, ..., filelen + size()-1]

Static Private Attributes

static boost::mt19937 rand_gen_
static const uint64_t READ_BLOCK_SIZE_ = static_cast<uint64_t> (2e12)
static boost::mutex rng_mutex_
static
boost::uuids::random_generator 
uuid_gen_
static const uint64_t WRITE_BUFF_MAX_ = static_cast<uint64_t> (2e12)

Detailed Description

template<typename PointT = pcl::PointXYZ>
class pcl::outofcore::OutofcoreOctreeDiskContainer< PointT >

Class responsible for serialization and deserialization of out of core point data.

Note:
Code was adapted from the Urban Robotics out of core octree implementation. Contact Jacob Schloss <jacob.schloss@urbanrobotics.net> with any questions. http://www.urbanrobotics.net/
Author:
Jacob Schloss (jacob.schloss@urbanrobotics.net)

Definition at line 73 of file octree_disk_container.h.


Member Typedef Documentation


Constructor & Destructor Documentation

Empty constructor creates disk container and sets filename from random uuid string.

Definition at line 100 of file octree_disk_container.hpp.

template<typename PointT >
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.

Parameters:
[in]dirPath 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.

flushes write buffer, then frees memory

Definition at line 160 of file octree_disk_container.hpp.

template<typename PointT = pcl::PointXYZ>
pcl::outofcore::OutofcoreOctreeDiskContainer< PointT >::OutofcoreOctreeDiskContainer ( const OutofcoreOctreeDiskContainer< PointT > &  rval) [inline, private]

Definition at line 273 of file octree_disk_container.h.


Member Function Documentation

template<typename PointT = pcl::PointXYZ>
void pcl::outofcore::OutofcoreOctreeDiskContainer< PointT >::clear ( ) [inline, virtual]
template<typename PointT = pcl::PointXYZ>
void pcl::outofcore::OutofcoreOctreeDiskContainer< PointT >::convertToXYZ ( const boost::filesystem::path &  path) [inline, virtual]

write points to disk as ascii

Parameters:
[in]path

Implements pcl::outofcore::OutofcoreAbstractNodeContainer< PointT >.

Definition at line 221 of file octree_disk_container.h.

template<typename PointT = pcl::PointXYZ>
bool pcl::outofcore::OutofcoreOctreeDiskContainer< PointT >::empty ( ) const [inline, virtual]

STL-like empty test.

Returns:
true if container has no data on disk or waiting to be written in writebuff_

Implements pcl::outofcore::OutofcoreAbstractNodeContainer< PointT >.

Definition at line 185 of file octree_disk_container.h.

template<typename PointT = pcl::PointXYZ>
void pcl::outofcore::OutofcoreOctreeDiskContainer< PointT >::flush ( const bool  force_cache_dealloc) [inline]

Exposed functionality for manually flushing the write buffer during tree creation.

Definition at line 192 of file octree_disk_container.h.

template<typename PointT >
void pcl::outofcore::OutofcoreOctreeDiskContainer< PointT >::flushWritebuff ( const bool  force_cache_dealloc) [private]

Definition at line 167 of file octree_disk_container.hpp.

template<typename PointT >
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.

template<typename PointT >
void pcl::outofcore::OutofcoreOctreeDiskContainer< PointT >::getRandomUUIDString ( std::string s) [static]

Generate a universally unique identifier (UUID)

A mutex lock happens to ensure uniquness

Definition at line 85 of file octree_disk_container.hpp.

template<typename PointT >
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.

template<typename PointT >
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.

template<typename PointT >
void pcl::outofcore::OutofcoreOctreeDiskContainer< PointT >::insertRange ( const PointT *const *  start,
const uint64_t  count 
) [virtual]
template<typename PointT >
void pcl::outofcore::OutofcoreOctreeDiskContainer< PointT >::insertRange ( const PointT start,
const uint64_t  count 
) [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.

Parameters:
[in]startaddress of the first point to insert
[in]countoffset from start of the last point to insert

Implements pcl::outofcore::OutofcoreAbstractNodeContainer< PointT >.

Definition at line 629 of file octree_disk_container.hpp.

template<typename PointT = pcl::PointXYZ>
OutofcoreOctreeDiskContainer& pcl::outofcore::OutofcoreOctreeDiskContainer< PointT >::operator= ( const OutofcoreOctreeDiskContainer< PointT > &  rval) [inline, private]

Definition at line 277 of file octree_disk_container.h.

template<typename PointT >
PointT pcl::outofcore::OutofcoreOctreeDiskContainer< PointT >::operator[] ( uint64_t  idx) const [inline, virtual]

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.

template<typename PointT = pcl::PointXYZ>
std::string& pcl::outofcore::OutofcoreOctreeDiskContainer< PointT >::path ( ) [inline]

Returns this objects path name.

Definition at line 199 of file octree_disk_container.h.

template<typename PointT >
void pcl::outofcore::OutofcoreOctreeDiskContainer< PointT >::push_back ( const PointT p) [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.

template<typename PointT >
int pcl::outofcore::OutofcoreOctreeDiskContainer< PointT >::read ( pcl::PCLPointCloud2::Ptr output_cloud)

Reads the entire point contents from disk into output_cloud.

Parameters:
[out]output_cloud

Definition at line 577 of file octree_disk_container.hpp.

template<typename PointT >
void pcl::outofcore::OutofcoreOctreeDiskContainer< PointT >::readRange ( const uint64_t  start,
const uint64_t  count,
AlignedPointTVector dst 
) [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

Parameters:
[in]startindex of first point to read from disk
[in]countoffset of last point to read from disk
[out]vstd::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.

template<typename PointT >
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.

template<typename PointT >
void pcl::outofcore::OutofcoreOctreeDiskContainer< PointT >::readRangeSubSample ( const uint64_t  start,
const uint64_t  count,
const double  percent,
AlignedPointTVector dst 
) [virtual]

grab percent*count random points. points are not guaranteed to be unique (could have multiple identical points!)

Parameters:
[in]startThe 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.

template<typename PointT >
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.

Parameters:
[in]startThe starting index of points to select
[in]countThe length of the range of points from which to randomly sample (i.e. from start to start+count)
[in]percentThe percentage of count that is enough points to make up this random sample
[out]dststd::vector as destination for randomly sampled points; size will be percentage*count

Definition at line 266 of file octree_disk_container.hpp.

template<typename PointT = pcl::PointXYZ>
uint64_t pcl::outofcore::OutofcoreOctreeDiskContainer< PointT >::size ( ) const [inline, virtual]

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.


Member Data Documentation

template<typename PointT = pcl::PointXYZ>
boost::shared_ptr<std::string> pcl::outofcore::OutofcoreOctreeDiskContainer< PointT >::disk_storage_filename_ [private]

Name of the storage file on disk (i.e., the PCD file)

Definition at line 283 of file octree_disk_container.h.

template<typename PointT = pcl::PointXYZ>
uint64_t pcl::outofcore::OutofcoreOctreeDiskContainer< PointT >::filelen_ [private]

Definition at line 288 of file octree_disk_container.h.

template<typename PointT = pcl::PointXYZ>
boost::mt19937 pcl::outofcore::OutofcoreOctreeDiskContainer< PointT >::rand_gen_ [static, private]
template<typename PointT = pcl::PointXYZ>
const uint64_t pcl::outofcore::OutofcoreOctreeDiskContainer< PointT >::READ_BLOCK_SIZE_ = static_cast<uint64_t> (2e12) [static, private]

Definition at line 293 of file octree_disk_container.h.

template<typename PointT = pcl::PointXYZ>
boost::mutex pcl::outofcore::OutofcoreOctreeDiskContainer< PointT >::rng_mutex_ [static, private]
template<typename PointT = pcl::PointXYZ>
boost::uuids::random_generator pcl::outofcore::OutofcoreOctreeDiskContainer< PointT >::uuid_gen_ [static, private]

Definition at line 299 of file octree_disk_container.h.

template<typename PointT = pcl::PointXYZ>
const uint64_t pcl::outofcore::OutofcoreOctreeDiskContainer< PointT >::WRITE_BUFF_MAX_ = static_cast<uint64_t> (2e12) [static, private]

Definition at line 295 of file octree_disk_container.h.

template<typename PointT = pcl::PointXYZ>
AlignedPointTVector pcl::outofcore::OutofcoreOctreeDiskContainer< PointT >::writebuff_ [private]

elements [0,...,size()-1] map to [filelen, ..., filelen + size()-1]

Definition at line 291 of file octree_disk_container.h.


The documentation for this class was generated from the following files:


pcl
Author(s): Open Perception
autogenerated on Wed Aug 26 2015 15:44:32