Class MetadataBinaryIO
- java.lang.Object
-
- gaia.cu9.ari.gaiaorbit.data.octreegen.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 Summary
Fields Modifier and Type Field Description java.util.Map<java.lang.Long,Pair<OctreeNode,long[]>>
nodesMap
-
Constructor Summary
Constructors Constructor Description MetadataBinaryIO()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description OctreeNode
readMetadata(java.io.InputStream in)
Reads the metadata into an octree nodeOctreeNode
readMetadata(java.io.InputStream in, LoadStatus status)
Reads the metadata into an octree nodeOctreeNode
readMetadataMapped(java.lang.String file)
OctreeNode
readMetadataMapped(java.lang.String file, LoadStatus status)
void
toList(OctreeNode node, java.util.List<OctreeNode> nodes)
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.
-
-
-
Field Detail
-
nodesMap
public java.util.Map<java.lang.Long,Pair<OctreeNode,long[]>> nodesMap
-
-
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
-
-
toList
public void toList(OctreeNode node, java.util.List<OctreeNode> nodes)
-
-