Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/24/14 16:59:22 (11 years ago)
Author:
bburlacu
Message:

#1772: Added new SymbolicDataAnalysisGenealogyView and added support for the tracing of building blocks (finding the constituent ancestral elements of a selected subtree).

Location:
branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic.Views
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic.Views

  • branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/SymbolicDataAnalysisExpressionLineageExplorerChart.cs

    r10517 r10650  
    11using System.Collections.Generic;
    22using System.Drawing;
     3using System.Windows.Forms;
    34using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views;
    45using HeuristicLab.Visualization;
     
    5960      }
    6061    }
     62
     63    protected override void pictureBox_MouseUp(object sender, MouseEventArgs e) {
     64      base.pictureBox_MouseUp(sender, e);
     65      // get the selected primitive and update it's graphics
     66      var point = new Point(e.X, e.Y);
     67
     68      var selectedPrimitives = Chart.GetAllPrimitives(point);
     69      // first primitive in the list should be the tile, the second one should be the actual primitive representing a tree node
     70      var tile = (SymbolicExpressionTreeTile)selectedPrimitives[0];
     71      var selectedPrimitive = (RectangularPrimitiveBase)selectedPrimitives[1];
     72      var tree = tile.SymbolicExpressionTree; // use the tree to get the genealogy graph node and the fragments used for tracing building blocks
     73
     74      var pen = new Pen(Color.Blue);
     75      using (var g = Graphics.FromImage(pictureBox.Image)) {
     76        g.DrawRectangle(pen, (float)selectedPrimitive.LowerLeft.X, (float)selectedPrimitive.LowerLeft.Y, (float)selectedPrimitive.Size.Width, (float)selectedPrimitive.Size.Height);
     77      }
     78    }
    6179  }
    6280}
Note: See TracChangeset for help on using the changeset viewer.