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

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void append​(SoBaseKit childKit)
      Adds childKit to end of chain.
      void append​(SoPath fromPath)
      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 findFork​(SoPath path)
      If the two paths have different head nodes, this returns -1.
      SoNode getHead()
      Return the first node in a path chain
      int getLength()
      Returns length of path chain (number of nodekits).
      SoNode getNode​(int i)
      Return the i'th nodekit in the chain.
      SoNode getNodeFromTail​(int i)
      Return the i'th nodekit in the chain, counting backward from the tail node.
      SoNode getTail()
      Return the last nodekit in a path chain.
      void pop()
      Pop the last nodekit off the end of the path.
      void setHead​(SoNode node)
      Sets head node (first node in chain).
      void truncate​(int start)
      Truncates the path chain, removing all nodes from index start on.
    • Method Detail

      • setHead

        void setHead​(SoNode node)
        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

        void append​(SoBaseKit childKit)
        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

        void append​(SoPath fromPath)
        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

        SoNode getNode​(int i)
        Return the i'th nodekit in the chain. Calling getNode(0) is equivalent to calling getHead().
      • getNodeFromTail

        SoNode getNodeFromTail​(int i)
        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

        boolean containsNode​(SoBaseKit nodekit)
        Returns true if the nodekit is found anywhere in the path chain.
      • containsPath

        boolean containsPath​(SoPath path)
        Returns true if the nodes in the given path argument are contained (in consecutive order) in this path.
      • findFork

        int findFork​(SoPath path)
        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.