private void generateTree(XmlWriter writer, bool first) { if (this.root == null) return; if (this.root.OutgoingEdges == null) return; //Prima esecuzione if (first) { this.vertexToXML(writer, this.root); } else { //Seconda esecuzione for (int i = 0; i < this.splitsize; i++) { for (int j = 0; j < this.depth; j++) { this.edgesToXML(writer, this.root); this.vertexToXML(writer, this.root); } } for (int i = 0; i < this.splitSize; i++) { for (int j = 0; j < this.depth; j++) { writer.WriteEndElement(); //Vertex } } } writer.WriteEndElement(); //Vertex foreach (Edge e in this.root.OutgoingEdges) { Tree subtree = new Tree(SplitSize, Depth - 1, VertexAttributes, EdgeAttributes); subtree.root = e.Bottom; subtree.generateTree(writer, first); } }
private void generateTree(XmlWriter writer) { Tree subtree = new Tree(SplitSize, Depth, VertexAttributes, EdgeAttributes); subtree.root = e.Bottom; subtree.generateTree(writer, true); }