|
Xj3D VRML/X3D Code API | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.web3d.vrml.renderer.common.nodes.AbstractNode
org.web3d.vrml.renderer.common.nodes.BaseSensorNode
org.web3d.vrml.renderer.common.nodes.BaseDragSensorNode
An abstract representation of any form of sensor for subclassing by specific implementations.
| Field Summary | |
protected static int |
FIELD_AUTOOFFSET
The field index for enabled |
protected static int |
FIELD_DESCRIPTION
The field index for description |
protected static int |
FIELD_IS_OVER
The field index for isOver |
protected static int |
FIELD_TRACKPOINT_CHANGED
The field index for trackPoint_changed |
protected float[] |
initialPosition
The initial position of the input touch for generating the tx |
protected static org.j3d.geom.IntersectionUtils |
intersectionUtils
Common intersection utils class for the ray to geometry testing during the drag process. |
protected static int |
LAST_DRAG_SENSOR_INDEX
The last field index used by this class |
protected boolean |
vfAutoOffset
The value of the autoOffset field |
protected java.lang.String |
vfDescription
The value of the description field |
protected boolean |
vfIsOver
The value of the isOver field |
protected float[] |
vfTrackPointChanged
The value of the trackPoint_changed field |
protected static float[] |
wkPoint
Array to return intersection point info with |
| 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 |
BAD_NODE_MSG, errorReporter, FIELD_METADATA, fieldData, hasChanged, INIT_ONLY_WRITE_MSG, inSetup, isDEF, isStatic, LAST_NODE_INDEX, METADATA_NODE_MSG, METADATA_PROTO_MSG, nodeName, pMetadata, refCount, stateManager, vfMetadata, vrmlMajorVersion, vrmlMinorVersion |
| Constructor Summary | |
protected |
BaseDragSensorNode(java.lang.String name)
Initialise the sensor node and it's fields that are held locally. |
| Method Summary | |
protected void |
copy(VRMLDragSensorNodeType node)
Set the fields of the sensor node that has the fields set based on the fields of the passed in node. |
boolean |
getAutoOffset()
Accessor method to get current value of field autoOffset. |
java.lang.String |
getDescription()
Get the description to associate with the link. |
VRMLFieldData |
getFieldValue(int index)
Get the value of a field. |
boolean |
getIsOver()
Get the current value of the isOver field. |
int |
getPrimaryType()
Get the primary type of this node. |
float[] |
getTrackPointChanged()
Accessor method to get current value of the trackPoint field. |
void |
notifySensorDragChange(float[] position,
float[] direction)
Notify the drag sensor that a sensor is currently dragging this device and that it's position and orientation are as given. |
void |
notifySensorDragEnd(float[] position,
float[] direction)
Notification that this sensor has finished a drag action. |
void |
notifySensorDragStart(float[] hitPoint,
float[] location)
Notification that this sensor has just been clicked on to start a drag action. |
protected abstract void |
processDrag(float[] location,
float[] direction)
Generate the tracking output based on the input hit position. |
boolean |
requiresPointOnly()
Flag to notify the user whether the node implementation only needs the hit point information, or it needs everything else as well. |
void |
sendRoute(double time,
int srcIndex,
VRMLNodeType destNode,
int destIndex)
Send a routed value from this node to the given destination node. |
void |
setAutoOffset(boolean state)
Set a new value for the autoOffset field. |
void |
setDescription(java.lang.String desc)
Set the description string for this link. |
void |
setIsOver(boolean newIsOver)
Set the flag describing whether the pointing device is over this sensor. |
void |
setValue(int index,
boolean value)
Set the value of the field at the given index as a boolean. |
void |
setValue(int index,
java.lang.String value)
Set the value of the field at the given index as an array of floats. |
| Methods inherited from class org.web3d.vrml.renderer.common.nodes.BaseSensorNode |
copy, getEnabled, getIsActive, setEnabled |
| Methods inherited from class org.web3d.vrml.renderer.common.nodes.AbstractNode |
addNodeListener, allEventsComplete, checkNodeType, checkSecondaryType, checkSecondaryType, fireFieldChanged, getMetadataObject, getNodeFieldIndices, getRefCount, getSecondaryType, getUserData, getVRMLNodeName, hasFieldChanged, isDEF, isSetupFinished, notifyExternProtoLoaded, removeNodeListener, setDEF, setErrorReporter, setFrameStateManager, setMetadataObject, setupFinished, setUserData, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setVersion, updateRefCount |
| 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.VRMLSensorNodeType |
getEnabled, getIsActive, setEnabled |
| Methods inherited from interface org.web3d.vrml.nodes.VRMLNodeType |
addNodeListener, getMetadataObject, getRefCount, hasFieldChanged, isSetupFinished, notifyExternProtoLoaded, removeNodeListener, setDEF, setFrameStateManager, setMetadataObject, setupFinished, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, updateRefCount |
| Methods inherited from interface org.web3d.vrml.lang.VRMLNode |
getFieldDeclaration, getFieldIndex, getNodeFieldIndices, getNumFields, getSecondaryType, getUserData, getVRMLNodeName, isDEF, setErrorReporter, setUserData, setVersion |
| Methods inherited from interface org.web3d.vrml.nodes.FrameStateListener |
allEventsComplete |
| Field Detail |
protected static final int FIELD_AUTOOFFSET
protected static final int FIELD_TRACKPOINT_CHANGED
protected static final int FIELD_DESCRIPTION
protected static final int FIELD_IS_OVER
protected static final int LAST_DRAG_SENSOR_INDEX
protected static org.j3d.geom.IntersectionUtils intersectionUtils
protected static float[] wkPoint
protected boolean vfAutoOffset
protected float[] vfTrackPointChanged
protected java.lang.String vfDescription
protected boolean vfIsOver
protected float[] initialPosition
| Constructor Detail |
protected BaseDragSensorNode(java.lang.String name)
name - The name of the type of node| Method Detail |
protected void copy(VRMLDragSensorNodeType node)
node - The sensor node to copy info frompublic java.lang.String getDescription()
getDescription in interface VRMLDragSensorNodeTypepublic void setDescription(java.lang.String desc)
setDescription in interface VRMLDragSensorNodeTypedesc - The new description to set
public void notifySensorDragStart(float[] hitPoint,
float[] location)
notifySensorDragStart in interface VRMLDragSensorNodeTypehitPoint - Where the input device intersected the object sensorlocation - Where the sensor origin is in local coordinates
public void notifySensorDragChange(float[] position,
float[] direction)
notifySensorDragChange in interface VRMLDragSensorNodeTypeposition - Where the sensor origin is in local coordinatesdirection - Vector showing the direction the sensor is pointing
public void notifySensorDragEnd(float[] position,
float[] direction)
notifySensorDragEnd in interface VRMLDragSensorNodeTypeposition - Where the sensor origin is in local coordinatesdirection - Vector showing the direction the sensor is pointingpublic boolean requiresPointOnly()
requiresPointOnly in interface VRMLPointingDeviceSensorNodeTypepublic void setIsOver(boolean newIsOver)
setIsOver in interface VRMLPointingDeviceSensorNodeTypenewIsOver - The new value for isOverpublic boolean getIsOver()
getIsOver in interface VRMLPointingDeviceSensorNodeTypepublic void setAutoOffset(boolean state)
setAutoOffset in interface VRMLDragSensorNodeTypestate - The new value for AutoOffsetpublic boolean getAutoOffset()
true
getAutoOffset in interface VRMLDragSensorNodeTypepublic float[] getTrackPointChanged()
public int getPrimaryType()
getPrimaryType in interface VRMLNode
public VRMLFieldData getFieldValue(int index)
throws InvalidFieldException
getFieldValue in interface VRMLNodeTypegetFieldValue in class BaseSensorNodeindex - The index of the field to change.
InvalidFieldException - The field index is not known
public void sendRoute(double time,
int srcIndex,
VRMLNodeType destNode,
int destIndex)
sendRoute in interface VRMLNodeTypesendRoute in class BaseSensorNodetime - The time that this route occurred (not necessarily epoch
time. Should be treated as a relative value only)srcIndex - The index of the field in this node that the value
should be sent fromdestNode - The node reference that we will be sending the value todestIndex - The index of the field in the destination node that
the value should be sent to.
public void setValue(int index,
boolean value)
throws InvalidFieldException,
InvalidFieldValueException
setValue in interface VRMLNodeTypesetValue in class BaseSensorNodeindex - The index of destination field to setvalue - The new value to use for the node
InvalidFieldException - The index is not a valid field
InvalidFieldValueException - The field value is not legal for
the field specified.
public void setValue(int index,
java.lang.String value)
throws InvalidFieldException
setValue in interface VRMLNodeTypesetValue in class AbstractNodeindex - The index of destination field to setvalue - The new value to use for the node
InvalidFieldException - The field index is not know
protected abstract void processDrag(float[] location,
float[] direction)
location - The position of the mouse locallydirection - Vector showing the direction the sensor is pointing
|
Xj3D VRML/X3D Code API | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||