Changeset 11852 for branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/Tracking
- Timestamp:
- 02/01/15 23:17:56 (10 years ago)
- Location:
- branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic.Views
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic.Views
- Property svn:mergeinfo changed
/trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Views merged: 11679
- Property svn:mergeinfo changed
-
branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/Tracking/SymbolicDataAnalysisGenealogyGraphView.cs
r11817 r11852 25 25 using System.Linq; 26 26 using System.Windows.Forms; 27 using HeuristicLab.Common; 27 28 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding; 28 29 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views; … … 72 73 var visualNode = (VisualGenealogyGraphNode)sender; 73 74 var graphNode = (IGenealogyGraphNode<ISymbolicExpressionTree>)visualNode.Data; 75 76 if (openNew_CheckBox.Checked) { 77 // get the ancestors into a new view 78 var cloner = new Cloner(); 79 80 var graph = new GenealogyGraph<ISymbolicExpressionTree>(); 81 var ancestors = new[] { graphNode }.Concat(graphNode.Ancestors); 82 var cloned = ancestors.ToDictionary(x => x, x => cloner.Clone(x)); 83 graph.AddVertices(cloned.Values); 84 foreach (var arc in cloned.Keys.SelectMany(x => x.InArcs)) { 85 graph.AddArc(cloner.Clone(arc)); 86 } 87 // graph.AddVertices(graphNode.Ancestors); 88 MainFormManager.MainForm.ShowContent(graph); 89 } 90 74 91 if (graphNode.InArcs.Any()) { 75 92 var fragment = graphNode.InArcs.Last().Data as IFragment<ISymbolicExpressionTreeNode>; … … 92 109 var visualNode = (VisualTreeNode<ISymbolicExpressionTreeNode>)sender; 93 110 var subtree = visualNode.Content; 94 95 111 // highlight the selected subtree inside the displayed tree on the right hand side 96 112 treeChart_ClearColors(); … … 103 119 var graphNode = (IGenealogyGraphNode<ISymbolicExpressionTree>)genealogyGraphChart.SelectedGraphNode; 104 120 var subtreeIndex = graphNode.Data.IterateNodesPrefix().ToList().IndexOf(subtree); 105 // var fragmentGraph = SymbolicDataAnalysisExpressionTracing.TraceSubtree(graphNode, subtreeIndex);106 121 var traceGraph = TraceCalculator.TraceSubtree(graphNode, subtreeIndex); 107 108 122 if (traceGraph.Vertices.Any()) { 123 genealogyGraphChart.UpdateEnabled = false; 124 genealogyGraphChart.ClearArcs(); 125 // genealogyGraphChart.ClearPrimitives(); 109 126 var genealogyNodes = traceGraph.Vertices.Select(v => Content.GetByContent(v.Data)); 110 genealogyGraphChart.HighlightNodes(genealogyNodes); 111 foreach (var a in traceGraph.Arcs) { 112 genealogyGraphChart.HighlightArc(Content.GetByContent(a.Target.Data), Content.GetByContent(a.Source.Data)); 113 } 127 // genealogyGraphChart.HighlightNodes(graphNode.Ancestors, Color.Gray, false); 128 genealogyGraphChart.HighlightNodes(genealogyNodes, Color.Black, false); 129 // foreach (var a in traceGraph.Arcs) { 130 // genealogyGraphChart.HighlightArc(Content.GetByContent(a.Target.Data), Content.GetByContent(a.Source.Data)); 131 // } 132 genealogyGraphChart.UpdateEnabled = true; 133 genealogyGraphChart.EnforceUpdate(); 114 134 MainFormManager.MainForm.ShowContent(traceGraph); // display the fragment graph on the screen 115 135 } … … 121 141 122 142 var matchingVertices = matchingTrees.Select(x => Content.GetByContent(x)); 123 graphChart_ highlightMatchingVertices(matchingVertices);143 graphChart_HighlightMatchingVertices(matchingVertices); 124 144 } 125 145 } 126 146 127 private void graphChart_ highlightMatchingVertices(IEnumerable<IGenealogyGraphNode> vertices) {147 private void graphChart_HighlightMatchingVertices(IEnumerable<IGenealogyGraphNode> vertices) { 128 148 genealogyGraphChart.Chart.UpdateEnabled = false; 129 149 genealogyGraphChart.ClearPrimitives();
Note: See TracChangeset
for help on using the changeset viewer.