Beispiel #1
0
        /// <summary>
        /// Clones this scene node including its children.
        /// </summary>
        /// <returns>A cloned node with its children</returns>
        public virtual Node CloneTree()
        {
            BranchNode node = (BranchNode)base.CloneNode();

            foreach (Node child in children)
            {
                Node clone;
                if (child is BranchNode)
                {
                    clone = ((BranchNode)child).CloneTree();
                }
                else
                {
                    clone = child.CloneNode();
                }
                node.AddChild(clone);
            }

            return(node);
        }
Beispiel #2
0
        public void BindTo(BranchNode parentNode)
        {
            if (trans != null && ((BranchNode)trans.Parent) != null)
            {
                ((BranchNode)trans.Parent).RemoveChild(trans);

                Console.WriteLine("Contained?" + ((BranchNode)trans.Parent).Children.Contains(trans));
            }

            if(parentNode!=null)
                parentNode.AddChild(trans);
        }