public class SoNodeSensor extends SoDataSensor
Node sensors provide methods that can be called in the callback to determine exactly which node or field caused the sensor to be triggered. However these methods only return valid information if the sensor priority was explicitly set to zero (default is 100). Depending on the type of attached node, there are multiple possible triggers and only some of the get trigger info methods will return useful information.
Priority zero sensors are triggered immediately after the change. Normal priority sensors are not triggered until the next time the "delay queue" is processed. Normally this happens when the viewer / renderArea is not rendering and there are no input events to be processed.
The node sensor will be triggered if its schedule() method is called. But the trigger node, trigger field, etc. queries will return null. Generally this method is only useful for "at some future time" sensors like SoIdleSensor
or SoAlarmSensor
.
Node sensors provide a "final" task that is called when the object the data sensor is attached to is finalized. This task should not attempt to modify the object in any way. (see setFinalTask(Runnable)) that is called just before the object the data sensor is attached to is deleted. The callback should not attempt to modify the object in any way.
See SoDataSensor
for general information and code example.
See also:
SoDataSensor.ChangeTypes
Inventor.ConstructorCommand
FIELD_MULTIVALUE, GROUP_ADD_CHILD, GROUP_INSERT_CHILD, GROUP_REMOVE_ALL_CHILDREN, GROUP_REMOVE_CHILD, GROUP_REPLACE_CHILD, UNSPECIFIED
VERBOSE_LEVEL, ZeroHandle
Constructor and Description |
---|
SoNodeSensor()
Default constructor.
|
SoNodeSensor(java.lang.Runnable task)
Builds a new node sensor with the task to be executed when the sensor
is triggered.
|
Modifier and Type | Method and Description |
---|---|
void |
attach(SoNode node)
Makes this sensor detect changes to the given node.
|
void |
detach()
Unschedules this sensor (if it is scheduled) and makes it ignore changes to the scene graph.
|
SoNode |
getAttachedNode()
Returns the node that this sensor is sensing, or NULL if it is not attached to any node.
|
getTriggerChild, getTriggerChildIndex, getTriggerFastEditInfo, getTriggerFastEditInfoFlag, getTriggerField, getTriggerMFieldNumValues, getTriggerMFieldStartIndex, getTriggerNode, getTriggerPath, getTriggerPathFlag, getTriggerType, setFinalTask, setTriggerFastEditInfoFlag, setTriggerPathFlag
getDefaultPriority, getPriority, isIdleOnly, setPriority
isScheduled, schedule, setTask, unschedule
dispose, getAddress, getNativeResourceHandle, startInternalThreads, stopInternalThreads
public SoNodeSensor(java.lang.Runnable task)
public SoNodeSensor()
public void detach()
public SoNode getAttachedNode()
public void attach(SoNode node)
Generated on January 23, 2025, Copyright © Thermo Fisher Scientific. All rights reserved. http://www.openinventor.com