javax.media.j3d
Class TextureBin

java.lang.Object
  extended by javax.media.j3d.TextureBin
All Implemented Interfaces:
ObjectUpdate

 class TextureBin
extends java.lang.Object
implements ObjectUpdate

The TextureBin manages a collection of TextureSetting objects. All objects in the TextureBin share the same Texture reference.


Field Summary
(package private)  java.util.HashMap addOpaqueRMs
          The hashMap of RenderMolecules in this TextureBin this is used in rendering, the key used is localToVworld
(package private)  java.util.HashMap addTransparentRMs
           
(package private)  AppearanceRetained app
          If any of the texture reference in an appearance is frequently changable, then a separate TextureBin will be created for this appearance, and this TextureBin is marked as the sole user of this appearance, and app will be pointing to the appearance being referenced by this TextureBin.
(package private)  AttributeBin attributeBin
          The AttributeBin that this TextureBin resides
(package private) static int CONTIGUOUS_ACTIVE_UNITS
           
(package private)  EnvironmentSet environmentSet
          The EnvironmentSet that this TextureBin resides
(package private)  int equivalent
          Oring of the equivalence bits for all appearance attrs under this renderBin
private  int lastActiveTexUnitIndex
           
(package private)  TextureBin next
          The references to the next and previous TextureBins in the list.
private  int numActiveTexUnit
           
(package private)  int numEditingRenderMolecules
           
(package private)  int numRenderMolecules
           
(package private) static int ON_RENDER_BIN_LIST
           
(package private) static int ON_UPDATE_CHECK_LIST
           
(package private) static int ON_UPDATE_LIST
           
(package private)  java.util.HashMap opaqueRenderMoleculeMap
           
(package private)  RenderMolecule opaqueRMList
           
(package private)  TransparentRenderingInfo parentTInfo
           
(package private)  TextureBin prev
           
(package private)  RenderBin renderBin
          The RenderBin for this object
(package private) static int RESORT
           
(package private)  ShaderBin shaderBin
          The ShaderBin that this TextureBin resides
(package private) static int SOLE_USER
           
(package private) static int SOLE_USER_DIRTY_REF
           
(package private) static int SOLE_USER_DIRTY_TA
           
(package private) static int SOLE_USER_DIRTY_TC
           
(package private) static int SOLE_USER_DIRTY_TEXTURE
           
(package private) static int SOLE_USER_DIRTY_TUS
           
(package private)  int soleUserCompDirty
          Sole user node component dirty mask.
(package private)  int tbFlag
           
(package private)  TextureUnitStateRetained[] texUnitState
           
(package private)  java.util.HashMap transparentRenderMoleculeMap
           
(package private)  RenderMolecule transparentRMList
           
(package private) static int USE_DISPLAYLIST
           
(package private) static int USE_VERTEXARRAY
           
 
Constructor Summary
TextureBin(TextureUnitStateRetained[] state, AppearanceRetained app, RenderBin rb)
           
 
Method Summary
(package private)  RenderMolecule addAll(java.util.HashMap renderMoleculeMap, java.util.HashMap addRMs, RenderMolecule startList, boolean opaqueList)
          Each list of renderMoledule with the same localToVworld is connect by rm.next and rm.prev.
(package private)  void addRenderMolecule(RenderMolecule r, RenderBin rb)
          Adds the given RenderMolecule to this TextureBin
(package private)  void changeLists(RenderMolecule r)
           
(package private)  void clear()
          The TextureBin is to be removed from RenderBin, do the proper unsetting of any references
(package private)  void decrActiveRenderMolecule()
           
(package private)  boolean equals(TextureUnitStateRetained[] state, RenderAtom ra)
          This tests if the qiven textureUnitState matches this TextureBin
(package private)  void incrActiveRenderMolecule()
           
(package private)  RenderMolecule insertRenderMolecule(RenderMolecule r, RenderMolecule renderMoleculeList)
           
(package private)  void markDlistAsDirty(RenderMolecule r)
           
(package private)  RenderMolecule removeOneRM(RenderMolecule r, java.util.HashMap allMap, RenderMolecule list)
           
