Class OGLPrimitivePickSensor
java.lang.Object
org.web3d.vrml.renderer.common.nodes.AbstractNode
org.web3d.vrml.renderer.common.nodes.BaseSensorNode
org.web3d.vrml.renderer.common.nodes.picking.BasePickingNode
org.web3d.vrml.renderer.common.nodes.picking.BasePrimitivePickSensor
org.web3d.vrml.renderer.ogl.nodes.picking.OGLPrimitivePickSensor
- All Implemented Interfaces:
VRMLNode
,FrameStateListener
,VRMLChildNodeType
,VRMLNodeType
,VRMLPickingSensorNodeType
,VRMLSensorNodeType
,VRMLWorldRootChildNodeType
,OGLPickingSensorNodeType
,OGLVRMLNode
public class OGLPrimitivePickSensor
extends BasePrimitivePickSensor
implements OGLPickingSensorNodeType
OpenGL-renderer implementation of a PrimitivePickSensor node.
- Version:
- $Revision: 1.3 $
- Author:
- Justin Couch
-
Field Summary
Fields inherited from class org.web3d.vrml.renderer.common.nodes.picking.BasePrimitivePickSensor
LAST_PRIMITIVE_INDEX, NUM_FIELDS, PRIMITIVE_NODE_MSG, PRIMITIVE_PROTO_MSG
Fields inherited from class org.web3d.vrml.renderer.common.nodes.picking.BasePickingNode
FIELD_INTERSECTION_TYPE, FIELD_OBJECT_TYPE, FIELD_PICK_TARGET, FIELD_PICKED_GEOMETRY, FIELD_PICKING_GEOMETRY, FIELD_SORT_ORDER, GEOMETRY_NODE_MSG, GEOMETRY_PROTO_MSG, intersectionType, intersectTypeMap, LAST_PICK_INDEX, numPickedGeometry, numPickTarget, pPickingGeometry, sortType, sortTypeMap, validGeometryNodeNames, vfIntersectionType, vfObjectType, vfPickedGeometry, vfPickingGeometry, vfPickTarget, vfSortOrder
Fields inherited from class org.web3d.vrml.renderer.common.nodes.BaseSensorNode
FIELD_ENABLED, FIELD_IS_ACTIVE, LAST_SENSOR_INDEX, vfEnabled, vfIsActive
Fields 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
Fields inherited from interface org.web3d.vrml.nodes.VRMLPickingSensorNodeType
BOX_PICK, CONE_PICK, CYLINDER_PICK, INTERSECT_BOUNDS, INTERSECT_GEOMETRY, LINE_PICK, POINT_PICK, SORT_ALL, SORT_ALL_SORTED, SORT_ANY, SORT_CLOSEST, SPHERE_PICK, UNDEFINED_PICK, VOLUME_PICK
-
Constructor Summary
ConstructorsConstructorDescriptionConstruct a new time sensor objectConstruct a new instance of this node based on the details from the given node. -
Method Summary
Modifier and TypeMethodDescriptionorg.j3d.aviatrix3d.Group
Fetch the parent grouping node from this sensor so that we can track back up the stack for the world transformation.int
Get the int mask used to perform picking with.org.j3d.aviatrix3d.SceneGraphObject
Get the Java3D scene graph object representation of this node.Get the set of target PickableObjects that this sensor manages.org.j3d.aviatrix3d.picking.PickableObject[]
Get the collection of ra target PickableObjects that this sensor manages.void
setObjectType
(String[] types, int numValid) Set the list of picking targets that this object corresponds to.void
setParentGroup
(org.j3d.aviatrix3d.Group group) Set a parent to this sensor.void
Set the flag convertor that will be used to map the object type strings to the internal pick masks.protected void
updateChildren
(VRMLNodeType[] targets, int numValid) Update the child list with the new nodes.Methods inherited from class org.web3d.vrml.renderer.common.nodes.picking.BasePrimitivePickSensor
getFieldDeclaration, getFieldIndex, getNodeFieldIndices, getNumFields, getPickingType, setPickingGeometry
Methods inherited from class org.web3d.vrml.renderer.common.nodes.picking.BasePickingNode
checkPickTargetType, copy, getFieldValue, getIntersectionType, getObjectType, getPickingGeometry, getPickingTargets, getPrimaryType, getSortOrder, notifyPickChange, notifyPickEnd, notifyPickStart, numObjectType, sendRoute, setEnabled, setupFinished, setValue, setValue, setValue, setValue
Methods inherited from class org.web3d.vrml.renderer.common.nodes.BaseSensorNode
copy, getEnabled, getIsActive, setValue
Methods inherited from class org.web3d.vrml.renderer.common.nodes.AbstractNode
addNodeListener, allEventsComplete, checkNodeType, checkSecondaryType, checkSecondaryType, clearRemovedLayerIds, fireFieldChanged, getLayerIds, getMetadataObject, getRefCount, getRemovedLayerIds, getSecondaryType, getUserData, getVRMLNodeName, hasFieldChanged, isDEF, isSetupFinished, notifyExternProtoLoaded, removeNodeListener, setDEF, setErrorReporter, setFrameStateManager, setMetadataObject, setUserData, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setVersion, throwInitOnlyWriteException, throwInputOnlyWriteException, throwInvalidNodeException, throwInvalidProtoException, throwOutputOnlyWriteException, updateRefCount, updateRefs
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.web3d.vrml.nodes.FrameStateListener
allEventsComplete
Methods inherited from interface org.web3d.vrml.lang.VRMLNode
getFieldDeclaration, getFieldIndex, getNodeFieldIndices, getNumFields, getPrimaryType, getSecondaryType, getUserData, getVRMLNodeName, isDEF, setErrorReporter, setUserData, setVersion
Methods inherited from interface org.web3d.vrml.nodes.VRMLNodeType
addNodeListener, clearRemovedLayerIds, getFieldValue, getLayerIds, getMetadataObject, getRefCount, getRemovedLayerIds, hasFieldChanged, isSetupFinished, notifyExternProtoLoaded, removeNodeListener, sendRoute, setDEF, setFrameStateManager, setMetadataObject, setupFinished, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, updateRefCount
Methods inherited from interface org.web3d.vrml.nodes.VRMLPickingSensorNodeType
getIntersectionType, getObjectType, getPickingGeometry, getPickingTargets, getPickingType, getSortOrder, notifyPickChange, notifyPickEnd, notifyPickStart, numObjectType, setPickingGeometry
Methods inherited from interface org.web3d.vrml.nodes.VRMLSensorNodeType
getEnabled, getIsActive, setEnabled
-
Constructor Details
-
OGLPrimitivePickSensor
public OGLPrimitivePickSensor()Construct a new time sensor object -
OGLPrimitivePickSensor
Construct a new instance of this node based on the details from the given node. If the node is not the same type, an exception will be thrown.- Parameters:
node
- The node to copy- Throws:
IllegalArgumentException
- The node is not the same type
-
-
Method Details
-
setParentGroup
public void setParentGroup(org.j3d.aviatrix3d.Group group) Set a parent to this sensor. Really doesn't matter if one overwrites another. The parent should only be needed to work out where the sensor is in world space coordinates, since the sensor itself never has an underlying scene graph object representation. In addition, if a picking sensor has more than one parent in the transformation hierarchy, the results are entirely bogus anyway.- Specified by:
setParentGroup
in interfaceOGLPickingSensorNodeType
- Parameters:
group
- The parent group of this sensor
-
getParentGroup
public org.j3d.aviatrix3d.Group getParentGroup()Fetch the parent grouping node from this sensor so that we can track back up the stack for the world transformation.- Specified by:
getParentGroup
in interfaceOGLPickingSensorNodeType
- Returns:
- The currently set parent transform
-
getTargetMapping
Get the set of target PickableObjects that this sensor manages. If there are none, return an empty set.- Specified by:
getTargetMapping
in interfaceOGLPickingSensorNodeType
- Returns:
- A set of OGL nodes mapped to their VRML wrapper
-
getTargetObjects
public org.j3d.aviatrix3d.picking.PickableObject[] getTargetObjects()Get the collection of ra target PickableObjects that this sensor manages.- Specified by:
getTargetObjects
in interfaceOGLPickingSensorNodeType
- Returns:
- A set of OGL nodes for pick testing
-
setTypeConvertor
Set the flag convertor that will be used to map the object type strings to the internal pick masks. A value of null will clear the current instance.- Specified by:
setTypeConvertor
in interfaceOGLPickingSensorNodeType
- Parameters:
conv
- The convertor instance to use, or null
-
getPickMask
public int getPickMask()Get the int mask used to perform picking with. This is the mask generated after passing the collection of pick string flags through the picking flag convertor.- Specified by:
getPickMask
in interfaceOGLPickingSensorNodeType
- Returns:
- The pick bitmask to use
-
setObjectType
Set the list of picking targets that this object corresponds to. These can be an array of strings.- Specified by:
setObjectType
in interfaceVRMLPickingSensorNodeType
- Overrides:
setObjectType
in classBasePickingNode
- Parameters:
types
- The list of object type strings to usenumValid
- The number of valid values to read from the array
-
getSceneGraphObject
public org.j3d.aviatrix3d.SceneGraphObject getSceneGraphObject()Get the Java3D scene graph object representation of this node. This will need to be cast to the appropriate parent type when being used.- Specified by:
getSceneGraphObject
in interfaceOGLVRMLNode
- Returns:
- The OGL representation.
-
updateChildren
Update the child list with the new nodes. This is called after all the basic filtering has been complete and may be overridden by derived classes if needed. The default implementation is empty.- Overrides:
updateChildren
in classBasePickingNode
- Parameters:
targets
- The list of current childrennumValid
- The number of valid children to check
-