org.xith3d.render.preprocessing
Class RenderBin

java.lang.Object
  extended by org.xith3d.render.preprocessing.RenderBin

public final class RenderBin
extends java.lang.Object

A collection of RenderAtoms that will be prioritized and sorted for rendering.


Nested Class Summary
static class RenderBin.DynamicAtomArray
           
 
Constructor Summary
RenderBin(RenderBinType type, java.lang.String name, int initialCapacity)
           
 
Method Summary
 void addAtom(RenderAtom<? extends Node> atom, org.openmali.spatial.bodies.Classifier.Classification classify, long frameId)
          Adds a RenderAtom to the chain of RenderAtoms.
 void clear()
          Removes all Atoms from the RenderBin.
 void dump(StatePriorities priorities)
           
 RenderAtom<? extends Node> getAtom(int index)
           
 RenderBin.DynamicAtomArray getAtoms()
           
 java.lang.String getName()
           
 RenderAtom<? extends Node> getNextAtom()
           
 RenderBinType getType()
           
 void resetIterationPointer()
          Must be called at the beginning when the Atoms list is to be iterated.
 void shrink()
          Removes unused atoms from the RenderBin
 int size()
           
 java.lang.String toString()
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RenderBin

public RenderBin(RenderBinType type,
                 java.lang.String name,
                 int initialCapacity)
Method Detail

getType

public final RenderBinType getType()

getName

public final java.lang.String getName()

getAtoms

public final RenderBin.DynamicAtomArray getAtoms()
Returns:
the DynamicAtomArray containing all RenderBuckets in this RenderBin.

size

public final int size()
Returns:
the number of currently contained RenderAtoms

clear

public final void clear()
Removes all Atoms from the RenderBin.


shrink

public final void shrink()
Removes unused atoms from the RenderBin


getAtom

public final RenderAtom<? extends Node> getAtom(int index)
Parameters:
index - the deserved Atom's RenderBucket's index.
Returns:
the RenderAtom with the specified index in the list.

resetIterationPointer

public final void resetIterationPointer()
Must be called at the beginning when the Atoms list is to be iterated.


getNextAtom

public final RenderAtom<? extends Node> getNextAtom()
Returns:
the next RenderAtom in the iteration.
Returns null, if no more atoms are available.

addAtom

public final void addAtom(RenderAtom<? extends Node> atom,
                          org.openmali.spatial.bodies.Classifier.Classification classify,
                          long frameId)
Adds a RenderAtom to the chain of RenderAtoms. Atoms in this chain (similar to a LinkedList) will be rendered.

Parameters:
atom - the RenderAtom to be added
classify -
frameId -

dump

public void dump(StatePriorities priorities)

toString

public java.lang.String toString()

Overrides:
toString in class java.lang.Object