(package private)  void removeRenderMolecule(RenderMolecule r)
          Removes the given RenderMolecule from this TextureBin
(package private)  void render(Canvas3D cv)
          Renders this TextureBin
(package private)  void render(Canvas3D cv, java.lang.Object rlist)
           
(package private)  void renderList(Canvas3D cv, int pass, java.lang.Object rlist)
          render a render list
(package private)  void renderList(Canvas3D cv, int pass, RenderMolecule rlist)
          render list of RenderMolecule
(package private)  void renderList(Canvas3D cv, int pass, TransparentRenderingInfo tinfo)
          render sorted transparent list
(package private)  void reset(TextureUnitStateRetained[] state, AppearanceRetained app)
          For now, clone everything just like the other NodeComponent
(package private)  void resetTextureState(TextureUnitStateRetained[] state)
           
(package private)  void updateAttributes(Canvas3D cv)
          This method is called to update the state for this TextureBin.
 void updateNodeComponent()
          updateNodeComponent is called from RenderBin to update the clone copy of the sole user node component in TextureBin when the corresponding node component is being modified
 void updateObject()
          The actual update function.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

texUnitState

TextureUnitStateRetained[] texUnitState

lastActiveTexUnitIndex

private int lastActiveTexUnitIndex

numActiveTexUnit

private int numActiveTexUnit

renderBin

RenderBin renderBin
The RenderBin for this object


environmentSet

EnvironmentSet environmentSet
The EnvironmentSet that this TextureBin resides


attributeBin

AttributeBin attributeBin
The AttributeBin that this TextureBin resides


shaderBin

ShaderBin shaderBin
The ShaderBin that this TextureBin resides


next

TextureBin next
The references to the next and previous TextureBins in the list.


prev

TextureBin prev

equivalent

int equivalent
Oring of the equivalence bits for all appearance attrs under this renderBin


app

AppearanceRetained app
If any of the texture reference in an appearance is frequently changable, then a separate TextureBin will be created for this appearance, and this TextureBin is marked as the sole user of this appearance, and app will be pointing to the appearance being referenced by this TextureBin. Otherwise, app is null


soleUserCompDirty

int soleUserCompDirty
Sole user node component dirty mask. The first bit is reserved for node component reference dirty bit. It is set if any of the texture related node component reference in the appearance is being modified. The second bit onwords are for the individual TextureUnitState dirty bit. The ith bit set means the (i-1) texture unit state is modified. Note, this mask only supports 30 texture unit states. If the appearance uses more than 31 texture unit states, then the modification of the 32nd texture unit state and up will have the first bit set, that means the TextureBin will be reset, rather than only the particular texture unit state will be reset.


SOLE_USER_DIRTY_REF

static final int SOLE_USER_DIRTY_REF
See Also:
Constant Field Values

SOLE_USER_DIRTY_TA

static final int SOLE_USER_DIRTY_TA
See Also:
Constant Field Values

SOLE_USER_DIRTY_TC

static final int SOLE_USER_DIRTY_TC
See Also:
Constant Field Values

SOLE_USER_DIRTY_TEXTURE

static final int SOLE_USER_DIRTY_TEXTURE
See Also:
Constant Field Values

SOLE_USER_DIRTY_TUS

static final int SOLE_USER_DIRTY_TUS
See Also:
Constant Field Values

addOpaqueRMs

java.util.HashMap addOpaqueRMs
The hashMap of RenderMolecules in this TextureBin this is used in rendering, the key used is localToVworld


addTransparentRMs

java.util.HashMap addTransparentRMs

opaqueRenderMoleculeMap

java.util.HashMap opaqueRenderMoleculeMap

transparentRenderMoleculeMap

java.util.HashMap transparentRenderMoleculeMap

opaqueRMList

RenderMolecule opaqueRMList

transparentRMList

RenderMolecule transparentRMList

parentTInfo

TransparentRenderingInfo parentTInfo

numRenderMolecules

int numRenderMolecules

numEditingRenderMolecules

int numEditingRenderMolecules

tbFlag

int tbFlag

ON_RENDER_BIN_LIST

static final int ON_RENDER_BIN_LIST
See Also:
Constant Field Values

ON_UPDATE_LIST

