Class OGLShape
java.lang.Object
org.web3d.vrml.renderer.common.nodes.AbstractNode
org.web3d.vrml.renderer.common.nodes.shape.BaseShape
org.web3d.vrml.renderer.ogl.nodes.shape.OGLShape
- All Implemented Interfaces:
org.j3d.aviatrix3d.NodeUpdateListener,VRMLNode,FrameStateListener,LocalColorsListener,MaterialColorListener,VRMLBoundedNodeType,VRMLChildNodeType,VRMLNodeType,VRMLShapeNodeType,VRMLWorldRootChildNodeType,OGLPickableTargetNodeType,OGLVRMLNode
public class OGLShape
extends BaseShape
implements OGLVRMLNode, OGLPickableTargetNodeType, org.j3d.aviatrix3d.NodeUpdateListener, MaterialColorListener
OGL implementation of a shape node.
- Version:
- $Revision: 1.29 $
- Author:
- Justin Couch
-
Field Summary
Fields inherited from class org.web3d.vrml.renderer.common.nodes.shape.BaseShape
APPEARANCE_NODE_MSG, APPEARANCE_PROTO_MSG, DEFAULT_FORCE_LIGHTING, FIELD_APPEARANCE, FIELD_GEOMETRY, FORCE_LIGHTING_PROP, forceLighting, GEOMETRY_NODE_MSG, GEOMETRY_PROTO_MSG, LAST_SHAPE_INDEX, NUM_FIELDS, pAppearance, pGeometry, shareCount, vfAppearance, vfBboxCenter, vfBboxDisplay, vfBboxSize, vfCastShadow, vfGeometry, vfVisibleFields inherited from class org.web3d.vrml.renderer.common.nodes.AbstractNode
errorReporter, FIELD_METADATA, fieldLocalData, hasChanged, inSetup, isDEF, isStatic, LAST_NODE_INDEX, layerIds, nodeName, pMetadata, refCounts, removedLayerIds, stateManager, STATIC_SCENE_GRAPH, vfMetadata, vrmlMajorVersion, vrmlMinorVersion -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidNotification that the rendering of the event model is complete and that rendering is about to begin.voidemissiveColorChanged(float[] color) The emissiveColor value has changed.org.j3d.aviatrix3d.picking.PickableObjectFetch the object that this target will pick against.org.j3d.aviatrix3d.SceneGraphObjectGet the OpenGL scene graph object representation of this node.voidnotifyExternProtoLoaded(int index, VRMLNodeType node) Notify a node that an ExternProto has resolved.voidsetAppearance(VRMLNodeType newAppearance) Set node content as replacement for the appearance field.voidsetGeometry(VRMLNodeType newGeometry) Set node content as replacement for geometry field.voidSet the flag convertor.voidNotification that the construction phase of this node has finished.voidNotification that its safe to update the node now with any operations that could potentially effect the node's bounds.voidNotification that its safe to update the node now with any operations that only change the node's properties, but do not change the bounds.Methods inherited from class org.web3d.vrml.renderer.common.nodes.shape.BaseShape
getAppearance, getBboxCenter, getBboxDisplay, getBboxSize, getCastShadow, getFieldDeclaration, getFieldIndex, getFieldValue, getGeometry, getNodeFieldIndices, getNumFields, getPrimaryType, getSecondaryType, getVisible, isShared, localColorsChanged, sendRoute, setBboxCenter, setBboxDisplay, setBboxSize, setCastShadow, setShared, setValue, setValue, setValue, setVisibleMethods inherited from class org.web3d.vrml.renderer.common.nodes.AbstractNode
addNodeListener, checkNodeType, checkSecondaryType, checkSecondaryType, clearRemovedLayerIds, fireFieldChanged, getLayerIds, getMetadataObject, getRefCount, getRemovedLayerIds, getUserData, getVRMLNodeName, hasFieldChanged, isDEF, isSetupFinished, removeNodeListener, setDEF, setErrorReporter, setFrameStateManager, setMetadataObject, setUserData, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setVersion, throwInitOnlyWriteException, throwInputOnlyWriteException, throwInvalidNodeException, throwInvalidProtoException, throwOutputOnlyWriteException, updateRefCount, updateRefsMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.web3d.vrml.lang.VRMLNode
getFieldDeclaration, getFieldIndex, getNodeFieldIndices, getNumFields, getPrimaryType, getSecondaryType, getUserData, getVRMLNodeName, isDEF, setErrorReporter, setUserData, setVersionMethods inherited from interface org.web3d.vrml.nodes.VRMLNodeType
addNodeListener, clearRemovedLayerIds, getFieldValue, getLayerIds, getMetadataObject, getRefCount, getRemovedLayerIds, hasFieldChanged, isSetupFinished, removeNodeListener, sendRoute, setDEF, setFrameStateManager, setMetadataObject, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, updateRefCount
-
Constructor Details
-
OGLShape
public OGLShape()Construct a new default shape node implementation. -
OGLShape
Construct a new instance of this node based on the details from the given node. If the node is not a Shape node, an exception will be thrown.- Parameters:
node- The node to copy- Throws:
IllegalArgumentException- Incorrect node type
-
-
Method Details
-
setTypeConvertor
Set the flag convertor. Ignored for this node.- Specified by:
setTypeConvertorin interfaceOGLPickableTargetNodeType- Parameters:
conv- The convertor instance to use, or null
-
getPickableObject
public org.j3d.aviatrix3d.picking.PickableObject getPickableObject()Fetch the object that this target will pick against.- Specified by:
getPickableObjectin interfaceOGLPickableTargetNodeType- Returns:
- The valid branchgroup to use
-
updateNodeBoundsChanges
Notification that its safe to update the node now with any operations that could potentially effect the node's bounds.- Specified by:
updateNodeBoundsChangesin interfaceorg.j3d.aviatrix3d.NodeUpdateListener- Parameters:
src- The node or Node Component that is to be updated.
-
updateNodeDataChanges
Notification that its safe to update the node now with any operations that only change the node's properties, but do not change the bounds.- Specified by:
updateNodeDataChangesin interfaceorg.j3d.aviatrix3d.NodeUpdateListener- Parameters:
src- The node or Node Component that is to be updated.
-
emissiveColorChanged
public void emissiveColorChanged(float[] color) The emissiveColor value has changed.- Specified by:
emissiveColorChangedin interfaceMaterialColorListener- Parameters:
color- The new color value to use
-
allEventsComplete
public void allEventsComplete()Notification that the rendering of the event model is complete and that rendering is about to begin. Used to update the transformation matrix only once per frame.- Specified by:
allEventsCompletein interfaceFrameStateListener- Overrides:
allEventsCompletein classAbstractNode
-
setAppearance
Set node content as replacement for the appearance field.- Specified by:
setAppearancein interfaceVRMLShapeNodeType- Overrides:
setAppearancein classBaseShape- Parameters:
newAppearance- The new appearance. null will act like delete- Throws:
InvalidFieldValueException- The node does not match the required type.
-
setGeometry
Set node content as replacement for geometry field.- Specified by:
setGeometryin interfaceVRMLShapeNodeType- Overrides:
setGeometryin classBaseShape- Parameters:
newGeometry- The new value for geometry. null will act like delete- Throws:
InvalidFieldValueException- The node does not match the required type.
-
notifyExternProtoLoaded
Description copied from interface:VRMLNodeTypeNotify a node that an ExternProto has resolved. This will verify the objects type and add it to the render sceneGraph.- Specified by:
notifyExternProtoLoadedin interfaceVRMLNodeType- Overrides:
notifyExternProtoLoadedin classAbstractNode- Parameters:
index- The field indexnode- The node resolved- Throws:
InvalidFieldValueException- If the proto contains he wrong type
-
getSceneGraphObject
public org.j3d.aviatrix3d.SceneGraphObject getSceneGraphObject()Get the OpenGL scene graph object representation of this node. This will need to be cast to the appropriate parent type when being used. Default implementation returns null.- Specified by:
getSceneGraphObjectin interfaceOGLVRMLNode- Returns:
- The OpenGL representation.
-
setupFinished
public void setupFinished()Notification that the construction phase of this node has finished. If the node would like to do any internal processing, such as setting up geometry, then go for it now.- Specified by:
setupFinishedin interfaceVRMLNodeType- Overrides:
setupFinishedin classBaseShape
-