internal Polygon(LinkedList <Way> ways, List <bool> reversals, bool outer) { IsOuter = outer; Ways = ways; Reversals = reversals; Nodes = BuildNodes(ways, reversals); nodeArrayBounds = new NodeArrayBounds(Nodes); }
/// <summary> /// Add a node to the nodes. This assumes you have already validated the add makes sense. In fact, if you add the right number of arbitrary /// nodes, the Way belives it is complete! /// /// Returns true iff the added node completes the Way /// </summary> /// <param name="node"></param> public bool AddNode(Node node) { var currentIsComplete = this.IsComplete; this.Nodes.Add(node); if (this.IsComplete && !currentIsComplete) { nodeArrayBounds = new NodeArrayBounds(this.Nodes); return(true); } return(false); }
public Way(string id, Node[] nodes, Dictionary <string, string> tags = null, string containedIn = null, bool isComposite = false) : this(id, nodes.Select(n => n.Id).ToArray(), tags, containedIn, isComposite) { this.Nodes = nodes.ToList(); nodeArrayBounds = new NodeArrayBounds(this.Nodes); }