org.jagatoo.geometry
Class GeomNioFloatData

java.lang.Object
  extended by org.jagatoo.geometry.GeomNioData
      extended by org.jagatoo.geometry.GeomNioFloatData

public class GeomNioFloatData
extends GeomNioData

GeomDataInterface implementation for NIO buffers


Field Summary
protected  java.nio.FloatBuffer buffer
           
 
Fields inherited from class org.jagatoo.geometry.GeomNioData
dirty
 
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.TexCoordf<?> texCoord)
           
 void get(int index, long elemOffset, org.openmali.vecmath2.TupleNf<?> 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.
 int getElemStride()
           
protected  GeomNioFloatData newInstance(int maxElements, int elemSize, int stride, boolean reversed)
           
 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.TexCoordf<?> texCoord)
           
 void set(int index, long elemOffset, org.openmali.vecmath2.TupleNf<?> tuple)
           
 void set(org.openmali.vecmath2.TexCoordf<?> texCoord)
           
 void set(org.openmali.vecmath2.TupleNf<?> 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.jagatoo.geometry.GeomNioData
getCount, getElemSize, getInitialIndex, getMaxElements, getMaxSize, getStride, isReversed, setDirty
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

buffer

protected java.nio.FloatBuffer buffer
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.

getElemStride

public final int getElemStride()

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 GeomNioData

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(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,
                      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)

set

public final void set(org.openmali.vecmath2.TupleNf<?> tuple)

set

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

set

public final void set(org.openmali.vecmath2.TexCoordf<?> texCoord)

set

public final void set(int index,
                      long elemOffset,
                      org.openmali.vecmath2.TupleNf<?> 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,
                      org.openmali.vecmath2.TexCoordf<?> texCoord)

get

public final void get(int index,
                      long elemOffset,
                      org.openmali.vecmath2.TupleNf<?> values)

get

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

get

public final void get(int index,
                      long elemOffset,
                      org.openmali.vecmath2.TexCoordf<?> texCoord)

newInstance

protected GeomNioFloatData newInstance(int maxElements,
                                       int elemSize,
                                       int stride,
                                       boolean reversed)

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