コード例 #1
0
        internal static CSGTreeNode DuplicateInternal(CSGTreeNode node)
        {
            switch (node.Type)
            {
            case CSGNodeType.Brush:
            {
                var srcTreeBrush = (CSGTreeBrush)node;
                return(CSGTreeBrush.Create(srcTreeBrush.UserID, srcTreeBrush.LocalTransformation, srcTreeBrush.BrushMesh, srcTreeBrush.Operation, srcTreeBrush.Flags));
            }

            case CSGNodeType.Tree:
            {
                var srcTree = (CSGTree)node;
                return(CSGTree.Create(srcTree.UserID, DuplicateChildNodesInternal(srcTree)));
            }

            case CSGNodeType.Branch:
            {
                var srcTreeBranch = (CSGTreeBranch)node;
                return(CSGTreeBranch.Create(srcTreeBranch.UserID, srcTreeBranch.Operation, DuplicateChildNodesInternal(srcTreeBranch)));
            }

            default:
                throw new NotImplementedException();
            }
        }
コード例 #2
0
 public CSGTreeBranch CreateBranch(Int32 userID = 0, CSGOperationType operation = CSGOperationType.Additive)
 {
     return(CSGTreeBranch.Create(userID, operation));
 }