javax.media.j3d
Class RenderMolecule

java.lang.Object
  extended by javax.media.j3d.IndexedObject
      extended by javax.media.j3d.RenderMolecule
All Implemented Interfaces:
NodeComponentUpdate, ObjectUpdate

 class RenderMolecule
extends IndexedObject
implements ObjectUpdate, NodeComponentUpdate

The RenderMolecule manages a collection of RenderAtoms.


Field Summary
(package private)  RenderAtom addRAs
           
(package private) static int ALL_DIRTY_BITS
           
(package private)  float alpha
          The cached TransparencyAttributes transparency value.
(package private)  java.lang.Object appHandle
           
(package private)  float blue
           
(package private) static int BOUNDS_RECOMPUTE_UPDATE
           
(package private)  VertexArrayRenderMethod cachedVertexArrayRenderMethod
           
(package private)  int closestSwitchIndex
           
(package private)  SwitchRetained closestSwitchParent
           
(package private)  ColoringAttributesRetained coloringAttributes
           
(package private) static int COLORINGATTRS_DIRTY
           
(package private) static int COMPRESSED
           
(package private) static int COMPRESSED_MOLECULE
           
(package private)  float dBlue
           
(package private)  ColoringAttributesRetained definingColoringAttributes
          The ColoringAttribute reference for this RenderMolecule
(package private)  LineAttributesRetained definingLineAttributes
          The LineAttributes for this RenderMolecule
(package private)  MaterialRetained definingMaterial
          The Material reference for this RenderMolecule
(package private)  PointAttributesRetained definingPointAttributes
          The PointAttributes for this RenderMolecule
(package private)  PolygonAttributesRetained definingPolygonAttributes
          The PolygonAttributes for this RenderMolecule
(package private)  TransparencyAttributesRetained definingTransparency
          The Transparency reference for this RenderMolecule
(package private)  float dGreen
           
(package private)  int dirtyAttrsAcrossRms
          bit mask of all attr fields that are equivalent across renderMolecules
(package private)  int displayListId
           
(package private)  java.lang.Integer displayListIdObj
           
(package private) static int DLIST_MOLECULE
           
(package private)  boolean doInfinite
           
(package private)  float dRed
          Cached diffuse color value
(package private)  boolean enableLighting
          A boolean indicating whether or not lighting should be on.
(package private)  int geometryType
          The geometry type for this RenderMolecule
(package private)  float green
           
(package private) static int IN_DIRTY_RENDERMOLECULE_LIST
           
(package private)  Transform3D[] infLocalToVworld
           
(package private)  boolean inOrderedGroup
           
(package private)  boolean isNonUniformScale
          specify whether scale is nonuniform
(package private)  boolean isOpaqueOrInOG
           
(package private)  boolean isQuadGeometryArray
           
(package private)  boolean isTriGeometryArray
           
(package private) static int LINE
           
(package private)  boolean lineAA
           
(package private)  LineAttributesRetained lineAttributes
           
(package private) static int LINEATTRS_DIRTY
           
(package private)  Locale locale
           
(package private) static int LOCALE_CHANGED
           
(package private) static int LOCALE_TRANSLATION
           
(package private)  Transform3D[] localeLocalToVworld
           
(package private)  Vector3d localeTranslation
           
(package private)  Transform3D[] localToVworld
          The localToVworld for this RenderMolecule
(package private)  int[] localToVworldIndex
           
(package private)  MaterialRetained material
           
(package private) static int MATERIAL_DIRTY
           
(package private) static int NEW_RENDERATOMS_UPDATE
           
(package private)  RenderMolecule next
          The references to the next and previous RenderMolecule in the list.
(package private)  RenderMolecule nextMap
          If this is end of the linked list for this xform, then this field is non-null, if there is a map after this
(package private)  boolean normalPresent
           
(package private)  int numEditingRenderAtoms
          number of render atoms, used during the renderBin update time
(package private)  int numRenderAtoms
          number of renderAtoms to be rendered in this RenderMolecule
(package private) static int ON_UPDATE_CHECK_LIST
           
(package private)  int onUpdateList
           
(package private) static int ORIENTEDSHAPE3D_MOLECULE
           
(package private) static int POINT
          Values for the geometryType field
