Point Cloud Library (PCL)  1.9.1-dev
List of all members | Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Friends
pcl::outofcore::OutofcoreOctreeNodeMetadata Class Reference

Encapsulated class to read JSON metadata into memory, and write the JSON metadata for each node. More...

#include <pcl/outofcore/outofcore_node_data.h>

Public Types

typedef boost::shared_ptr< OutofcoreOctreeNodeMetadataPtr
 
typedef boost::shared_ptr< const OutofcoreOctreeNodeMetadataConstPtr
 

Public Member Functions

 OutofcoreOctreeNodeMetadata ()
 Empty constructor. More...
 
 ~OutofcoreOctreeNodeMetadata ()
 
 OutofcoreOctreeNodeMetadata (const OutofcoreOctreeNodeMetadata &orig)
 Copy constructor. More...
 
const Eigen::Vector3d & getBoundingBoxMin () const
 Get the lower bounding box corner. More...
 
void setBoundingBoxMin (const Eigen::Vector3d &min_bb)
 Set the lower bounding box corner. More...
 
const Eigen::Vector3d & getBoundingBoxMax () const
 Get the upper bounding box corner. More...
 
void setBoundingBoxMax (const Eigen::Vector3d &max_bb)
 Set the upper bounding box corner. More...
 
void getBoundingBox (Eigen::Vector3d &min_bb, Eigen::Vector3d &max_bb) const
 Get the lower and upper corners of the bounding box enclosing this node. More...
 
void setBoundingBox (const Eigen::Vector3d &min_bb, const Eigen::Vector3d &max_bb)
 Set the lower and upper corners of the bounding box. More...
 
const boost::filesystem::path & getDirectoryPathname () const
 Get the directory path name; this is the parent_path of. More...
 
void setDirectoryPathname (const boost::filesystem::path &directory_pathname)
 Set the directory path name. More...
 
const boost::filesystem::path & getPCDFilename () const
 Get the path to the PCD file. More...
 
void setPCDFilename (const boost::filesystem::path &point_filename)
 Set the point filename; extension .pcd. More...
 
int getOutofcoreVersion () const
 et the outofcore version read from the "version" field of the JSON object More...
 
void setOutofcoreVersion (const int version)
 Set the outofcore version stored in the "version" field of the JSON object. More...
 
const boost::filesystem::path & getMetadataFilename () const
 Sets the name of the JSON file. More...
 
void setMetadataFilename (const boost::filesystem::path &path_to_metadata)
 Gets the name of the JSON file. More...
 
const Eigen::Vector3d & getVoxelCenter () const
 Get the midpoint of this node's bounding box. More...
 
void serializeMetadataToDisk ()
 Writes the data to a JSON file located at metadata_filename_. More...
 
int loadMetadataFromDisk ()
 Loads the data from a JSON file located at metadata_filename_. More...
 
int loadMetadataFromDisk (const boost::filesystem::path &path_to_metadata)
 Loads the data from a JSON file located at metadata_filename_. More...
 

Protected Member Functions

void updateVoxelCenter ()
 Computes the midpoint; used when bounding box is changed. More...
 

Protected Attributes

Eigen::Vector3d min_bb_
 The X,Y,Z axes-aligned minimum corner for the bounding box. More...
 
Eigen::Vector3d max_bb_
 The X,Y,Z axes-aligned maximum corner for the bounding box. More...
 
