com.io7m.smfj.bytebuffer

## Interface SMFByteBufferPackerEventsType

-     public interface SMFByteBufferPackerEventsType

  The type of byte buffer packing event listeners.

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `ByteBuffer` | `onAllocateAttributeBuffer(Integer id, SMFByteBufferPackingConfiguration config, long size)` A function that will allocate a `ByteBuffer` to hold attribute data.
    `ByteBuffer` | `onAllocateTriangleBuffer(SMFTriangles triangles, long size)` A function that will allocate a `ByteBuffer` to hold triangle data.
    `javaslang.control.Validation<javaslang.collection.List<SMFErrorType>,javaslang.collection.SortedMap<Integer,SMFByteBufferPackingConfiguration>>` | `onHeader(SMFHeader header)` A function that is evaluated for a parsed header.
    `boolean` | `onShouldPackTriangles()`

- - ### Method Detail

    - #### onHeader

          javaslang.control.Validation<javaslang.collection.List<SMFErrorType>,javaslang.collection.SortedMap<Integer,SMFByteBufferPackingConfiguration>> onHeader(SMFHeader header)

      A function that is evaluated for a parsed header. The function must return exactly one `SMFByteBufferPackingConfiguration` for each `ByteBuffer` that should be created to hold attribute data.
      Parameters:
        `header` - The parsed header
      Returns:
        A set of packing configurations, or a list of reasons why packing could not proceed

    - #### onShouldPackTriangles

          boolean onShouldPackTriangles()

      Returns:
        `true` iff triangles should be packed

    - #### onAllocateTriangleBuffer

          ByteBuffer onAllocateTriangleBuffer(SMFTriangles triangles,
                                              long size)

      A function that will allocate a `ByteBuffer` to hold triangle data.
      Parameters:
        `triangles` - Information about the triangles
        `size` - The required size in octets of the allocated buffer
      Returns:
        A buffer of `size` octets

    - #### onAllocateAttributeBuffer

          ByteBuffer onAllocateAttributeBuffer(Integer id,
                                               SMFByteBufferPackingConfiguration config,
                                               long size)

      A function that will allocate a `ByteBuffer` to hold attribute data.
      Parameters:
        `id` - The configuration key
        `config` - The packing configuration
        `size` - The required size in octets of the allocated buffer
      Returns:
        A buffer of `size` octets

Copyright © 2017 <code@io7m.com> http://io7m.com