org.jagatoo.geometry
Class GeomNioIntData

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

public class GeomNioIntData
extends GeomNioData

An implementation of the float data holder which uses a direct NIO buffer.


Field Summary
 
Fields inherited from class org.jagatoo.geometry.GeomNioData
dirty
 
Constructor Summary
GeomNioIntData(int maxElems, int elemSize, boolean reversed)
           
GeomNioIntData(int maxElems, int elemSize, int stride, boolean reversed)
           
 
Method Summary
 void end()
           
 int get(int index)
          Gets 3 values from the underlying buffer starting at position (3 * index).
 void get(int i0, int[] index)
          Gets 3 values from the underlying buffer starting at position (3 * index).
 java.nio.IntBuffer getBuffer()
           
 int[] getData()
           
protected  GeomNioIntData newInstance(int maxElems, int elemSize, int stride, boolean reversed)
           
 void set(int[] a, int start, int length)
          Special optimized way to set a bulk amount of ints right into the data, starting at the index specified.
 void set(int index, int i)
           
 void set(int index, int[] a)
           
 void set(int index, int[] a, int start, int length)
           
 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
 

Constructor Detail

GeomNioIntData

public GeomNioIntData(int maxElems,
                      int elemSize,
                      int stride,
                      boolean reversed)

GeomNioIntData

public GeomNioIntData(int maxElems,
                      int elemSize,
                      boolean reversed)
Method Detail

getBuffer

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

getData

public final int[] getData()
Returns:
an array with all the ints 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.

start

public final void start()
Description copied from class: GeomNioData
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()

set

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


set

public final void set(int index,
                      int[] a,
                      int start,
                      int length)

set

public final void set(int index,
                      int[] a)

set

public final void set(int index,
                      int i)

get

public final int get(int index)
Gets 3 values from the underlying buffer starting at position (3 * index).

Parameters:
index -
value -

get

public final void get(int i0,
                      int[] index)
Gets 3 values from the underlying buffer starting at position (3 * index).

Parameters:
index -
value -

newInstance

protected GeomNioIntData newInstance(int maxElems,
                                     int elemSize,
                                     int stride,
                                     boolean reversed)