public PointRegionQuadTreeNodeBranch( BoundingBox bb, int level, PointRegionQuadTreeNode nw, PointRegionQuadTreeNode ne, PointRegionQuadTreeNode sw, PointRegionQuadTreeNode se) : base(bb, level) { Nw = nw; Ne = ne; Sw = sw; Se = se; }
public static PointRegionQuadTreeNode Navigate( PointRegionQuadTreeNode current, string directions) { if (string.IsNullOrEmpty(directions)) { return(current); } var split = directions.SplitCsv(); for (var i = 0; i < split.Length; i++) { var branch = (PointRegionQuadTreeNodeBranch)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); }
public static PointRegionQuadTreeNodeLeaf <object> NavigateLeaf( PointRegionQuadTreeNode node, string directions) { return((PointRegionQuadTreeNodeLeaf <object>)Navigate(node, directions)); }