com.io7m.smfj.bytebuffer

## Class SMFByteBufferPackedMeshes

- java.lang.Object
- - com.io7m.smfj.bytebuffer.SMFByteBufferPackedMeshes

- All Implemented Interfaces:
    SMFByteBufferPackedMeshLoaderType, SMFParserEventsBodyType, SMFParserEventsDataAttributesNonInterleavedType, SMFParserEventsDataAttributeValuesType, SMFParserEventsDataMetaOptionalSupplierType, SMFParserEventsDataTrianglesType, SMFParserEventsErrorType, SMFParserEventsHeaderType, SMFParserEventsType

      public final class SMFByteBufferPackedMeshes
      extends Object
      implements SMFByteBufferPackedMeshLoaderType, SMFParserEventsHeaderType, SMFParserEventsBodyType, SMFParserEventsDataAttributesNonInterleavedType, SMFParserEventsDataTrianglesType, SMFParserEventsDataAttributeValuesType

  Functions for loading and packing meshes.

- - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static LongFunction<Optional<ByteBuffer>>` | `allocateByteBufferHeap()` A convenient function for allocating a heap-based byte buffer with native byte ordering
    `javaslang.collection.List<SMFErrorType>` | `errors()`
    `SMFByteBufferPackedMesh` | `mesh()`
    `static SMFByteBufferPackedMeshLoaderType` | `newLoader(SMFParserEventsDataMetaOptionalSupplierType in_meta, SMFByteBufferPackerEventsType in_events)` Create a new mesh loader.
    `Optional<SMFParserEventsDataAttributesNonInterleavedType>` | `onAttributesNonInterleaved()`
    `void` | `onDataAttributesNonInterleavedFinish()` Called when parsing of all non-interleaved attribute data has finished.
    `Optional<SMFParserEventsDataAttributeValuesType>` | `onDataAttributeStart(SMFAttribute attribute)` Parsing of data for the attribute has started.
    `void` | `onDataAttributeValueFinish()` Parsing of data for the attribute has finished.
    `void` | `onDataAttributeValueFloat1(double x)` A data value has been received.
    `void` | `onDataAttributeValueFloat2(double x, double y)` A data value has been received.
    `void` | `onDataAttributeValueFloat3(double x, double y, double z)` A data value has been received.
    `void` | `onDataAttributeValueFloat4(double x, double y, double z, double w)` A data value has been received.
    `void` | `onDataAttributeValueIntegerSigned1(long x)` A data value has been received.
    `void` | `onDataAttributeValueIntegerSigned2(long x, long y)` A data value has been received.
    `void` | `onDataAttributeValueIntegerSigned3(long x, long y, long z)` A data value has been received.
    `void` | `onDataAttributeValueIntegerSigned4(long x, long y, long z, long w)` A data value has been received.
    `void` | `onDataAttributeValueIntegerUnsigned1(long x)` A data value has been received.
    `void` | `onDataAttributeValueIntegerUnsigned2(long x, long y)` A data value has been received.
    `void` | `onDataAttributeValueIntegerUnsigned3(long x, long y, long z)` A data value has been received.
    `void` | `onDataAttributeValueIntegerUnsigned4(long x, long y, long z, long w)` A data value has been received.
    `void` | `onDataTriangle(long v0, long v1, long v2)` A triangle has been parsed.
    `void` | `onDataTrianglesFinish()` Parsing of triangles has completed.
    `void` | `onError(SMFErrorType e)` An error has occurred.
    `void` | `onFinish()` Parsing has finished.
    `Optional<SMFParserEventsBodyType>` | `onHeaderParsed(SMFHeader in_header)` Parsing of the header was successful.
    `Optional<SMFParserEventsDataMetaType>` | `onMeta(SMFSchemaIdentifier schema)`
    `void` | `onStart()` Parsing has started.
    `Optional<SMFParserEventsDataTrianglesType>` | `onTriangles()`
    `Optional<SMFParserEventsHeaderType>` | `onVersionReceived(SMFFormatVersion version)` The file format version has been successfully parsed.
    `void` | `onWarning(SMFWarningType w)` An error has occurred of a severity low enough that it should just be considered a warning.
    `javaslang.collection.List<SMFWarningType>` | `warnings()`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface com.io7m.smfj.parser.api.SMFParserEventsDataMetaOptionalSupplierType

      `ignoring`

- - ### Method Detail

    - #### allocateByteBufferHeap

          public static LongFunction<Optional<ByteBuffer>> allocateByteBufferHeap()

      A convenient function for allocating a heap-based byte buffer with native byte ordering
      Returns:
        A function that will allocate a heap-based byte buffer

    - #### newLoader

          public static SMFByteBufferPackedMeshLoaderType newLoader(SMFParserEventsDataMetaOptionalSupplierType in_meta,
                                                                    SMFByteBufferPackerEventsType in_events)

      Create a new mesh loader.
      Parameters:
        `in_meta` - A metadata supplier
        `in_events` - A buffer packing event listener
      Returns:
        A new mesh loader

    - #### onError

          public void onError(SMFErrorType e)

      Description copied from interface: `SMFParserEventsErrorType`
      An error has occurred. Parsing will continue but the file as a whole must be considered invalid.
      Specified by:
        `onError` in interface `SMFParserEventsErrorType`
      Parameters:
        `e` - The error

    - #### onWarning

          public void onWarning(SMFWarningType w)

      Description copied from interface: `SMFParserEventsErrorType`
      An error has occurred of a severity low enough that it should just be considered a warning.
      Specified by:
        `onWarning` in interface `SMFParserEventsErrorType`
      Parameters:
        `w` - The warning

    - #### onStart

          public void onStart()

      Description copied from interface: `SMFParserEventsType`
      Parsing has started.
      Specified by:
        `onStart` in interface `SMFParserEventsType`

    - #### onVersionReceived

          public Optional<SMFParserEventsHeaderType> onVersionReceived(SMFFormatVersion version)

      Description copied from interface: `SMFParserEventsType`
      The file format version has been successfully parsed. The functions should return a receiver for the header information if parsing should continue, or `Optional.empty()` if parsing should stop.
      Specified by:
        `onVersionReceived` in interface `SMFParserEventsType`
      Parameters:
        `version` - The file format version
      Returns:
        A receiver for the header, if any

    - #### onFinish

          public void onFinish()

      Description copied from interface: `SMFParserEventsType`
      Parsing has finished. This method will be called unconditionally when the parser is closed, regardless of any errors encountered.
      Specified by:
        `onFinish` in interface `SMFParserEventsType`

    - #### errors

          public javaslang.collection.List<SMFErrorType> errors()

      Specified by:
        `errors` in interface `SMFByteBufferPackedMeshLoaderType`
      Returns:
        The list of errors encountered during parsing, if any

    - #### warnings

          public javaslang.collection.List<SMFWarningType> warnings()

      Specified by:
        `warnings` in interface `SMFByteBufferPackedMeshLoaderType`
      Returns:
        The list of warnings encountered during parsing, if any

    - #### mesh

          public SMFByteBufferPackedMesh mesh()
                                       throws IllegalStateException

      Specified by:
        `mesh` in interface `SMFByteBufferPackedMeshLoaderType`
      Returns:
        The packed mesh
      Throws:
        `IllegalStateException` - Iff `SMFByteBufferPackedMeshLoaderType.errors()` is non-empty

    - #### onDataTriangle

          public void onDataTriangle(long v0,
                                     long v1,
                                     long v2)

      Description copied from interface: `SMFParserEventsDataTrianglesType`
      A triangle has been parsed.
      Specified by:
        `onDataTriangle` in interface `SMFParserEventsDataTrianglesType`
      Parameters:
        `v0` - The index of the first vertex
        `v1` - The index of the second vertex
        `v2` - The index of the third vertex

    - #### onDataTrianglesFinish

          public void onDataTrianglesFinish()

      Description copied from interface: `SMFParserEventsDataTrianglesType`
      Parsing of triangles has completed.
      Specified by:
        `onDataTrianglesFinish` in interface `SMFParserEventsDataTrianglesType`

    - #### onDataAttributeStart

          public Optional<SMFParserEventsDataAttributeValuesType> onDataAttributeStart(SMFAttribute attribute)

      Description copied from interface: `SMFParserEventsDataAttributesNonInterleavedType`

      Parsing of data for the attribute has started.

      This method must return a receiver for the given attribute if it wants to receive values, or `Optional.empty()` if it does not.

      Specified by:
        `onDataAttributeStart` in interface `SMFParserEventsDataAttributesNonInterleavedType`
      Parameters:
        `attribute` - The attribute
      Returns:
        A value receiver

    - #### onDataAttributesNonInterleavedFinish

          public void onDataAttributesNonInterleavedFinish()

      Description copied from interface: `SMFParserEventsDataAttributesNonInterleavedType`
      Called when parsing of all non-interleaved attribute data has finished.
      Specified by:
        `onDataAttributesNonInterleavedFinish` in interface `SMFParserEventsDataAttributesNonInterleavedType`

    - #### onDataAttributeValueIntegerSigned1

          public void onDataAttributeValueIntegerSigned1(long x)

      Description copied from interface: `SMFParserEventsDataAttributeValuesType`
      A data value has been received.
      Specified by:
        `onDataAttributeValueIntegerSigned1` in interface `SMFParserEventsDataAttributeValuesType`
      Parameters:
        `x` - The x value

    - #### onDataAttributeValueIntegerSigned2

          public void onDataAttributeValueIntegerSigned2(long x,
                                                         long y)

      Description copied from interface: `SMFParserEventsDataAttributeValuesType`
      A data value has been received.
      Specified by:
        `onDataAttributeValueIntegerSigned2` in interface `SMFParserEventsDataAttributeValuesType`
      Parameters:
        `x` - The x value
        `y` - The y value

    - #### onDataAttributeValueIntegerSigned3

          public void onDataAttributeValueIntegerSigned3(long x,
                                                         long y,
                                                         long z)

      Description copied from interface: `SMFParserEventsDataAttributeValuesType`
      A data value has been received.
      Specified by:
        `onDataAttributeValueIntegerSigned3` in interface `SMFParserEventsDataAttributeValuesType`
      Parameters:
        `x` - The x value
        `y` - The y value
        `z` - The z value

    - #### onDataAttributeValueIntegerSigned4

          public void onDataAttributeValueIntegerSigned4(long x,
                                                         long y,
                                                         long z,
                                                         long w)

      Description copied from interface: `SMFParserEventsDataAttributeValuesType`
      A data value has been received.
      Specified by:
        `onDataAttributeValueIntegerSigned4` in interface `SMFParserEventsDataAttributeValuesType`
      Parameters:
        `x` - The x value
        `y` - The y value
        `z` - The z value
        `w` - The w value

    - #### onDataAttributeValueIntegerUnsigned1

          public void onDataAttributeValueIntegerUnsigned1(long x)

      Description copied from interface: `SMFParserEventsDataAttributeValuesType`
      A data value has been received.
      Specified by:
        `onDataAttributeValueIntegerUnsigned1` in interface `SMFParserEventsDataAttributeValuesType`
      Parameters:
        `x` - The x value

    - #### onDataAttributeValueIntegerUnsigned2

          public void onDataAttributeValueIntegerUnsigned2(long x,
                                                           long y)

      Description copied from interface: `SMFParserEventsDataAttributeValuesType`
      A data value has been received.
      Specified by:
        `onDataAttributeValueIntegerUnsigned2` in interface `SMFParserEventsDataAttributeValuesType`
      Parameters:
        `x` - The x value
        `y` - The y value

    - #### onDataAttributeValueIntegerUnsigned3

          public void onDataAttributeValueIntegerUnsigned3(long x,
                                                           long y,
                                                           long z)

      Description copied from interface: `SMFParserEventsDataAttributeValuesType`
      A data value has been received.
      Specified by:
        `onDataAttributeValueIntegerUnsigned3` in interface `SMFParserEventsDataAttributeValuesType`
      Parameters:
        `x` - The x value
        `y` - The y value
        `z` - The z value

    - #### onDataAttributeValueIntegerUnsigned4

          public void onDataAttributeValueIntegerUnsigned4(long x,
                                                           long y,
                                                           long z,
                                                           long w)

      Description copied from interface: `SMFParserEventsDataAttributeValuesType`
      A data value has been received.
      Specified by:
        `onDataAttributeValueIntegerUnsigned4` in interface `SMFParserEventsDataAttributeValuesType`
      Parameters:
        `x` - The x value
        `y` - The y value
        `z` - The z value
        `w` - The w value

    - #### onDataAttributeValueFloat1

          public void onDataAttributeValueFloat1(double x)

      Description copied from interface: `SMFParserEventsDataAttributeValuesType`
      A data value has been received.
      Specified by:
        `onDataAttributeValueFloat1` in interface `SMFParserEventsDataAttributeValuesType`
      Parameters:
        `x` - The x value

    - #### onDataAttributeValueFloat2

          public void onDataAttributeValueFloat2(double x,
                                                 double y)

      Description copied from interface: `SMFParserEventsDataAttributeValuesType`
      A data value has been received.
      Specified by:
        `onDataAttributeValueFloat2` in interface `SMFParserEventsDataAttributeValuesType`
      Parameters:
        `x` - The x value
        `y` - The y value

    - #### onDataAttributeValueFloat3

          public void onDataAttributeValueFloat3(double x,
                                                 double y,
                                                 double z)

      Description copied from interface: `SMFParserEventsDataAttributeValuesType`
      A data value has been received.
      Specified by:
        `onDataAttributeValueFloat3` in interface `SMFParserEventsDataAttributeValuesType`
      Parameters:
        `x` - The x value
        `y` - The y value
        `z` - The z value

    - #### onDataAttributeValueFloat4

          public void onDataAttributeValueFloat4(double x,
                                                 double y,
                                                 double z,
                                                 double w)

      Description copied from interface: `SMFParserEventsDataAttributeValuesType`
      A data value has been received.
      Specified by:
        `onDataAttributeValueFloat4` in interface `SMFParserEventsDataAttributeValuesType`
      Parameters:
        `x` - The x value
        `y` - The y value
        `z` - The z value
        `w` - The w value

    - #### onDataAttributeValueFinish

          public void onDataAttributeValueFinish()

      Description copied from interface: `SMFParserEventsDataAttributeValuesType`
      Parsing of data for the attribute has finished.
      Specified by:
        `onDataAttributeValueFinish` in interface `SMFParserEventsDataAttributeValuesType`

    - #### onHeaderParsed

          public Optional<SMFParserEventsBodyType> onHeaderParsed(SMFHeader in_header)

      Description copied from interface: `SMFParserEventsHeaderType`
      Parsing of the header was successful. The function must return an event receiver if it wishes parsing to continue.
      Specified by:
        `onHeaderParsed` in interface `SMFParserEventsHeaderType`
      Parameters:
        `in_header` - The parsed header
      Returns:
        An event receiver

    - #### onAttributesNonInterleaved

          public Optional<SMFParserEventsDataAttributesNonInterleavedType> onAttributesNonInterleaved()

      Specified by:
        `onAttributesNonInterleaved` in interface `SMFParserEventsBodyType`
      Returns:
        A listener that will receive non-interleaved mesh data

    - #### onTriangles

          public Optional<SMFParserEventsDataTrianglesType> onTriangles()

      Specified by:
        `onTriangles` in interface `SMFParserEventsBodyType`
      Returns:
        A listener that will receive triangle data

    - #### onMeta

          public Optional<SMFParserEventsDataMetaType> onMeta(SMFSchemaIdentifier schema)

      Specified by:
        `onMeta` in interface `SMFParserEventsDataMetaOptionalSupplierType`
      Parameters:
        `schema` - The schema ID
      Returns:
        A listener that will receive metadata

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