Package com.openinventor.inventor
Interface SoNodeKitPath
public interface SoNodeKitPath
Manage a chain of nodes that can be only instance of nodekit
(see
SoBaseKit
) except for the first (head) that can be
any node.
see SoPath
- Author:
- Jean-Michel Godinaud
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds childKit to end of chain.void
Adds all nodekits in fromPath's chain to end of chain.boolean
containsNode
(SoBaseKit nodekit) Returns true if the nodekit is found anywhere in the path chain.boolean
containsPath
(SoPath path) Returns true if the nodes in the given path argument are contained (in consecutive order) in this path.int
If the two paths have different head nodes, this returns -1.getHead()
Return the first node in a path chainint
Returns length of path chain (number of nodekits).getNode
(int i) Return the i'th nodekit in the chain.getNodeFromTail
(int i) Return the i'th nodekit in the chain, counting backward from the tail node.getTail()
Return the last nodekit in a path chain.void
pop()
Pop the last nodekit off the end of the path.void
Sets head node (first node in chain).void
truncate
(int start) Truncates the path chain, removing all nodes from index start on.
-
Method Details
-
setHead
Sets head node (first node in chain). The head node must be set before the append() method may be called. -
getHead
SoNode getHead()Return the first node in a path chain -
append
Adds childKit to end of chain. Uses first occurrence of childKit as a part within current last nodekit. If the path is empty, this is equivalent to setHead(childKit). -
append
Adds all nodekits in fromPath's chain to end of chain. The head node of fromPath must be the same as or a child of the current tail node. -
pop
void pop()Pop the last nodekit off the end of the path. -
getTail
SoNode getTail()Return the last nodekit in a path chain. -
getNode
Return the i'th nodekit in the chain. Calling getNode(0) is equivalent to calling getHead(). -
getNodeFromTail
Return the i'th nodekit in the chain, counting backward from the tail node. Calling getNodeFromTail(0) is equivalent to calling getTail(). -
getLength
int getLength()Returns length of path chain (number of nodekits). -
truncate
void truncate(int start) Truncates the path chain, removing all nodes from index start on. Calling truncate(0) empties the path entirely. -
containsNode
Returns true if the nodekit is found anywhere in the path chain. -
containsPath
Returns true if the nodes in the given path argument are contained (in consecutive order) in this path. -
findFork
If the two paths have different head nodes, this returns -1. Otherwise, it returns the path chain index of the last nodekit (starting at the head) that is the same for both paths.
-