Class MetadataBinaryIO


  • public class MetadataBinaryIO
    extends java.lang.Object
    Writes and reads the metadata to/from binary. The format is as follows: - 32 bits (int) with the number of nodes, nNodes repeat the following nNodes times (for each node) - 32 bits (int) - pageId - The ID of the octant, or octree node - 32 bits (float) - centreX - The x component of the centre - 32 bits (float) - centreY - The y component of the centre - 32 bits (float) - centreZ - The z component of the centre - 32 bits (float) - sx - The half-size in x - 32 bits (float) - sy - The half-size in y - 32 bits (float) - sz - The half-size in z - 32 bits * 8 (int) - childrenIds - 8 integers with the ids of the children. If no child in the given position, the id is negative. - 32 bits (int) - depth - The level (depth) of the node in the tree - 32 bits (int) - nObjects - The cumulative number of objects of this node and its descendants - 32 bits (int) - ownObjects - The number of objects of this node - 32 bits (int) - childCount - The number of children nodes
    • Field Detail

      • nodesMap

        public java.util.Map<java.lang.Long,​Pair<OctreeNode,​long[]>> nodesMap
    • Constructor Detail

      • MetadataBinaryIO

        public MetadataBinaryIO()
    • Method Detail

      • readMetadata

        public OctreeNode readMetadata​(java.io.InputStream in)
        Reads the metadata into an octree node
        Parameters:
        in -
        Returns:
        The octree node
      • readMetadata

        public OctreeNode readMetadata​(java.io.InputStream in,
                                       LoadStatus status)
        Reads the metadata into an octree node
        Parameters:
        in - Input stream
        Returns:
        The octree node
      • readMetadataMapped

        public OctreeNode readMetadataMapped​(java.lang.String file)
      • readMetadataMapped

        public OctreeNode readMetadataMapped​(java.lang.String file,
                                             LoadStatus status)
      • writeMetadata

        public void writeMetadata​(OctreeNode root,
                                  java.io.OutputStream out)
        Writes the metadata of the given octree node and its descendants to the given output stream in binary.
        Parameters:
        root -
        out -