Encapsulated class to read JSON metadata into memory, and write the JSON metadata associated with the octree root node. More...
#include <pcl/outofcore/outofcore_base_data.h>
Encapsulated class to read JSON metadata into memory, and write the JSON metadata associated with the octree root node.
This is global information that is not the same as the metadata for the root node. Inherits OutofcoreAbstractMetadata interface for metadata in pcl_outofcore.
This class encapsulates the outofcore base 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 JSON ascii metadata fields saved to the metadata object file on disk. The class has been encapuslated to abstract the detailso of the on-disk format from the outofcore implementation. For example, the format could be changed to XML/YAML, or any dynamic format at some point.
The JSON file is formatted in the following way:
{
"name": "nameoftree",
"version": 3,
"pointtype": "urp", #(needs to be changed*)
"lod": 3, #(depth of the tree
"numpts": [X0, X1, X2, ..., XD], #total number of points at each LOD
"coord_system": "ECEF" #the tree is not affected by this value
}
Any properties not stored in the metadata file are computed when the file is loaded. By convention, and for historical reasons from the original Urban Robotics implementation, the JSON file representing the overall tree is a JSON file named with the ".octree" extension.
-
Author
-
Stephen Fox (foxst.nosp@m.ephe.nosp@m.nd@gm.nosp@m.ail..nosp@m.com)
Definition at line 94 of file outofcore_base_data.h.
ConstPtr
Ptr
pcl::outofcore::OutofcoreOctreeBaseMetadata::OutofcoreOctreeBaseMetadata |
( |
|
) |
|
pcl::outofcore::OutofcoreOctreeBaseMetadata::OutofcoreOctreeBaseMetadata |
( |
const boost::filesystem::path & |
path_arg |
) |
|
Load metadata from disk.
-
Parameters
-
[in] |
path_arg |
Location of JSON metadata file to load from disk |
pcl::outofcore::OutofcoreOctreeBaseMetadata::~OutofcoreOctreeBaseMetadata |
( |
|
) |
|
|
override |
getCoordinateSystem()
virtual const std::string& pcl::outofcore::OutofcoreOctreeBaseMetadata::getCoordinateSystem |
( |
|
) |
const |
|
virtual |
Get metadata information about the coordinate system.
getDepth()
virtual std::uint64_t pcl::outofcore::OutofcoreOctreeBaseMetadata::getDepth |
( |
|
) |
const |
|
virtual |
getLODPoints() [1/3]
virtual std::vector<std::uint64_t>& pcl::outofcore::OutofcoreOctreeBaseMetadata::getLODPoints |
( |
|
) |
|
|
virtual |
getLODPoints() [2/3]
virtual std::vector<std::uint64_t> pcl::outofcore::OutofcoreOctreeBaseMetadata::getLODPoints |
( |
|
) |
const |
|
virtual |
getLODPoints() [3/3]
virtual std::uint64_t pcl::outofcore::OutofcoreOctreeBaseMetadata::getLODPoints |
( |
const std::uint64_t & |
depth_index |
) |
const |
|
virtual |
Get the number of points at the given depth.
boost::filesystem::path pcl::outofcore::OutofcoreOctreeBaseMetadata::getMetadataFilename |
( |
|
) |
const |
Gets the name of the JSON file.
getOctreeName()
virtual std::string pcl::outofcore::OutofcoreOctreeBaseMetadata::getOctreeName |
( |
|
) |
|
|
virtual |
Returns the name of the tree; this is not the same as the filename.
getOutofcoreVersion()
int pcl::outofcore::OutofcoreOctreeBaseMetadata::getOutofcoreVersion |
( |
|
) |
const |
et the outofcore version read from the "version" field of the JSON object
getPointType()
virtual std::string pcl::outofcore::OutofcoreOctreeBaseMetadata::getPointType |
( |
|
) |
|
|
virtual |
virtual int pcl::outofcore::OutofcoreOctreeBaseMetadata::loadMetadataFromDisk |
( |
|
) |
|
|
virtual |
int pcl::outofcore::OutofcoreOctreeBaseMetadata::loadMetadataFromDisk |
( |
const boost::filesystem::path & |
path_to_metadata |
) |
|
|
overridevirtual |
void pcl::outofcore::OutofcoreOctreeBaseMetadata::serializeMetadataToDisk |
( |
|
) |
|
|
overridevirtual |
setCoordinateSystem()
virtual void pcl::outofcore::OutofcoreOctreeBaseMetadata::setCoordinateSystem |
( |
const std::string & |
coordinate_system |
) |
|
|
virtual |
Set information about the coordinate system.
setDepth()
virtual void pcl::outofcore::OutofcoreOctreeBaseMetadata::setDepth |
( |
const std::uint64_t & |
depth_arg |
) |
|
|
virtual |
Set the depth of the tree corresponding to JSON "lod:number".
This should always be equal to LOD_num_points_.size()-1
setLODPoints() [1/3]
virtual void pcl::outofcore::OutofcoreOctreeBaseMetadata::setLODPoints |
( |
const std::uint64_t & |
depth |
) |
|
|
virtual |
Initialize the LOD vector with points all 0.
setLODPoints() [2/3]
virtual void pcl::outofcore::OutofcoreOctreeBaseMetadata::setLODPoints |
( |
const std::uint64_t & |
lod_index_arg, |
|
|
const std::uint64_t & |
num_points_arg, |
|
|
const bool |
increment = true |
|
) |
|
|
|
virtual |
Set the number of points at lod_index_arg manually.
-
Parameters
-
[in] |
lod_index_arg |
the depth at which this increments the number of LOD points |
[in] |
num_points_arg |
The number of points to store at that LOD |
[in] |
increment |
If true, increments the number of points at the LOD rather than overwriting the number of points |
setLODPoints() [3/3]
virtual void pcl::outofcore::OutofcoreOctreeBaseMetadata::setLODPoints |
( |
std::vector< std::uint64_t > & |
lod_points_arg |
) |
|
|
virtual |
Copy a vector of LOD points into this metadata (dangerous!)
void pcl::outofcore::OutofcoreOctreeBaseMetadata::setMetadataFilename |
( |
const boost::filesystem::path & |
path_to_metadata |
) |
|
Sets the name of the JSON file.
setOctreeName()
virtual void pcl::outofcore::OutofcoreOctreeBaseMetadata::setOctreeName |
( |
const std::string & |
name_arg |
) |
|
|
virtual |
Sets the name of the tree.
setOutofcoreVersion()
void pcl::outofcore::OutofcoreOctreeBaseMetadata::setOutofcoreVersion |
( |
const int |
version |
) |
|
Set the outofcore version stored in the "version" field of the JSON object.
setPointType()
virtual void pcl::outofcore::OutofcoreOctreeBaseMetadata::setPointType |
( |
const std::string & |
point_type_arg |
) |
|
|
virtual |
Sets a single string identifying the point type of this tree.
void pcl::outofcore::OutofcoreOctreeBaseMetadata::writeMetadataString |
( |
std::vector< char > & |
buf |
) |
|
|
overrideprotectedvirtual |
operator<<
Provide operator overload to stream ascii file data.
coordinate_system_
std::string pcl::outofcore::OutofcoreOctreeBaseMetadata::coordinate_system_ |
|
protected |
levels_of_depth_
std::uint64_t pcl::outofcore::OutofcoreOctreeBaseMetadata::levels_of_depth_ |
|
protected |
Depth of the tree (which is the number of levels of depth); maps to JSON "lod":int.
Definition at line 211 of file outofcore_base_data.h.
LOD_num_points_
std::vector<std::uint64_t> pcl::outofcore::OutofcoreOctreeBaseMetadata::LOD_num_points_ |
|
protected |
Vector of number of points at each LOD.
For a tree with no LOD, all fields will be zero except for the field indexed by LOD_points_[levels_of_depth]; maps to JSON "numpts":int array
Definition at line 214 of file outofcore_base_data.h.
boost::filesystem::path pcl::outofcore::OutofcoreOctreeBaseMetadata::metadata_filename_ |
|
protected |
outofcore_version_
int pcl::outofcore::OutofcoreOctreeBaseMetadata::outofcore_version_ |
|
protected |
point_type_
std::string pcl::outofcore::OutofcoreOctreeBaseMetadata::point_type_ |
|
protected |
Delineates the point types of the field; maps to JSON "pointtype":string:
-
Note
-
This is inconsistent with "point type" fields used in PCLPointCloud2 and in other places in PCL
Definition at line 208 of file outofcore_base_data.h.
tree_name_
std::string pcl::outofcore::OutofcoreOctreeBaseMetadata::tree_name_ |
|
protected |
Name of the tree (which could be used, for example, as the name of a layer); maps to JSON "name":string.
Definition at line 203 of file outofcore_base_data.h.
The documentation for this class was generated from the following file: