Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
02/04/15 00:43:44 (8 years ago)
Author:
bburlacu
Message:

#1772:

  • TraceGraph: Improved saving of trace data, changed GetTraceNode method to AddTraceNode and made the code more clear.
  • SymbolicDataAnalysisGenealogyGraphView: added highlighting of trace information (when visualizing trace graphs)
  • GenealogyGraphChart: removed useless code
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking.Views/3.4/GenealogyGraphChart.cs

    r11864 r11881  
    4343    private Dictionary<Tuple<VisualGenealogyGraphNode, VisualGenealogyGraphNode>, VisualGenealogyGraphArc> arcMap;
    4444
     45    #region chart modes
     46    public bool SimpleLineages { get; set; }
     47    public bool LockGenealogy { get; set; }
     48    public bool TraceFragments { get; set; }
     49    #endregion
     50
     51    private bool DrawInProgress { get; set; } // do not try to update the chart while the drawing is not finished
     52
    4553    public IGenealogyGraph GenealogyGraph {
    4654      get { return genealogyGraph; }
     
    7987    }
    8088
    81     #region chart modes
    82     public bool SimpleLineages { get; set; }
    83     public bool LockGenealogy { get; set; }
    84     public bool TraceFragments { get; set; }
    85     #endregion
    86 
    8789    private Visualization.Rectangle TargetRectangle { get; set; }
    88     private bool DrawInProgress { get; set; } // do not try to update the chart while the drawing is not finished
    8990    protected VisualGenealogyGraphNode SelectedVisualNode { get; set; }
    9091
     
    163164        }
    164165      }
    165       // TODO: connect elites
    166166
    167167      Chart.UpdateEnabled = true;
     
    200200      base.pictureBox_MouseMove(sender, e);
    201201    }
     202
    202203    protected override void pictureBox_MouseUp(object sender, MouseEventArgs e) {
    203204      Cursor = Cursors.Default;
     
    252253    #endregion
    253254
     255    #region drawing routines
    254256    private static void DrawLineage(VisualGenealogyGraphNode node, Func<VisualGenealogyGraphNode, IEnumerable<VisualGenealogyGraphArc>> arcSelector, Func<VisualGenealogyGraphArc, VisualGenealogyGraphNode> nodeSelector) {
    255257      var brush = (SolidBrush)node.Brush;
     
    269271    }
    270272
    271     public void HighlightHotPaths() {
    272       Chart.UpdateEnabled = false;
    273       ClearPrimitives();
    274       var arcs = GenealogyGraph.Vertices.SelectMany(n => n.InArcs).ToList();
    275       foreach (var arc in arcs) { arc.Weight = 1.0; } // reset weights
    276       var rank = GenealogyGraph.Ranks.Max(x => x.Key);
    277       foreach (var graphNode in GenealogyGraph.GetByRank(rank)) {
    278         foreach (var ancestor in graphNode.Ancestors) {
    279           foreach (var arc in ancestor.InArcs) {
    280             arc.Weight++;
    281           }
    282         }
    283       }
    284       double max = arcs.Max(a => a.Weight);
    285       double min = arcs.Min(a => a.Weight);
    286 
    287       if (min.IsAlmost(max)) return;
    288       //translate interval (min,max) to interval (0,255)
    289       foreach (var arc in arcs) {
    290         var vArc = GetMappedArc(arc.Source, arc.Target);
    291         int colorIndex = (int)Math.Round((arc.Weight - min) * 255 / (max - min));
    292         if (colorIndex > 254) colorIndex = 254;
    293         vArc.Pen = new Pen(ColorGradient.Colors[colorIndex]);
    294         //        vArc.Pen.Brush = new SolidBrush(ColorGradient.Colors[colorIndex]);
    295       }
    296       Chart.UpdateEnabled = true;
    297       Chart.EnforceUpdate();
    298     }
    299 
    300273    void MarkSelectedNode() {
    301274      var center = SelectedVisualNode.Center;
     
    342315          primitive.Brush = new SolidBrush(Color.Transparent);
    343316          primitive.Pen = new Pen(Color.DarkGray);
    344           //          primitive.Pen = Pens.Transparent; // remove the node contour
    345317        }
    346318      }
     
    387359      arc.Pen.Brush = new LinearGradientBrush(start, end, source.GetColor(), target.GetColor());
    388360    }
     361    #endregion
    389362  }
    390363
Note: See TracChangeset for help on using the changeset viewer.