j3d.org Aviatrix3D

org.j3d.aviatrix3d
Class NodeComponent

java.lang.Object
  extended byorg.j3d.aviatrix3d.SceneGraphObject
      extended byorg.j3d.aviatrix3d.NodeComponent
Direct Known Subclasses:
Appearance, Geometry, Material, PolygonAttributes, Shader, ShaderProgram, TexCoordGeneration, Texture, TextureAttributes, TextureComponent, TextureUnit

public abstract class NodeComponent
extends SceneGraphObject

The NodeComponent class is the superclass for all non renderable nodes. These nodes provides data for other nodes.

Version:
$Revision: 1.5 $
Author:
Alan Hudson

Field Summary
protected  int liveCount
          Counter for how many times we've been marked as live so to know when to notify the children of a change of state.
 
Fields inherited from class org.j3d.aviatrix3d.SceneGraphObject
alive, updateHandler, WRITE_TIMING_MSG
 
Constructor Summary
protected NodeComponent()
          Initialise a new instance of the component, setting up the internal state needed.
 
Method Summary
protected  void addParent(SceneGraphObject p)
          Specify this nodes parent, overridden to provide behaviour that appends the node to the list rather than replacing it.
 void getParents(Node[] parents)
          Get the listing of the number of parents that this node currently has.
 boolean hasChanged()
          Has an attribute been changed.
 int numParents()
          Request the number of parents this node currently contains
protected  void removeParent(SceneGraphObject p)
          Remove a parent from this shared group.
 void renderState(net.java.games.jogl.GL gl, net.java.games.jogl.GLU glu)
          Issue ogl commands needed for this component.
 void restoreState(net.java.games.jogl.GL gl, net.java.games.jogl.GLU glu)
          Restore all openGL state.
 
Methods inherited from class org.j3d.aviatrix3d.SceneGraphObject
checkForCyclicChild, checkForCyclicParent, dataChanged, getUserData, isLive, setLive, setUpdateHandler, setUserData
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

liveCount

protected int liveCount
Counter for how many times we've been marked as live so to know when to notify the children of a change of state.

Constructor Detail

NodeComponent

protected NodeComponent()
Initialise a new instance of the component, setting up the internal state needed.

Method Detail

renderState

public void renderState(net.java.games.jogl.GL gl,
                        net.java.games.jogl.GLU glu)
Issue ogl commands needed for this component.

Parameters:
gl - The gl context to draw with
glu - The utility context to draw with

restoreState

public void restoreState(net.java.games.jogl.GL gl,
                         net.java.games.jogl.GLU glu)
Restore all openGL state.

Parameters:
gl - The gl context to draw with
glu - The utility context to draw with

addParent

protected void addParent(SceneGraphObject p)
                  throws AlreadyParentedException,
                         InvalidNodeTypeException
Specify this nodes parent, overridden to provide behaviour that appends the node to the list rather than replacing it. The parent must be a group node in this case.

Parameters:
p - The new parent instance to add to the list
Throws:
AlreadyParentedException - There is a valid parent already set
InvalidNodeTypeException - Not a group node

removeParent

protected void removeParent(SceneGraphObject p)
Remove a parent from this shared group. Since setParent() cannot be used to remove a parent from the graph, you'll need to use this method to remove the parent.

Parameters:
p - The new parent instance to remove from the list

numParents

public int numParents()
Request the number of parents this node currently contains

Returns:
a positive number

getParents

public void getParents(Node[] parents)
Get the listing of the number of parents that this node currently has. The provided array must be at least big enough to copy all the values into it.

Parameters:
parents - An array to copy the parent listing into

hasChanged

public boolean hasChanged()
Has an attribute been changed. If not then the renderState/restoreState might not be called. Components that always need to update state should set this to true.

Returns:
Has an attribute changed.

j3d.org Aviatrix3D

Latest Info from http://aviatrix3d.j3d.org/
Copyright © 2003 - j3d.org