(package private)  boolean pointAA
           
(package private)  PointAttributesRetained pointAttributes
           
(package private) static int POINTATTRS_DIRTY
           
(package private)  PolygonAttributesRetained polygonAttributes
           
(package private) static int POLYGONATTRS_DIRTY
           
(package private)  int polygonMode
          Cached values for polygonMode, line antialiasing, and point antialiasing
(package private)  RenderMolecule prev
           
(package private)  RenderMolecule prevMap
           
(package private)  boolean primaryChanged
           
(package private)  int primaryMoleculeType
          A boolean indicating whether or not this molecule rendered Text3D
(package private)  RenderAtomListInfo primaryRenderAtomList
          The list of RenderAtoms in this RenderMolecule that are not using vertex arrays.
(package private)  RenderMethod primaryRenderMethod
          The primary renderMethod object for this RenderMolecule this is either a Text3D, display list, or compressed geometry renderer.
(package private) static int RASTER
           
(package private) static int RASTER_MOLECULE
           
(package private)  float red
          The cached ColoringAttributes color value.
(package private) static int REMOVE_RENDER_ATOM_IN_RM_LIST
           
(package private)  RenderAtom removeRAs
           
(package private) static int RENDER_MOLECULE_LIST
           
(package private)  RenderBin renderBin
          The RenderBino for this molecule
(package private) static int RM_COMPONENTS
           
(package private)  RenderMethod secondaryRenderMethod
          The secondary renderMethod object for this RenderMolecule this is used for geometry that is shared
(package private) static int SEPARATE_DLIST_PER_RINFO_MOLECULE
           
(package private)  RenderAtomListInfo separateDlistRenderAtomList
          The list of RenderAtoms in this RenderMolecule that are using separte dlist .
(package private)  boolean soleUser
          If the any of the node component of the appearance in RM will be changed frequently, then confine it to a separate bin
(package private)  int soleUserCompDirty
           
(package private) static int SURFACE
           
(package private)  int texCoordSetMapLen
          The texCoordSetMap length for this RenderMolecule.
(package private) static int TEXT3D_MOLECULE
           
(package private)  TextureBin textureBin
          The TextureBin that this RenderMolecule resides
(package private) static int TOTAL_INDEXED_UNORDER_SET_TYPES
           
(package private)  Transform3D[] trans
          Transform3D - point to the right one based on bg or not
(package private)  TransparencyAttributesRetained transparency
           
(package private) static int TRANSPARENCY_DIRTY
           
(package private) static int UPDATE_BACKGROUND_TRANSFORM
           
(package private)  boolean useAlpha
           
(package private)  RenderAtomListInfo vertexArrayRenderAtomList
          The list of RenderAtoms in this RenderMolecule that are using vertex arrays.
(package private)  int vertexFormat
          The vertex format for this RenderMolecule.
(package private)  BoundingBox vwcBounds
          This BoundingBox is used for View Frustum culling on the primary list
 
Fields inherited from class javax.media.j3d.IndexedObject
listIdx
 
Constructor Summary
RenderMolecule(GeometryAtom ga, PolygonAttributesRetained polygonAttributes, LineAttributesRetained lineAttributes, PointAttributesRetained pointAttributes, MaterialRetained material, ColoringAttributesRetained coloringAttributes, TransparencyAttributesRetained transparency, RenderingAttributesRetained renderAttrs, TextureUnitStateRetained[] texUnits, Transform3D[] transform, int[] transformIndex, RenderBin rb)
           
 
Method Summary
(package private)  void addRemoveTransparentObject(RenderBin renderBin, boolean add)
           
private  void addRemoveTransparentObject(RenderBin renderBin, boolean add, RenderAtomListInfo rinfo)
           
(package private)  void addRenderAtom(RenderAtom renderAtom, RenderBin rb)
          Adds the given RenderAtom to this RenderMolecule.
(package private)  boolean blendOn()
           
(package private)  boolean canBeInDisplayList(GeometryRetained geo, GeometryAtom ga)
           
(package private)  void checkEquivalenceWithBothNeighbors(int dirtyBits)
           
(package private)  void checkEquivalenceWithLeftNeighbor(RenderMolecule rm, int dirtyBits)
           
(package private)  boolean coloringEquivalent(RenderMolecule rm, boolean reload_color)
           
(package private)  boolean equals(RenderAtom ra, PolygonAttributesRetained polygonAttributes, LineAttributesRetained lineAttributes, PointAttributesRetained pointAttributes, MaterialRetained material, ColoringAttributesRetained coloringAttributes, TransparencyAttributesRetained transparency, Transform3D[] transform)
          This tests if the given attributes matches this TextureBin
(package private)  void evalAlphaUsage(RenderingAttributesRetained renderAttrs, TextureUnitStateRetained[] texUnits)
           
(package private)  void evalMaterialCachedState()
           
(package private)  int evalRinfoGroupType(RenderAtomListInfo r)
           
(package private)  boolean geoNotAltered(GeometryArrayRetained geo)
           
(package private)  VirtualUniverse getVirtualUniverse()
           
(package private)  void handleLocaleChange()
           
(package private)  void handleMaterialEquivalence()
           
(package private)  boolean isOpaque()
           
(package private)  boolean isSwitchOn()
           
(package private)  void markBitsAsDirty(int leftBits, int rightBits)
           
(package private)  boolean materialEquivalent(RenderMolecule rm, boolean reloadColor)
           
(package private)  void recalcBounds()
          Recalculates the vwcBounds for a RenderMolecule
(package private)  void reEvaluateEquivalence()
           
(package private)  void releaseAllPrimaryDisplayListID()
           
(package private)  void releaseAllPrimaryDisplayListResources(Canvas3D cv, Context ctx)
           
(package private)  boolean reloadColor(RenderMolecule rm)
           
(package private)  void removeRenderAtom(RenderAtom r)
          Removes the given RenderAtom from this RenderMolecule.
(package private)  boolean render(Canvas3D cv, int pass, int dirtyBits)
          Renders this RenderMolecule
(package private)  void reset(GeometryAtom ga, PolygonAttributesRetained polygonAttributes, LineAttributesRetained lineAttributes, PointAttributesRetained pointAttributes, MaterialRetained material, ColoringAttributesRetained coloringAttributes, TransparencyAttributesRetained transparency, RenderingAttributesRetained renderAttrs, TextureUnitStateRetained[] texUnits, Transform3D[] transform, int[] transformIndex)
           
(package private)  void translate()
           
(package private)  boolean transparencyEquivalent(RenderMolecule rm)
           
(package private)  void transparentSortRender(Canvas3D cv, int pass, TransparentRenderingInfo tinfo)
           
(package private)  void updateAllPrimaryDisplayLists(Canvas3D cv)
           
(package private)  void updateAttributes(Canvas3D cv, int dirtyBits)
           
(package private)  void updateDisplayList(Canvas3D cv)
           
(package private)  boolean updateNodeComponent()
           
 void updateNodeComponentCheck()
          updateNodeComponentCheck is called for each soleUser RenderMolecule into which new renderAtom has been added.
 void updateObject()
          The actual update function.
 void updateRemoveRenderAtoms()
           
(package private)  void updateTransparencyAttributes(Canvas3D cv)
          This render method is used to render the transparency attributes.
 
Methods inherited from class javax.media.j3d.IndexedObject
getIdxUsed, incIdxUsed
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

REMOVE_RENDER_ATOM_IN_RM_LIST

static final int REMOVE_RENDER_ATOM_IN_RM_LIST
See Also:
Constant Field Values

RENDER_MOLECULE_LIST

static final int RENDER_MOLECULE_LIST
See Also:
Constant Field Values

TOTAL_INDEXED_UNORDER_SET_TYPES

static final int TOTAL_INDEXED_UNORDER_SET_TYPES
See Also:
Constant Field Values

POINT

static final int POINT
Values for the geometryType field

See Also:
Constant Field Values

LINE

static final int LINE
See Also:
Constant Field Values

SURFACE

static final int SURFACE
See Also:
Constant Field Values

RASTER

static final int RASTER
See Also:
Constant Field Values

COMPRESSED

static final int COMPRESSED
See Also:
Constant Field Values

RM_COMPONENTS

static int RM_COMPONENTS

polygonAttributes

PolygonAttributesRetained polygonAttributes

lineAttributes

