org.xith3d.scenegraph
Class GeomNioFloatData

java.lang.Object
  extended by org.xith3d.scenegraph.GeomData
      extended by org.xith3d.scenegraph.GeomNioFloatData

public class GeomNioFloatData
extends GeomData

GeomDataInterface implementation for NIO buffers


Constructor Summary
GeomNioFloatData(int maxElements, int elemSize, boolean reversed)
           
GeomNioFloatData(int maxElements, int elemSize, int stride, boolean reversed)
           
 
Method Summary
 GeomNioFloatData duplicateGeomData(boolean copy)
          Creates same type of geometry data.
 void end()
          Locks the data and sets the size()
 void get(int index, int elemSize, long elemOffset, org.openmali.vecmath2.Colorf color)
           
 void get(int index, int elemSize, long elemOffset, float[] values)
           
 void get(int index, int elemSize, long elemOffset, float[] values, int offset, int numValues)
           
 float get(int index, long elemOffset)
           
 void get(int index, long elemOffset, org.openmali.vecmath2.Tuple2f values)
           
 void get(int index, long elemOffset, org.openmali.vecmath2.Tuple3f values)
           
 void get(int index, long elemOffset, org.openmali.vecmath2.Vector4f values)
           
 java.nio.FloatBuffer getBuffer()
           
 float[] getData()
           
 void getData(float[] outBuffer)
          Gets an array with all the floats assigned in the last draw cycle.
 void getData(int index, long elemOffset, float[] outBuffer, int start, int length)
          Gets an array with all the floats assigned in the last draw cycle.
 void set(boolean alpha, org.openmali.vecmath2.Colorf color)
           
 void set(float x)
           
 void set(float[] a, int start, int length)
          Special optimized way to set a bulk amount of floats right into the data, starting at the index specified.
 void set(float x, float y)
           
 void set(float x, float y, float z)
           
 void set(float x, float y, float z, float w)
           
 void set(int index, int elemSize, long elemOffset, org.openmali.vecmath2.Colorf color)
           
 void set(int index, int elemSize, long elemOffset, float[] a)
           
 void set(int index, int elemSize, long elemOffset, float[] a, int start, int length)
           
 void set(int index, long elemOffset, float x)
           
 void set(int index, long elemOffset, float x, float y)
           
 void set(int index, long elemOffset, float x, float y, float z)
           
 void set(int index, long elemOffset, float x, float y, float z, float w)
           
 void set(int index, long elemOffset, org.openmali.vecmath2.Tuple3f tuple)
           
 void set(int index, long elemOffset, org.openmali.vecmath2.Vector4f tuple)
           
 void set(org.openmali.vecmath2.Tuple3f tuple)
           
 void set(org.openmali.vecmath2.Vector4f tuple)
           
 void setBuffer(java.nio.FloatBuffer buffer)
          Sets the NIO float buffer underlying this.
 void start()
          Resets the buffer to zero and prepares to receive data from the various set() calls.
 
Methods inherited from class org.xith3d.scenegraph.GeomData
finalize, freeOpenGLResources, getCount, getElemSize, getInitialIndex, getMaxSize, getOpenGLReferences, getStride, isReversed
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GeomNioFloatData

public GeomNioFloatData(int maxElements,
                        int elemSize,
                        int stride,
                        boolean reversed)

GeomNioFloatData

public GeomNioFloatData(int maxElements,
                        int elemSize,
                        boolean reversed)
Method Detail

setBuffer

public final void setBuffer(java.nio.FloatBuffer buffer)
Sets the NIO float buffer underlying this. If the underlying format is not a float buffer then it will be converted.


getBuffer

public final java.nio.FloatBuffer getBuffer()
Returns:
the NIO float buffer underlying this. If the underlying format is not a float buffer then it will be converted.

getData

public final float[] getData()
Returns:
an array with all the floats assigned in the last draw cycle. In some implementations this might return a copy, so only use if you have to. The data should not be changed once it is retrieved and should be considered read only.

getData

public final void getData(float[] outBuffer)
Gets an array with all the floats assigned in the last draw cycle. In some implementations this might return a copy, so only use if you have to. The data should not be changed once it is retrieved and should be considered read only.

Parameters:
buffer - the buffer array to write values to (must be of sufficient size)

getData

public final void getData(int index,
                          long elemOffset,
                          float[] outBuffer,
                          int start,
                          int length)
Gets an array with all the floats assigned in the last draw cycle. In some implementations this might return a copy, so only use if you have to. The data should not be changed once it is retrieved and should be considered read only.

Parameters:
index -
elemOffset -
outBuffer - the buffer array to write values to (must be of sufficient size)
start -
length -

start

public final void start()
Resets the buffer to zero and prepares to receive data from the various set() calls. In some implementations this will destroy data.

Overrides:
start in class GeomData

end

public final void end()
Locks the data and sets the size()


set

public final void set(float[] a,
                      int start,
                      int length)
Special optimized way to set a bulk amount of floats right into the data, starting at the index specified.

Parameters:
a -
start -
length -

set

public final void set(org.openmali.vecmath2.Tuple3f tuple)

set

public final void set(org.openmali.vecmath2.Vector4f tuple)

set

public final void set(boolean alpha,
                      org.openmali.vecmath2.Colorf color)

set

public final void set(float x)

set

public final void set(float x,
                      float y)

set

public final void set(float x,
                      float y,
                      float z)

set

public final void set(float x,
                      float y,
                      float z,
                      float w)

set

public final void set(int index,
                      int elemSize,
                      long elemOffset,
                      float[] a,
                      int start,
                      int length)

set

public final void set(int index,
                      int elemSize,
                      long elemOffset,
                      float[] a)

set

public final void set(int index,
                      long elemOffset,
                      org.openmali.vecmath2.Tuple3f tuple)

set

public final void set(int index,
                      long elemOffset,
                      org.openmali.vecmath2.Vector4f tuple)

set

public final void set(int index,
                      int elemSize,
                      long elemOffset,
                      org.openmali.vecmath2.Colorf color)

set

public final void set(int index,
                      long elemOffset,
                      float x)

set

public final void set(int index,
                      long elemOffset,
                      float x,
                      float y)

set

public final void set(int index,
                      long elemOffset,
                      float x,
                      float y,
                      float z)

set

public final void set(int index,
                      long elemOffset,
                      float x,
                      float y,
                      float z,
                      float w)

get

public final void get(int index,
                      int elemSize,
                      long elemOffset,
                      float[] values,
                      int offset,
                      int numValues)

get

public final void get(int index,
                      int elemSize,
                      long elemOffset,
                      float[] values)

get

public final float get(int index,
                       long elemOffset)

get

public final void get(int index,
                      long elemOffset,
                      org.openmali.vecmath2.Tuple2f values)

get

public final void get(int index,
                      long elemOffset,
                      org.openmali.vecmath2.Tuple3f values)

get

public final void get(int index,
                      long elemOffset,
                      org.openmali.vecmath2.Vector4f values)

get

public final void get(int index,
                      int elemSize,
                      long elemOffset,
                      org.openmali.vecmath2.Colorf color)

duplicateGeomData

public GeomNioFloatData duplicateGeomData(boolean copy)
Creates same type of geometry data.

Parameters:
copy - true if data should be copied
Returns:
new created geom data