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) - 64 bits (long) - pageId - The page id - 64 bits (double) - centreX - The x component of the centre - 64 bits (double) - centreY - The y component of the centre - 64 bits (double) - centreZ - The z component of the centre - 64 bits (double) - sx - The size in x - 64 bits (double) - sy - The size in y - 64 bits (double) - sz - The size in z - 64 bits * 8 (long) - childrenIds - 8 longs with the ids of the children. If no child in the given position, the id is negative. - 32 bits (int) - depth - The depth of the node - 32 bits (int) - nObjects - The 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 -