LineAttributesRetained lineAttributes

pointAttributes

PointAttributesRetained pointAttributes

material

MaterialRetained material

coloringAttributes

ColoringAttributesRetained coloringAttributes

transparency

TransparencyAttributesRetained transparency

normalPresent

boolean normalPresent

POINTATTRS_DIRTY

static final int POINTATTRS_DIRTY
See Also:
Constant Field Values

LINEATTRS_DIRTY

static final int LINEATTRS_DIRTY
See Also:
Constant Field Values

POLYGONATTRS_DIRTY

static final int POLYGONATTRS_DIRTY
See Also:
Constant Field Values

MATERIAL_DIRTY

static final int MATERIAL_DIRTY
See Also:
Constant Field Values

TRANSPARENCY_DIRTY

static final int TRANSPARENCY_DIRTY
See Also:
Constant Field Values

COLORINGATTRS_DIRTY

static final int COLORINGATTRS_DIRTY
See Also:
Constant Field Values

ALL_DIRTY_BITS

static final int ALL_DIRTY_BITS
See Also:
Constant Field Values

dirtyAttrsAcrossRms

int dirtyAttrsAcrossRms
bit mask of all attr fields that are equivalent across renderMolecules


soleUserCompDirty

int soleUserCompDirty

definingPolygonAttributes

PolygonAttributesRetained definingPolygonAttributes
The PolygonAttributes for this RenderMolecule


definingLineAttributes

LineAttributesRetained definingLineAttributes
The LineAttributes for this RenderMolecule


definingPointAttributes

PointAttributesRetained definingPointAttributes
The PointAttributes for this RenderMolecule


textureBin

TextureBin textureBin
The TextureBin that this RenderMolecule resides


localToVworld

Transform3D[] localToVworld
The localToVworld for this RenderMolecule


localToVworldIndex

int[] localToVworldIndex

definingMaterial

MaterialRetained definingMaterial
The Material reference for this RenderMolecule


definingColoringAttributes

ColoringAttributesRetained definingColoringAttributes
The ColoringAttribute reference for this RenderMolecule


definingTransparency

TransparencyAttributesRetained definingTransparency
The Transparency reference for this RenderMolecule


trans

Transform3D[] trans
Transform3D - point to the right one based on bg or not


isNonUniformScale

boolean isNonUniformScale
specify whether scale is nonuniform


numRenderAtoms

int numRenderAtoms
number of renderAtoms to be rendered in this RenderMolecule


numEditingRenderAtoms

int numEditingRenderAtoms
number of render atoms, used during the renderBin update time


addRAs

RenderAtom addRAs

removeRAs

RenderAtom removeRAs

red

float red
The cached ColoringAttributes color value. It is 1.0, 1.0, 1.0 if there is no ColoringAttributes.


green

float green

blue

float blue

dRed

float dRed
Cached diffuse color value


dGreen

float dGreen

dBlue

float dBlue

alpha

float alpha
The cached TransparencyAttributes transparency value. It is 0.0 if there is no TransparencyAttributes.


geometryType

int geometryType
The geometry type for this RenderMolecule


enableLighting

boolean enableLighting
A boolean indicating whether or not lighting should be on.


primaryMoleculeType

int primaryMoleculeType
A boolean indicating whether or not this molecule rendered Text3D


COMPRESSED_MOLECULE

static int COMPRESSED_MOLECULE

TEXT3D_MOLECULE

static int TEXT3D_MOLECULE

DLIST_MOLECULE

static int DLIST_MOLECULE

RASTER_MOLECULE

static int RASTER_MOLECULE

ORIENTEDSHAPE3D_MOLECULE

static int ORIENTEDSHAPE3D_MOLECULE

SEPARATE_DLIST_PER_RINFO_MOLECULE

static int SEPARATE_DLIST_PER_RINFO_MOLECULE

polygonMode

int polygonMode
Cached values for polygonMode, line antialiasing, and point antialiasing


lineAA

boolean lineAA

pointAA

boolean pointAA

vertexFormat

int vertexFormat
The vertex format for this RenderMolecule. Only looked at for GeometryArray and CompressedGeometry objects.


texCoordSetMapLen

int texCoordSetMapLen
The texCoordSetMap length for this RenderMolecule.