static final int ON_UPDATE_LIST
See Also:
Constant Field Values

SOLE_USER

static final int SOLE_USER
See Also:
Constant Field Values

CONTIGUOUS_ACTIVE_UNITS

static final int CONTIGUOUS_ACTIVE_UNITS
See Also:
Constant Field Values

RESORT

static final int RESORT
See Also:
Constant Field Values

ON_UPDATE_CHECK_LIST

static final int ON_UPDATE_CHECK_LIST
See Also:
Constant Field Values

USE_DISPLAYLIST

static final int USE_DISPLAYLIST
See Also:
Constant Field Values

USE_VERTEXARRAY

static final int USE_VERTEXARRAY
See Also:
Constant Field Values
Constructor Detail

TextureBin

TextureBin(TextureUnitStateRetained[] state,
           AppearanceRetained app,
           RenderBin rb)
Method Detail

reset

void reset(TextureUnitStateRetained[] state,
           AppearanceRetained app)
For now, clone everything just like the other NodeComponent


resetTextureState

void resetTextureState(TextureUnitStateRetained[] state)

clear

void clear()
The TextureBin is to be removed from RenderBin, do the proper unsetting of any references


equals

boolean equals(TextureUnitStateRetained[] state,
               RenderAtom ra)
This tests if the qiven textureUnitState matches this TextureBin


updateNodeComponent

public void updateNodeComponent()
updateNodeComponent is called from RenderBin to update the clone copy of the sole user node component in TextureBin when the corresponding node component is being modified


updateObject

public void updateObject()
Description copied from interface: ObjectUpdate
The actual update function.

Specified by:
updateObject in interface ObjectUpdate

addAll

RenderMolecule addAll(java.util.HashMap renderMoleculeMap,
                      java.util.HashMap addRMs,
                      RenderMolecule startList,
                      boolean opaqueList)
Each list of renderMoledule with the same localToVworld is connect by rm.next and rm.prev. At the end of the list (i.e. rm.next = null) the field rm.nextMap is link to another list (with the same localToVworld). So during rendering it will traverse rm.next until this is null, then follow the .nextMap to access another list and use rm.next to continue until both rm.next and rm.nextMap are null. renderMoleculeMap is use to assist faster location of renderMolecule List with the same localToVWorld. The start of renderMolecule in the list with same localToVworld is insert in renderMoleculeMap. This map is clean up at removeRenderMolecule(). TextureBin also use the map for quick location of renderMolecule with the same localToVworld and attributes in findRenderMolecule().


insertRenderMolecule

RenderMolecule insertRenderMolecule(RenderMolecule r,
                                    RenderMolecule renderMoleculeList)

addRenderMolecule

void addRenderMolecule(RenderMolecule r,
                       RenderBin rb)
Adds the given RenderMolecule to this TextureBin


removeRenderMolecule

void removeRenderMolecule(RenderMolecule r)
Removes the given RenderMolecule from this TextureBin


updateAttributes

void updateAttributes(Canvas3D cv)
This method is called to update the state for this TextureBin. This is only applicable in the single-pass case. Multi-pass render will have to take care of its own state update.


render

void render(Canvas3D cv)
Renders this TextureBin


render

void render(Canvas3D cv,
            java.lang.Object rlist)

renderList

void renderList(Canvas3D cv,
                int pass,
                java.lang.Object rlist)
render a render list


renderList

void renderList(Canvas3D cv,
                int pass,
                RenderMolecule rlist)
render list of RenderMolecule


renderList

void renderList(Canvas3D cv,
                int pass,
                TransparentRenderingInfo tinfo)
render sorted transparent list


changeLists

void changeLists(RenderMolecule r)

removeOneRM

RenderMolecule removeOneRM(RenderMolecule r,
                           java.util.HashMap allMap,
                           RenderMolecule list)

markDlistAsDirty

void markDlistAsDirty(RenderMolecule r)

decrActiveRenderMolecule

void decrActiveRenderMolecule()

incrActiveRenderMolecule

void incrActiveRenderMolecule()


Copyright 1996-2008 Sun Microsystems, Inc. All Rights Reserved. Use is subject to license terms.