internal override void GetGraphHelper(Graph g, SppfNodeNode myNode, HashSet <InteriorNode> visited) { if (visited.Contains(this)) { return; } visited.Add(this); // foreach (var family in Families) { for (int i = 0; i < Families.Count; i++) { var family = Families[i]; Production singletonProduction = null; INode prevNode; if (Families.Count == 1) { prevNode = myNode; singletonProduction = Families[0].Production; } else { prevNode = new FamilyNode(family, myNode.Node.Id + "-" + i, myNode.Rank + 1); // g.AddEdge(myNode, prevNode, family.Production); g.AddEdge(myNode, prevNode); } foreach (var child in family.Members) { var childNode = new SppfNodeNode(child, prevNode.Rank + 1); // var childNode = g.GetNode(child, prevNode.Rank + 1); // g.AddEdge(prevNode, childNode, singletonProduction); g.AddEdge(prevNode, childNode); child.GetGraphHelper(g, childNode, visited); } } }
public static string GetHardReport(List <List <int> > indexs_cate) { string report = ""; int count_cate = -1; foreach (List <int> indexs_fami in indexs_cate) { ++count_cate; if (indexs_fami.Count == 0) { break; } else { report += (count_cate + 1).ToString() + " " + _cateNames[count_cate] + "\r\n"; List <FamilyNode> fns = _cateNodes[count_cate]; int count_fami = 1; foreach (int index_fami in indexs_fami) { FamilyNode fn = fns[index_fami]; report += (count_cate + 1).ToString() + "." + count_fami++.ToString() + " " + fn.familyName + "\r\n"; report += fn.ReportFamily(); } } } return(report); }