primaryRenderMethod

RenderMethod primaryRenderMethod
The primary renderMethod object for this RenderMolecule this is either a Text3D, display list, or compressed geometry renderer.


secondaryRenderMethod

RenderMethod secondaryRenderMethod
The secondary renderMethod object for this RenderMolecule this is used for geometry that is shared


renderBin

RenderBin renderBin
The RenderBino for this molecule


next

RenderMolecule next
The references to the next and previous RenderMolecule in the list.


prev

RenderMolecule prev

primaryRenderAtomList

RenderAtomListInfo primaryRenderAtomList
The list of RenderAtoms in this RenderMolecule that are not using vertex arrays.


separateDlistRenderAtomList

RenderAtomListInfo separateDlistRenderAtomList
The list of RenderAtoms in this RenderMolecule that are using separte dlist .


vertexArrayRenderAtomList

RenderAtomListInfo vertexArrayRenderAtomList
The list of RenderAtoms in this RenderMolecule that are using vertex arrays.


vwcBounds

BoundingBox vwcBounds
This BoundingBox is used for View Frustum culling on the primary list


nextMap

RenderMolecule nextMap
If this is end of the linked list for this xform, then this field is non-null, if there is a map after this


prevMap

RenderMolecule prevMap

soleUser

boolean soleUser
If the any of the node component of the appearance in RM will be changed frequently, then confine it to a separate bin


appHandle

java.lang.Object appHandle

cachedVertexArrayRenderMethod

VertexArrayRenderMethod cachedVertexArrayRenderMethod

isQuadGeometryArray

boolean isQuadGeometryArray

isTriGeometryArray

boolean isTriGeometryArray

displayListId

int displayListId

displayListIdObj

java.lang.Integer displayListIdObj

onUpdateList

int onUpdateList

NEW_RENDERATOMS_UPDATE

static int NEW_RENDERATOMS_UPDATE

BOUNDS_RECOMPUTE_UPDATE

static int BOUNDS_RECOMPUTE_UPDATE

LOCALE_TRANSLATION

static int LOCALE_TRANSLATION

UPDATE_BACKGROUND_TRANSFORM

static int UPDATE_BACKGROUND_TRANSFORM

IN_DIRTY_RENDERMOLECULE_LIST

static int IN_DIRTY_RENDERMOLECULE_LIST

LOCALE_CHANGED

static int LOCALE_CHANGED

ON_UPDATE_CHECK_LIST

static int ON_UPDATE_CHECK_LIST

doInfinite

boolean doInfinite

infLocalToVworld

Transform3D[] infLocalToVworld

useAlpha

boolean useAlpha

locale

Locale locale

localeLocalToVworld

Transform3D[] localeLocalToVworld

localeTranslation

Vector3d localeTranslation

primaryChanged

boolean primaryChanged

isOpaqueOrInOG

boolean isOpaqueOrInOG

inOrderedGroup

boolean inOrderedGroup

closestSwitchParent

SwitchRetained closestSwitchParent

closestSwitchIndex

int closestSwitchIndex
Constructor Detail

RenderMolecule

RenderMolecule(GeometryAtom ga,
               PolygonAttributesRetained polygonAttributes,
               LineAttributesRetained lineAttributes,
               PointAttributesRetained pointAttributes,
               MaterialRetained material,
               ColoringAttributesRetained coloringAttributes,
               TransparencyAttributesRetained transparency,
               RenderingAttributesRetained renderAttrs,
               TextureUnitStateRetained[] texUnits,
               Transform3D[] transform,
               int[] transformIndex,
               RenderBin rb)
Method Detail

reset

void reset(GeometryAtom ga,
           PolygonAttributesRetained polygonAttributes,
           LineAttributesRetained lineAttributes,
           PointAttributesRetained pointAttributes,
           MaterialRetained material,
           ColoringAttributesRetained coloringAttributes,
           TransparencyAttributesRetained transparency,
           RenderingAttributesRetained renderAttrs,
           TextureUnitStateRetained[] texUnits,
           Transform3D[] transform,
           int[] transformIndex)

equals

boolean equals(RenderAtom ra,
               PolygonAttributesRetained polygonAttributes,
               LineAttributesRetained lineAttributes,
               PointAttributesRetained pointAttributes,
               MaterialRetained material,
               ColoringAttributesRetained coloringAttributes,
               TransparencyAttributesRetained transparency,
               Transform3D[] transform)
This tests if the given attributes matches this TextureBin


updateRemoveRenderAtoms

public void updateRemoveRenderAtoms()

updateObject

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

Specified by:
updateObject in interface ObjectUpdate

canBeInDisplayList

boolean canBeInDisplayList(GeometryRetained geo,
                           GeometryAtom ga)

geoNotAltered

final boolean geoNotAltered(GeometryArrayRetained geo)

evalRinfoGroupType

int evalRinfoGroupType(RenderAtomListInfo r)

addRenderAtom

void addRenderAtom(RenderAtom renderAtom,
                   RenderBin rb)
Adds the given RenderAtom to this RenderMolecule.


removeRenderAtom

void removeRenderAtom(RenderAtom r)
Removes the given RenderAtom from this RenderMolecule.


recalcBounds

void recalcBounds()
Recalculates the vwcBounds for a RenderMolecule


evalAlphaUsage

void evalAlphaUsage(RenderingAttributesRetained renderAttrs,
                    TextureUnitStateRetained[] texUnits)

isSwitchOn

final boolean isSwitchOn()

render

boolean render(Canvas3D cv,
               int pass,
               int dirtyBits)
Renders this RenderMolecule


updateAttributes

void updateAttributes(Canvas3D cv,
                      int dirtyBits)

transparentSortRender

void transparentSortRender(Canvas3D cv,
                           int pass,
                           TransparentRenderingInfo tinfo)

updateTransparencyAttributes

void updateTransparencyAttributes(Canvas3D cv)
This render method is used to render the transparency attributes. It is used in the multi-texture multi-pass case to reset the transparency attributes to what it was


updateDisplayList

void updateDisplayList(Canvas3D cv)

releaseAllPrimaryDisplayListID

void releaseAllPrimaryDisplayListID()

releaseAllPrimaryDisplayListResources

void releaseAllPrimaryDisplayListResources(Canvas3D cv,
                                           Context ctx)

updateAllPrimaryDisplayLists

void updateAllPrimaryDisplayLists(Canvas3D cv)

checkEquivalenceWithBothNeighbors

void checkEquivalenceWithBothNeighbors(int dirtyBits)

reloadColor

boolean reloadColor(RenderMolecule rm)

checkEquivalenceWithLeftNeighbor

void checkEquivalenceWithLeftNeighbor(RenderMolecule rm,
                                      int dirtyBits)

translate

void translate()

isOpaque

boolean isOpaque()

updateNodeComponent

boolean updateNodeComponent()

addRemoveTransparentObject

void addRemoveTransparentObject(RenderBin renderBin,
                                boolean add)

addRemoveTransparentObject

private void addRemoveTransparentObject(RenderBin renderBin,
                                        boolean add,
                                        RenderAtomListInfo rinfo)

evalMaterialCachedState

void evalMaterialCachedState()

markBitsAsDirty

void markBitsAsDirty(int leftBits,
                     int rightBits)

handleMaterialEquivalence

void handleMaterialEquivalence()

reEvaluateEquivalence

void reEvaluateEquivalence()

materialEquivalent

boolean materialEquivalent(RenderMolecule rm,
                           boolean reloadColor)

coloringEquivalent

boolean coloringEquivalent(RenderMolecule rm,
                           boolean reload_color)

transparencyEquivalent

boolean transparencyEquivalent(RenderMolecule rm)

blendOn

boolean blendOn()

getVirtualUniverse

VirtualUniverse getVirtualUniverse()
Specified by:
getVirtualUniverse in class IndexedObject

handleLocaleChange

void handleLocaleChange()

updateNodeComponentCheck

public void updateNodeComponentCheck()
updateNodeComponentCheck is called for each soleUser RenderMolecule into which new renderAtom has been added. This method is called before updateNodeComponent() to allow RenderMolecule to catch any node component changes that have been missed because the changes come when there is no active renderAtom associated with the TextureBin. See bug# 4503926 for details.

Specified by:
updateNodeComponentCheck in interface NodeComponentUpdate


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