Skip to end of metadata
Go to start of metadata

Available since firmware version 7.0

The ifSGNodeDict interface allows you access information about the nodes in a SceneGraph node tree, and find and return a node with a specific ID.

Implemented By

Supported Methods

Description of Methods

findNode(name as String) as Object

Returns the node that is a descendant of the nearest component ancestor of the subject node (possibly the subject node itself) and whose id field is set to name. The search for the descendant node is a breadth-first search that includes child nodes in nodes that are declared as custom components defined in other XML component files. These together allow finding siblings and cousins of a node within the context of a component. If a node with the specified name is not found, an invalid object is returned.

The intent is for the ID to be unique in this context, but the first node matched in a breadth-first, top-down, first child to last child, traversal will be returned.

subtype() as String

Returns the subtype of the subject node as specified when it was created.

parentSubtype(nodeType as String) as String

Returns the subtype of the parent of the nodeType in the SceneGraph node class hierarchy.

This method does not actually reference the subject node.

isSubtype(nodeType as String) as Boolean

Returns true if the subtype of the subject node is a descendant of the subtype nodeType in the SceneGraph node class hierarchy.

isSameNode(RoSGNode as Object) as Boolean

Returns a Boolean value indicating whether the RoSGNode parameter refers to the same SceneGraph node object as the subject node. This can be useful when the RoSGNode objects come from two different sources, for example when one is stored in an associative array, and the other is obtained from an RoSGNode interface method that returns an RoSGNode object, like getChild(). It may be that the application needs to know whether the two RoSGNode objects are actually referring to the same underlying SceneGraph node. Below is an example that shows the relationships. It should print "same".

n = createObject("roSGNode", "Node") 
c = n.createChild("Node")
if c.isSameNode(n.getChild(0)) then print "same"

clone(isDeepCopy as Boolean) as Object

Available since firmware version 7.6

If isDeepCopy is true, this function returns a copy of the entire node tree. If isDeepCopy is false, a shallow copy of the node will be returned. 


  • No labels