An E57 element containing ordered vector of child nodes, stored in an efficient binary format. More...
An E57 element containing ordered vector of child nodes, stored in an efficient binary format.
The CompressedVectorNode encodes very long sequences of identically typed records. In an E57 file, the per-point information (coordinates, intensity, color, time stamp etc.) are stored in a CompressedVectorNode. For time and space efficiency, the CompressedVectorNode data is stored in a binary section of the E57 file.
Conceptually, the CompressedVectorNode encodes a structure that looks very much like a homogeneous VectorNode object. However because of the huge volume of data (E57 files can store more than 10 billion points) within a CompressedVectorNode, the functions for accessing the data are dramatically different. CompressedVectorNode data is accessed in large blocks of records (100s to 1000s at a time).
Two attributes are required to create a new CompressedVectorNode. The first attribute describes the shape of the record that will be stored. This record type description is called the prototype
of the CompressedVectorNode. Often the prototype
will be a StructNode with a single level of named child elements. However, the prototype can be a tree of any depth consisting of the following node types: IntegerNode, ScaledIntegerNode, FloatNode, StringNode, StructureNode, or VectorNode (i.e. CompressedVectorNode and BlobNode are not allowed). Only the node types and attributes are used in the prototype, the values stored are ignored. For example, if the prototype contains an IntegerNode, with a value=0, minimum=0, maximum=1023, then this means that each record will contain an integer that can take any value in the interval [0,1023]. As a second example, if the prototype contains an ScaledIntegerNode, with a value=0, minimum=0, maximum=1023, scale=.001, offset=0 then this means that each record will contain an integer that can take any value in the interval [0,1023] and if a reader requests the scaledValue of the field, the rawValue should be multiplied by 0.001.
The second attribute needed to describe a new CompressedVectorNode is the codecs
description of how the values of the records are to be represented on the disk. The codec object is a VectorNode of a particular format that describes the encoding for each field in the record, which codec will be used to transfer the values to and from the disk. Currently only one codec is defined for E57 files, the bitPackCodec, which copies the numbers from memory, removes any unused bit positions, and stores the without additional spaces on the disk. The bitPackCodec has no configuration options or parameters to tune. In the ASTM standard, if no codec is specified, the bitPackCodec is assumed. So specifying the codecs
as an empty VectorNode is equivalent to requesting at all fields in the record be encoded with the bitPackCodec.
Other than the prototype
and codecs
attributes, the only other state directly accessible is the number of children (records) in the CompressedVectorNode. The read/write access to the contents of the CompressedVectorNode is coordinated by two other Foundation API objects: CompressedVectorReader and CompressedVectorWriter.
A class invariant is a list of statements about an object that are always true before and after any operation on the object. An invariant is useful for testing correct operation of an implementation. Statements in an invariant can involve only externally visible state, or can refer to internal implementation-specific state that is not visible to the API user. The following C++ code checks externally visible state for consistency and throws an exception if the invariant is violated: