javax.media.ding3d
Class Ding3dBuffer

java.lang.Object
  extended by javax.media.ding3d.Ding3dBuffer

public class Ding3dBuffer
extends java.lang.Object

Java 3D wrapper class for java.nio.Buffer objects. When used to wrap a non-null NIO buffer object, this class will create a read-only view of the wrapped NIO buffer, and will call rewind on the read-only view, so that elements 0 through buffer.limit()-1 will be available internally.

Since:
Java 3D 1.3
See Also:
GeometryArray.setCoordRefBuffer(Ding3dBuffer), GeometryArray.setColorRefBuffer(Ding3dBuffer), GeometryArray.setNormalRefBuffer(Ding3dBuffer), GeometryArray.setTexCoordRefBuffer(int,Ding3dBuffer), GeometryArray.setVertexAttrRefBuffer(int,Ding3dBuffer), GeometryArray.setInterleavedVertexBuffer(Ding3dBuffer), CompressedGeometry.CompressedGeometry(CompressedGeometryHeader,Ding3dBuffer)

Constructor Summary
Ding3dBuffer()
          Constructs a Ding3dBuffer object and initializes it with a null NIO buffer object.
Ding3dBuffer(java.nio.Buffer buffer)
          Constructs a Ding3dBuffer object and initializes it with the specified NIO buffer object.
 
Method Summary
 java.nio.Buffer getBuffer()
          Retrieves the NIO buffer object from this Ding3dBuffer.
 void setBuffer(java.nio.Buffer buffer)
          Sets the NIO buffer object in this Ding3dBuffer to the specified object.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Ding3dBuffer

public Ding3dBuffer()
Constructs a Ding3dBuffer object and initializes it with a null NIO buffer object. The NIO buffer object must be set to a non-null value before using this Ding3dBuffer object in a Java 3D node component.

Throws:
java.lang.UnsupportedOperationException - if the JVM does not support native access to direct NIO buffers

Ding3dBuffer

public Ding3dBuffer(java.nio.Buffer buffer)
Constructs a Ding3dBuffer object and initializes it with the specified NIO buffer object.

Parameters:
buffer - the NIO buffer wrapped by this Ding3dBuffer
Throws:
java.lang.UnsupportedOperationException - if the JVM does not support native access to direct NIO buffers
java.lang.IllegalArgumentException - if the specified buffer is not a direct buffer, or if the byte order of the specified buffer does not match the native byte order of the underlying platform.
Method Detail

setBuffer

public void setBuffer(java.nio.Buffer buffer)
Sets the NIO buffer object in this Ding3dBuffer to the specified object.

Parameters:
buffer - the NIO buffer wrapped by this Ding3dBuffer
Throws:
java.lang.IllegalArgumentException - if the specified buffer is not a direct buffer, or if the byte order of the specified buffer does not match the native byte order of the underlying platform.

getBuffer

public java.nio.Buffer getBuffer()
Retrieves the NIO buffer object from this Ding3dBuffer.

Returns:
the current NIO buffer wrapped by this Ding3dBuffer