com.io7m.r2.meshes.arrayobject

## Class R2MeshArrayObjectSynchronousAdapter

- java.lang.Object
- - com.io7m.r2.meshes.arrayobject.R2MeshArrayObjectSynchronousAdapter

- All Implemented Interfaces:
    R2MeshArrayObjectSynchronousAdapterType, R2ErrorConsumerType, R2MeshParserInterleavedListenerType

      public final class R2MeshArrayObjectSynchronousAdapter
      extends Object
      implements R2MeshArrayObjectSynchronousAdapterType

  The default implementation of the `R2MeshArrayObjectSynchronousAdapterType` interface.

- - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `com.io7m.jcanephora.core.JCGLArrayBufferType` | `arrayBuffer()`
    `com.io7m.jcanephora.core.JCGLArrayObjectType` | `arrayObject()`
    `Optional<Throwable>` | `errorException()`
    `String` | `errorMessage()`
    `boolean` | `hasFailed()` Indicate whether or not parsing has failed.
    `com.io7m.jcanephora.core.JCGLIndexBufferType` | `indexBuffer()`
    `static R2MeshArrayObjectSynchronousAdapterType` | `newAdapter(com.io7m.jcanephora.core.api.JCGLArrayObjectsType in_ao, com.io7m.jcanephora.core.api.JCGLArrayBuffersType in_ab, com.io7m.jcanephora.core.api.JCGLIndexBuffersType in_ib, com.io7m.jcanephora.core.JCGLUsageHint in_array_usage, com.io7m.jcanephora.core.JCGLUnsignedType in_index_type, com.io7m.jcanephora.core.JCGLUsageHint in_index_usage, R2VertexCursorProducerInfoType in_cursor_info, R2VertexCursorProducerType<ByteBuffer> in_cursor_producer)` Construct a new adapter.
    `void` | `onError(Optional<Throwable> e, String message)` An error was encountered.
    `void` | `onEventFinished()` Called unconditionally at the end of parsing.
    `void` | `onEventStart()` Called unconditionally at the start of parsing.
    `void` | `onEventTriangle(long index, long v0, long v1, long v2)` A triangle was received.
    `void` | `onEventTriangleCount(long count)` The number of triangles was received.
    `void` | `onEventTrianglesFinished()` All triangles have been parsed.
    `void` | `onEventVertexCount(long count)` The number of vertices was received.
    `void` | `onEventVertexFinished(long index)` Vertex `index` is finished.
    `void` | `onEventVertexNormal(long index, double x, double y, double z)` A vertex normal was received.
    `void` | `onEventVertexPosition(long index, double x, double y, double z)` A vertex position was received.
    `void` | `onEventVertexStarted(long index)` Vertex `index` is starting.
    `void` | `onEventVertexTangent(long index, double x, double y, double z, double w)` A vertex tangent was received.
    `void` | `onEventVertexUV(long index, double x, double y)` A vertex UV coordinate was received.
    `void` | `onEventVerticesFinished()` All vertices have been parsed.

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

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

