Point Cloud Library (PCL)  1.14.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

using Ptr = shared_ptr< OutofcoreOctreeNodeMetadata >
 
using ConstPtr = shared_ptr< const OutofcoreOctreeNodeMetadata >
 

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_ {0}
 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 89 of file outofcore_node_data.h.

Member Typedef Documentation

◆ ConstPtr

Definition at line 95 of file outofcore_node_data.h.

◆ Ptr

Definition at line 94 of file outofcore_node_data.h.

Constructor & Destructor Documentation

◆ OutofcoreOctreeNodeMetadata() [1/2]

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

Empty constructor.

◆ ~OutofcoreOctreeNodeMetadata()

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

◆ OutofcoreOctreeNodeMetadata() [2/2]

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

Copy constructor.

Member Function Documentation

◆ getBoundingBox()

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.

◆ getBoundingBoxMax()

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

Get the upper bounding box corner.

◆ getBoundingBoxMin()

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

Get the lower bounding box corner.

◆ getDirectoryPathname()

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

Get the directory path name; this is the parent_path of

◆ getMetadataFilename()

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

Sets the name of the JSON file.

◆ getOutofcoreVersion()

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

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

◆ getPCDFilename()

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

Get the path to the PCD file.

◆ getVoxelCenter()

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

Get the midpoint of this node's bounding box.

◆ loadMetadataFromDisk() [1/2]

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

Loads the data from a JSON file located at metadata_filename_.

◆ loadMetadataFromDisk() [2/2]

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

Loads the data from a JSON file located at metadata_filename_.

◆ serializeMetadataToDisk()

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

Writes the data to a JSON file located at metadata_filename_.

◆ setBoundingBox()

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.

◆ setBoundingBoxMax()

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

Set the upper bounding box corner.

◆ setBoundingBoxMin()

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

Set the lower bounding box corner.

◆ setDirectoryPathname()

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

Set the directory path name.

◆ setMetadataFilename()

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

Gets the name of the JSON file.

◆ setOutofcoreVersion()

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

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

◆ setPCDFilename()

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

Set the point filename; extension .pcd.

◆ updateVoxelCenter()

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

Computes the midpoint; used when bounding box is changed.

Definition at line 188 of file outofcore_node_data.h.

Friends And Related Function Documentation

◆ operator<<

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

Member Data Documentation

◆ binary_point_filename_

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

Path to PCD file (i.e.

"bin"ary point data)

Definition at line 176 of file outofcore_node_data.h.

◆ directory_

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

Directory this metadata belongs in.

Definition at line 180 of file outofcore_node_data.h.

◆ max_bb_

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

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

Definition at line 174 of file outofcore_node_data.h.

◆ metadata_filename_

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

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

Definition at line 182 of file outofcore_node_data.h.

◆ midpoint_xyz_

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

Voxel center; not stored on disk.

Definition at line 178 of file outofcore_node_data.h.

◆ min_bb_

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

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

Definition at line 172 of file outofcore_node_data.h.

◆ outofcore_version_

int pcl::outofcore::OutofcoreOctreeNodeMetadata::outofcore_version_ {0}
protected

Outofcore library version identifier.

Definition at line 184 of file outofcore_node_data.h.


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