Changeset 7785 for branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.EvolutionaryTracking.Views
- Timestamp:
- 05/09/12 09:56:56 (12 years ago)
- Location:
- branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.EvolutionaryTracking.Views/3.4
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.EvolutionaryTracking.Views/3.4/GenealogyGraphChart.cs
r7779 r7785 177 177 foreach (var node in ancestors.SelectMany(n => _visualNodeMap[n])) { 178 178 node.Brush = new SolidBrush(node.ToColor()); 179 if (node.IncomingArcs != null && node == _visualNodeMap[node.Data].First()) 179 if (node.IncomingArcs != null && node == _visualNodeMap[node.Data].First()) { 180 180 foreach (var arc in node.IncomingArcs) { 181 181 if (arc.Source.Data == node.Data) continue; … … 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) { // if the cut index wasn't computed yet 185 if (node.Data.CutpointIndex == -1) { 186 // if the cut index wasn't computed yet 186 187 var parent = arc.Source.Data.Data as ISymbolicExpressionTree; 187 188 var child = node.Data.Data as ISymbolicExpressionTree; … … 189 190 } 190 191 } 192 } 191 193 } 192 194 // highlight the descendants … … 208 210 Chart.UpdateEnabled = true; 209 211 Chart.EnforceUpdate(); 210 if (_selectedGenealogyGraphNode != null) /* emit clicked event */ OnGenealogyGraphNodeClicked(_selectedGenealogyGraphNode, e); 212 if (_selectedGenealogyGraphNode != null) 213 /* emit clicked event */ 214 OnGenealogyGraphNodeClicked(_selectedGenealogyGraphNode, e); 211 215 } 212 216 } … … 238 242 var e1 = parent.IterateNodesPostfix().GetEnumerator(); 239 243 var e2 = child.IterateNodesPostfix().GetEnumerator(); 240 int pos = -1;241 var comparer = new SymbolicExpressionTree GenealogyGraph.SymbolicExpressionTreeNodeComparer(0);244 int pos = 0; 245 var comparer = new SymbolicExpressionTreeNodeComparer((int)SymbolicExpressionTreeMatching.SimilarityLevel.Exact); 242 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; 243 249 return pos; 250 //return pos == 0 ? -1 : pos; 244 251 } 245 252 } -
branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.EvolutionaryTracking.Views/3.4/GenealogyGraphView.cs
r7779 r7785 94 94 var nodes = symbolicExpressionTreeChart.Tree.IterateNodesPostfix().ToArray(); 95 95 var fragments = _selectedVisualSymbolicExpressionTreeNode.SymbolicExpressionTreeNode.IterateNodesPostfix().ToArray(); 96 int index = SymbolicExpressionTree GenealogyGraph.FindMatch(nodes, fragments, similarityModeSelector.SelectedIndex);96 int index = SymbolicExpressionTreeMatching.FindMatch(nodes, fragments, similarityModeSelector.SelectedIndex); 97 97 if (index != -1) { 98 98 _selectedVisualSymbolicExpressionTreeNode = symbolicExpressionTreeChart.GetVisualSymbolicExpressionTreeNode(nodes[index + fragments.Count() - 1]); … … 143 143 genealogyGraphChart.ClearAllNodes(); // clear node colors 144 144 // color each graph node according to the degree to which it matches the selected tree fragment 145 foreach (var i in Enum.GetValues(typeof(SymbolicExpressionTree GenealogyGraph.SimilarityLevel)).Cast<int>().Reverse()) {145 foreach (var i in Enum.GetValues(typeof(SymbolicExpressionTreeMatching.SimilarityLevel)).Cast<int>().Reverse()) { 146 146 var owners = genealogyGraphChart.Graph.TraceFragment(treeNode, i).ToList(); 147 147 if (owners.Any()) genealogyGraphChart.HighlightNodes(owners, colors[i]); // highlight matching individuals from the genealogy
Note: See TracChangeset
for help on using the changeset viewer.