- - ### Method Detail

    - #### newAdapter

          public static R2MeshArrayObjectSynchronousAdapterType newAdapter(com.io7m.jcanephora.core.api.JCGLArrayObjectsType in_ao,
                                                                           com.io7m.jcanephora.core.api.JCGLArrayBuffersType in_ab,
                                                                           com.io7m.jcanephora.core.api.JCGLIndexBuffersType in_ib,
                                                                           com.io7m.jcanephora.core.JCGLUsageHint in_array_usage,
                                                                           com.io7m.jcanephora.core.JCGLUnsignedType in_index_type,
                                                                           com.io7m.jcanephora.core.JCGLUsageHint in_index_usage,
                                                                           R2VertexCursorProducerInfoType in_cursor_info,
                                                                           R2VertexCursorProducerType<ByteBuffer> in_cursor_producer)

      Construct a new adapter.
      Parameters:
        `in_ao` - An array objects interface
        `in_ab` - An array buffers interface
        `in_ib` - An index buffers interface
        `in_array_usage` - The usage hint for the created array buffer
        `in_index_type` - The smallest allowed type for index buffer indices
        `in_index_usage` - The usage hint for the created index buffer
        `in_cursor_info` - Information for created cursors
        `in_cursor_producer` - A cursor producer
      Returns:
        A new adapter
      See Also:
        `R2IndexBuffers.getTypeForCount(JCGLUnsignedType, long)`

    - #### onEventStart

          public void onEventStart()

      Description copied from interface: `R2MeshParserInterleavedListenerType`
      Called unconditionally at the start of parsing.
      Specified by:
        `onEventStart` in interface `R2MeshParserInterleavedListenerType`

    - #### onEventVertexCount

          public void onEventVertexCount(long count)

      Description copied from interface: `R2MeshParserInterleavedListenerType`
      The number of vertices was received.
      Specified by:
        `onEventVertexCount` in interface `R2MeshParserInterleavedListenerType`
      Parameters:
        `count` - The number of vertices

    - #### onEventTriangleCount

          public void onEventTriangleCount(long count)

      Description copied from interface: `R2MeshParserInterleavedListenerType`
      The number of triangles was received.
      Specified by:
        `onEventTriangleCount` in interface `R2MeshParserInterleavedListenerType`
      Parameters:
        `count` - The number of triangles

    - #### onEventVertexStarted

          public void onEventVertexStarted(long index)

      Description copied from interface: `R2MeshParserInterleavedListenerType`
      Vertex `index` is starting.
      Specified by:
        `onEventVertexStarted` in interface `R2MeshParserInterleavedListenerType`
      Parameters:
        `index` - The vertex index

    - #### onEventVertexPosition

          public void onEventVertexPosition(long index,
                                            double x,
                                            double y,
                                            double z)

      Description copied from interface: `R2MeshParserInterleavedListenerType`
      A vertex position was received. The given `index` will be equal to the `index` that was received by the most recent call to `R2MeshParserInterleavedListenerType.onEventVertexStarted(long)`.
      Specified by:
        `onEventVertexPosition` in interface `R2MeshParserInterleavedListenerType`
      Parameters:
        `index` - The vertex number
        `x` - The `X` coordinate
        `y` - The `Y` coordinate
        `z` - The `Z` coordinate

    - #### onEventVertexNormal

          public void onEventVertexNormal(long index,
                                          double x,
                                          double y,
                                          double z)

      Description copied from interface: `R2MeshParserInterleavedListenerType`
      A vertex normal was received. The given `index` will be equal to the `index` that was received by the most recent call to `R2MeshParserInterleavedListenerType.onEventVertexStarted(long)`.
      Specified by:
        `onEventVertexNormal` in interface `R2MeshParserInterleavedListenerType`
      Parameters:
        `index` - The vertex number
        `x` - The `X` coordinate
        `y` - The `Y` coordinate
        `z` - The `Z` coordinate

    - #### onEventVertexTangent

          public void onEventVertexTangent(long index,
                                           double x,
                                           double y,
                                           double z,
                                           double w)

      Description copied from interface: `R2MeshParserInterleavedListenerType`
      A vertex tangent was received. The given `index` will be equal to the `index` that was received by the most recent call to `R2MeshParserInterleavedListenerType.onEventVertexStarted(long)`.
      Specified by:
        `onEventVertexTangent` in interface `R2MeshParserInterleavedListenerType`
      Parameters:
        `index` - The vertex number
        `x` - The `X` coordinate
        `y` - The `Y` coordinate
        `z` - The `Z` coordinate
        `w` - The `W` coordinate

    - #### onEventVertexUV

          public void onEventVertexUV(long index,
                                      double x,
                                      double y)

      Description copied from interface: `R2MeshParserInterleavedListenerType`
      A vertex UV coordinate was received. The given `index` will be equal to the `index` that was received by the most recent call to `R2MeshParserInterleavedListenerType.onEventVertexStarted(long)`.
      Specified by:
        `onEventVertexUV` in interface `R2MeshParserInterleavedListenerType`
      Parameters:
        `index` - The vertex number
        `x` - The `X` coordinate
        `y` - The `Y` coordinate

    - #### onEventVertexFinished

          public void onEventVertexFinished(long index)

      Description copied from interface: `R2MeshParserInterleavedListenerType`
      Vertex `index` is finished. The given `index` will be equal to the `index` that was received by the most recent call to `R2MeshParserInterleavedListenerType.onEventVertexStarted(long)`.
      Specified by:
        `onEventVertexFinished` in interface `R2MeshParserInterleavedListenerType`
      Parameters:
        `index` - The vertex index

    - #### onEventVerticesFinished

          public void onEventVerticesFinished()

      Description copied from interface: `R2MeshParserInterleavedListenerType`
      All vertices have been parsed.
      Specified by:
        `onEventVerticesFinished` in interface `R2MeshParserInterleavedListenerType`

    - #### onEventTriangle

          public void onEventTriangle(long index,
                                      long v0,
                                      long v1,
                                      long v2)

      Description copied from interface: `R2MeshParserInterleavedListenerType`
      A triangle was received.
      Specified by:
        `onEventTriangle` in interface `R2MeshParserInterleavedListenerType`
      Parameters:
        `index` - The triangle number
        `v0` - The index of the first vertex
        `v1` - The index of the second vertex
        `v2` - The index of the third vertex

    - #### onEventTrianglesFinished

          public void onEventTrianglesFinished()

      Description copied from interface: `R2MeshParserInterleavedListenerType`
      All triangles have been parsed.
      Specified by:
        `onEventTrianglesFinished` in interface `R2MeshParserInterleavedListenerType`

    - #### onEventFinished

          public void onEventFinished()

      Description copied from interface: `R2MeshParserInterleavedListenerType`
      Called unconditionally at the end of parsing.
      Specified by:
        `onEventFinished` in interface `R2MeshParserInterleavedListenerType`

    - #### hasFailed

          public boolean hasFailed()

      Description copied from interface: `R2MeshArrayObjectSynchronousAdapterType`
      Indicate whether or not parsing has failed.
      Specified by:
        `hasFailed` in interface `R2MeshArrayObjectSynchronousAdapterType`
      Returns:
        `true` iff parsing failed.

    - #### arrayBuffer

          public com.io7m.jcanephora.core.JCGLArrayBufferType arrayBuffer()

      Specified by:
        `arrayBuffer` in interface `R2MeshArrayObjectSynchronousAdapterType`
      Returns:
        The created array buffer

    - #### indexBuffer

          public com.io7m.jcanephora.core.JCGLIndexBufferType indexBuffer()

      Specified by:
        `indexBuffer` in interface `R2MeshArrayObjectSynchronousAdapterType`
      Returns:
        The created index buffer

    - #### arrayObject

          public com.io7m.jcanephora.core.JCGLArrayObjectType arrayObject()

      Specified by:
        `arrayObject` in interface `R2MeshArrayObjectSynchronousAdapterType`
      Returns:
        The created array object

    - #### errorException

          public Optional<Throwable> errorException()

      Specified by:
        `errorException` in interface `R2MeshArrayObjectSynchronousAdapterType`
      Returns:
        The exception that occurred during parsing, if any
      See Also:
        `R2MeshArrayObjectSynchronousAdapterType.hasFailed()`

    - #### errorMessage

          public String errorMessage()

      Specified by:
        `errorMessage` in interface `R2MeshArrayObjectSynchronousAdapterType`
      Returns:
        The error message that occurred during parsing, if any
      See Also:
        `R2MeshArrayObjectSynchronousAdapterType.hasFailed()`

    - #### onError

          public void onError(Optional<Throwable> e,
                              String message)

      Description copied from interface: `R2ErrorConsumerType`
      An error was encountered.
      Specified by:
        `onError` in interface `R2ErrorConsumerType`
      Parameters:
        `e` - An exception raised, if any
        `message` - The error message

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