Exemplo n.º 1
0
 public MXCIFQuadTreeNodeBranch(
     BoundingBox bb,
     int level,
     object data,
     int dataCount,
     MXCIFQuadTreeNode nw,
     MXCIFQuadTreeNode ne,
     MXCIFQuadTreeNode sw,
     MXCIFQuadTreeNode se)
     : base(bb, level, data, dataCount)
 {
     Nw = nw;
     Ne = ne;
     Sw = sw;
     Se = se;
 }
Exemplo n.º 2
0
        public static MXCIFQuadTreeNode Navigate(
            MXCIFQuadTreeNode current,
            string directions)
        {
            if (string.IsNullOrEmpty(directions))
            {
                return(current);
            }

            var split = directions.SplitCsv();

            for (var i = 0; i < split.Length; i++)
            {
                var branch = (MXCIFQuadTreeNodeBranch)current;
                switch (split[i])
                {
                case "nw":
                    current = branch.Nw;
                    break;

                case "ne":
                    current = branch.Ne;
                    break;

                case "sw":
                    current = branch.Sw;
                    break;

                case "se":
                    current = branch.Se;
                    break;

                default:
                    throw new ArgumentException("Invalid direction " + split[i]);
                }
            }

            return(current);
        }
Exemplo n.º 3
0
 public static MXCIFQuadTreeNodeLeaf NavigateLeaf(
     MXCIFQuadTreeNode node,
     string directions)
 {
     return((MXCIFQuadTreeNodeLeaf)Navigate(node, directions));
 }