|
Xj3D 2.0 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
public abstract class BaseSensorNode
An abstract representation of any form of sensor for subclassing by specific implementations.
| Field Summary | |
|---|---|
protected static int |
FIELD_ENABLED
The field index for enabled |
protected static int |
FIELD_IS_ACTIVE
The field index for isActive |
protected static int |
LAST_SENSOR_INDEX
The last field index used by this class |
protected boolean |
vfEnabled
The value of the enabled field |
protected boolean |
vfIsActive
The value of the isActive field |
| Fields inherited from class org.web3d.vrml.renderer.common.nodes.AbstractNode |
|---|
BAD_NODE_MSG, errorReporter, FIELD_METADATA, fieldLocalData, hasChanged, INIT_ONLY_WRITE_MSG, inSetup, isDEF, isStatic, LAST_NODE_INDEX, layerIds, METADATA_NODE_MSG, METADATA_PROTO_MSG, nodeName, pMetadata, refCounts, removedLayerIds, stateManager, vfMetadata, vrmlMajorVersion, vrmlMinorVersion |
| Constructor Summary | |
|---|---|
protected |
BaseSensorNode(java.lang.String name)
Initialise the sensor node and it's fields that are held locally. |
| Method Summary | |
|---|---|
protected void |
copy(VRMLSensorNodeType node)
Set the fields of the sensor node that has the fields set based on the fields of the passed in node. |
boolean |
getEnabled()
Get the current value of the enabled field. |
VRMLFieldData |
getFieldValue(int index)
Get the value of a field. |
boolean |
getIsActive()
Get current value of the output-only field isActive. |
void |
sendRoute(double time,
int srcIndex,
VRMLNodeType destNode,
int destIndex)
Send a routed value from this node to the given destination node. |
void |
setEnabled(boolean state)
Set a new state for the enabled field. |
void |
setValue(int index,
boolean value)
Set the value of the field at the given index as a boolean. |
| 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, setupFinished, setUserData, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setVersion, 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.VRMLNodeType |
|---|
addNodeListener, clearRemovedLayerIds, getLayerIds, getMetadataObject, getRefCount, getRemovedLayerIds, hasFieldChanged, isSetupFinished, notifyExternProtoLoaded, removeNodeListener, setDEF, setFrameStateManager, setMetadataObject, setupFinished, setValue, 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, getPrimaryType, getSecondaryType, getUserData, getVRMLNodeName, isDEF, setErrorReporter, setUserData, setVersion |
| Methods inherited from interface org.web3d.vrml.nodes.FrameStateListener |
|---|
allEventsComplete |
| Field Detail |
|---|
protected static final int FIELD_ENABLED
protected static final int FIELD_IS_ACTIVE
protected static final int LAST_SENSOR_INDEX
protected boolean vfEnabled
protected boolean vfIsActive
| Constructor Detail |
|---|
protected BaseSensorNode(java.lang.String name)
name - The name of the type of node| Method Detail |
|---|
protected void copy(VRMLSensorNodeType node)
node - The sensor node to copy info frompublic void setEnabled(boolean state)
setEnabled in interface VRMLSensorNodeTypestate - True if this sensor is to be enabledpublic boolean getEnabled()
true.
getEnabled in interface VRMLSensorNodeTypepublic boolean getIsActive()
getIsActive in interface VRMLSensorNodeType
public VRMLFieldData getFieldValue(int index)
throws InvalidFieldException
getFieldValue in interface VRMLNodeTypegetFieldValue in class AbstractNodeindex - 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 AbstractNodetime - 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 AbstractNodeindex - 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.
|
Xj3D 2.0 VRML/X3D Code API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||