Class OGLLinePickSensor
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.BaseLinePickSensor
org.web3d.vrml.renderer.ogl.nodes.picking.OGLLinePickSensor
- All Implemented Interfaces:
VRMLNode,FrameStateListener,VRMLChildNodeType,VRMLNodeType,VRMLPickingSensorNodeType,VRMLSensorNodeType,VRMLWorldRootChildNodeType,OGLPickingSensorNodeType,OGLVRMLNode
OpenGL renderer implementation of a LinePickSensor node.
- Version:
- $Revision: 1.3 $
- Author:
- Justin Couch
-
Field Summary
Fields inherited from class org.web3d.vrml.renderer.common.nodes.picking.BaseLinePickSensor
FIELD_PICKED_NORMAL, FIELD_PICKED_POINT, FIELD_PICKED_TEXCOORD, LAST_LINE_INDEX, LINE_NODE_MSG, LINE_PROTO_MSG, NUM_FIELDSFields 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, vfSortOrderFields inherited from class org.web3d.vrml.renderer.common.nodes.BaseSensorNode
FIELD_ENABLED, FIELD_IS_ACTIVE, LAST_SENSOR_INDEX, vfEnabled, vfIsActiveFields 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, vrmlMinorVersionFields 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.GroupFetch the parent grouping node from this sensor so that we can track back up the stack for the world transformation.intGet the int mask used to perform picking with.org.j3d.aviatrix3d.SceneGraphObjectGet 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 target PickableObjects that this sensor manages.voidsetObjectType(String[] types, int numValid) Set the list of picking targets that this object corresponds to.voidsetParentGroup(org.j3d.aviatrix3d.Group group) Set a parent to this sensor.voidSet the flag convertor that will be used to map the object type strings to the internal pick masks.protected voidupdateChildren(VRMLNodeType[] targets, int numValid) Update the child list with the new nodes.Methods inherited from class org.web3d.vrml.renderer.common.nodes.picking.BaseLinePickSensor
getFieldDeclaration, getFieldIndex, getFieldValue, getNodeFieldIndices, getNumFields, getPickingType, notifyPickChange, notifyPickStart, sendRouteMethods inherited from class org.web3d.vrml.renderer.common.nodes.picking.BasePickingNode
checkPickTargetType, copy, getIntersectionType, getObjectType, getPickingGeometry, getPickingTargets, getPrimaryType, getSortOrder, notifyPickEnd, numObjectType, setEnabled, setPickingGeometry, setupFinished, setValue, setValue, setValue, setValueMethods inherited from class org.web3d.vrml.renderer.common.nodes.BaseSensorNode
copy, getEnabled, getIsActive, setValueMethods 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, updateRefsMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.web3d.vrml.nodes.FrameStateListener
allEventsCompleteMethods 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, notifyExternProtoLoaded, removeNodeListener, sendRoute, setDEF, setFrameStateManager, setMetadataObject, setupFinished, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, updateRefCountMethods inherited from interface org.web3d.vrml.nodes.VRMLPickingSensorNodeType
getIntersectionType, getObjectType, getPickingGeometry, getPickingTargets, getPickingType, getSortOrder, notifyPickChange, notifyPickEnd, notifyPickStart, numObjectType, setPickingGeometryMethods inherited from interface org.web3d.vrml.nodes.VRMLSensorNodeType
getEnabled, getIsActive, setEnabled
-
Constructor Details
-
OGLLinePickSensor
public OGLLinePickSensor()Construct a new time sensor object -
OGLLinePickSensor
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:
setParentGroupin 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:
getParentGroupin 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:
getTargetMappingin interfaceOGLPickingSensorNodeType- Returns:
- A set of OGL nodes mapped to their VRML wrapper
-
getTargetObjects
public org.j3d.aviatrix3d.picking.PickableObject[] getTargetObjects()Get the collection of target PickableObjects that this sensor manages.- Specified by:
getTargetObjectsin 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:
setTypeConvertorin 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:
getPickMaskin 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:
setObjectTypein interfaceVRMLPickingSensorNodeType- Overrides:
setObjectTypein 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:
getSceneGraphObjectin 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:
updateChildrenin classBasePickingNode- Parameters:
targets- The list of current childrennumValid- The number of valid children to check
-