boost::filesystem::path binary_point_filename_
 Path to PCD file (i.e. More...
 
Eigen::Vector3d midpoint_xyz_
 Voxel center; not stored on disk. More...
 
boost::filesystem::path directory_
 Directory this metadata belongs in. More...
 
boost::filesystem::path metadata_filename_
 Metadata (JSON) file pathname (oct_idx extension JSON file) More...
 
int outofcore_version_
 Outofcore library version identifier. More...
 

Friends

std::ostream & operator<< (std::ostream &os, const OutofcoreOctreeNodeMetadata &metadata_arg)
 

Detailed Description

Encapsulated class to read JSON metadata into memory, and write the JSON metadata for each node.

This class encapsulates the outofcore node metadata serialization/deserialization. At the time it was written, this depended on cJSON to write JSON objects to disk. This class can be extended to have arbitrary ascii metadata fields saved to the metadata object file on disk.

The JSON file is formatted in the following way:

{
  "version": 3,
  "bb_min":  [xxx,yyy,zzz],
  "bb_max":  [xxx,yyy,zzz],
  "bin":     "path_to_data.pcd"
}

Any properties not stored in the metadata file are computed when the file is loaded (e.g. midpoint_xyz_). By convention, the JSON files are stored on disk with .oct_idx extension.

Author
Stephen Fox (foxst.nosp@m.ephe.nosp@m.nd@gm.nosp@m.ail..nosp@m.com)

Definition at line 82 of file outofcore_node_data.h.

Member Typedef Documentation

Definition at line 88 of file outofcore_node_data.h.

Definition at line 87 of file outofcore_node_data.h.

Constructor & Destructor Documentation

pcl::outofcore::OutofcoreOctreeNodeMetadata::OutofcoreOctreeNodeMetadata ( )

Empty constructor.

pcl::outofcore::OutofcoreOctreeNodeMetadata::~OutofcoreOctreeNodeMetadata ( )
pcl::outofcore::OutofcoreOctreeNodeMetadata::OutofcoreOctreeNodeMetadata ( const OutofcoreOctreeNodeMetadata orig)

Copy constructor.

Member Function Documentation

void pcl::outofcore::OutofcoreOctreeNodeMetadata::getBoundingBox ( Eigen::Vector3d &  min_bb,
Eigen::Vector3d &  max_bb 
) const

Get the lower and upper corners of the bounding box enclosing this node.

const Eigen::Vector3d& pcl::outofcore::OutofcoreOctreeNodeMetadata::getBoundingBoxMax ( ) const

Get the upper bounding box corner.

const Eigen::Vector3d& pcl::outofcore::OutofcoreOctreeNodeMetadata::getBoundingBoxMin ( ) const

Get the lower bounding box corner.

const boost::filesystem::path& pcl::outofcore::OutofcoreOctreeNodeMetadata::getDirectoryPathname ( ) const

Get the directory path name; this is the parent_path of.

const boost::filesystem::path& pcl::outofcore::OutofcoreOctreeNodeMetadata::getMetadataFilename ( ) const

Sets the name of the JSON file.

int pcl::outofcore::OutofcoreOctreeNodeMetadata::getOutofcoreVersion ( ) const

et the outofcore version read from the "version" field of the JSON object

const boost::filesystem::path& pcl::outofcore::OutofcoreOctreeNodeMetadata::getPCDFilename ( ) const

Get the path to the PCD file.

const Eigen::Vector3d& pcl::outofcore::OutofcoreOctreeNodeMetadata::getVoxelCenter ( ) const

Get the midpoint of this node's bounding box.

int pcl::outofcore::OutofcoreOctreeNodeMetadata::loadMetadataFromDisk ( )

Loads the data from a JSON file located at metadata_filename_.

int pcl::outofcore::OutofcoreOctreeNodeMetadata::loadMetadataFromDisk ( const boost::filesystem::path &  path_to_metadata)

Loads the data from a JSON file located at metadata_filename_.

void pcl::outofcore::OutofcoreOctreeNodeMetadata::serializeMetadataToDisk ( )

Writes the data to a JSON file located at metadata_filename_.

void pcl::outofcore::OutofcoreOctreeNodeMetadata::setBoundingBox ( const Eigen::Vector3d &  min_bb,
const Eigen::Vector3d &  max_bb 
)

Set the lower and upper corners of the bounding box.

void pcl::outofcore::OutofcoreOctreeNodeMetadata::setBoundingBoxMax ( const Eigen::Vector3d &  max_bb)

Set the upper bounding box corner.

void pcl::outofcore::OutofcoreOctreeNodeMetadata::setBoundingBoxMin ( const Eigen::Vector3d &  min_bb)

Set the lower bounding box corner.

void pcl::outofcore::OutofcoreOctreeNodeMetadata::setDirectoryPathname ( const boost::filesystem::path &  directory_pathname)

Set the directory path name.

void pcl::outofcore::OutofcoreOctreeNodeMetadata::setMetadataFilename ( const boost::filesystem::path &  path_to_metadata)

Gets the name of the JSON file.

void pcl::outofcore::OutofcoreOctreeNodeMetadata::setOutofcoreVersion ( const int  version)

Set the outofcore version stored in the "version" field of the JSON object.

void pcl::outofcore::OutofcoreOctreeNodeMetadata::setPCDFilename ( const boost::filesystem::path &  point_filename)

Set the point filename; extension .pcd.

void pcl::outofcore::OutofcoreOctreeNodeMetadata::updateVoxelCenter ( )
inlineprotected

Computes the midpoint; used when bounding box is changed.

Definition at line 181 of file outofcore_node_data.h.

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  os,
const OutofcoreOctreeNodeMetadata metadata_arg 
)
friend

Member Data Documentation

boost::filesystem::path pcl::outofcore::OutofcoreOctreeNodeMetadata::binary_point_filename_
protected

Path to PCD file (i.e.

"bin"ary point data)

Definition at line 169 of file outofcore_node_data.h.

boost::filesystem::path pcl::outofcore::OutofcoreOctreeNodeMetadata::directory_
protected

Directory this metadata belongs in.

Definition at line 173 of file outofcore_node_data.h.

Eigen::Vector3d pcl::outofcore::OutofcoreOctreeNodeMetadata::max_bb_
protected

The X,Y,Z axes-aligned maximum corner for the bounding box.

Definition at line 167 of file outofcore_node_data.h.

boost::filesystem::path pcl::outofcore::OutofcoreOctreeNodeMetadata::metadata_filename_
protected

Metadata (JSON) file pathname (oct_idx extension JSON file)

Definition at line 175 of file outofcore_node_data.h.

Eigen::Vector3d pcl::outofcore::OutofcoreOctreeNodeMetadata::midpoint_xyz_
protected

Voxel center; not stored on disk.

Definition at line 171 of file outofcore_node_data.h.

Eigen::Vector3d pcl::outofcore::OutofcoreOctreeNodeMetadata::min_bb_
protected

The X,Y,Z axes-aligned minimum corner for the bounding box.

Definition at line 165 of file outofcore_node_data.h.

int pcl::outofcore::OutofcoreOctreeNodeMetadata::outofcore_version_
protected

Outofcore library version identifier.

Definition at line 177 of file outofcore_node_data.h.


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