com.io7m.smfj.bytebuffer

## Class SMFByteBufferTrianglePacker

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

- All Implemented Interfaces:
    SMFParserEventsDataTrianglesType, SMFParserEventsErrorType

      public final class SMFByteBufferTrianglePacker
      extends Object
      implements SMFParserEventsDataTrianglesType

  An event listener that packs data into a given `ByteBuffer`.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `SMFByteBufferTrianglePacker(SMFParserEventsErrorType in_events, ByteBuffer in_triangle_buffer, int in_size, long in_triangles)` Construct a packer.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `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` | `onWarning(SMFWarningType w)` An error has occurred of a severity low enough that it should just be considered a warning.

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

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

- - ### Constructor Detail

    - #### SMFByteBufferTrianglePacker

          public SMFByteBufferTrianglePacker(SMFParserEventsErrorType in_events,
                                             ByteBuffer in_triangle_buffer,
                                             int in_size,
                                             long in_triangles)

      Construct a packer.
      Parameters:
        `in_events` - A receiver of errors and warnings
        `in_triangle_buffer` - The byte buffer that will contain triangle data
        `in_size` - The size in bits of a single triangle index
        `in_triangles` - The number of triangles that will be packed

  - ### Method Detail

    - #### 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`

    - #### 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

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