Changeset 7792 for branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.EvolutionaryTracking.Views/3.4/GenealogyGraphChart.cs
- Timestamp:
- 05/10/12 17:17:14 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.EvolutionaryTracking.Views/3.4/GenealogyGraphChart.cs
r7785 r7792 114 114 style = DashStyle.Dash; 115 115 } else { 116 style = arc.OperatorType == 0? DashStyle.Solid : DashStyle.Dash;116 style = node.InEdges.Count == 2 ? DashStyle.Solid : DashStyle.Dash; 117 117 } 118 118 var arcPen = new Pen(Color.Transparent) { DashStyle = style }; … … 183 183 var end = new Point((int)arc.End.X, (int)arc.End.Y); 184 184 arc.Pen.Brush = new LinearGradientBrush(start, end, arc.Source.ToColor(), arc.Target.ToColor()); 185 if (node.Data.CutpointIndex == -1) {186 // if the cut index wasn't computed yet187 var parent = arc.Source.Data.Data as ISymbolicExpressionTree;188 var child = node.Data.Data as ISymbolicExpressionTree;189 node.Data.CutpointIndex = GetCutIndex(parent, child);190 }191 185 } 192 186 } … … 236 230 Chart.EnforceUpdate(); 237 231 } 238 239 // maybe this method does't belong here240 // TODO: find a good location for this kind of functionality241 private static int GetCutIndex(ISymbolicExpressionTree parent, ISymbolicExpressionTree child) {242 var e1 = parent.IterateNodesPostfix().GetEnumerator();243 var e2 = child.IterateNodesPostfix().GetEnumerator();244 int pos = 0;245 var comparer = new SymbolicExpressionTreeNodeComparer((int)SymbolicExpressionTreeMatching.SimilarityLevel.Exact);246 while (e1.MoveNext() && e2.MoveNext() && comparer.Equals(e1.Current, e2.Current)) ++pos;247 if (pos == 0) return -1;248 if (pos == child.Length) return 0;249 return pos;250 //return pos == 0 ? -1 : pos;251 }252 232 } 253 233 }
Note: See TracChangeset
for help on using the changeset viewer.