public void ToDebug(StringWriter sw) { sw.Write("{"); sw.Write("'plane':'" + plane.ToString() + "',\n"); sw.Write("'triangles':'"); foreach (var v in triangles) { sw.Write(v.ToString()); } sw.Write("',\n"); sw.Write("'left':"); if (left != null) { left.ToDebug(sw); } else { sw.Write("null"); } sw.Write(",\n"); sw.Write("'right':"); if (right != null) { right.ToDebug(sw); } else { sw.Write("null"); } sw.Write("\n"); sw.Write("}"); }
public String ToDebug() { StringWriter sw = new StringWriter(); sw.Write("{'Name': 'BSPTree',\n"); sw.Write("'Node': \n"); if (node == null) { sw.Write("null"); } else { node.ToDebug(sw); } sw.Write("}"); return(sw.ToString()); }