Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
06/07/11 09:55:49 (13 years ago)
Author:
mkommend
Message:

#1549: Minor changes in SymbolicExpressionTreeNode and the SymbolicExpressionTreeChart that are necessary for the debugger visualizer to work correctly.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolicExpressionTreeChart.cs

    r5956 r6375  
    2424using System.Drawing;
    2525using System.Drawing.Imaging;
    26 using System.Linq;
    2726using System.Windows.Forms;
    2827
     
    263262
    264263      //draw terminal node
    265       if (node.Subtrees.Count() == 0) {
     264      if (node.SubtreesCount == 0) {
    266265        graphics.FillRectangle(nodeFillBrush, visualTreeNode.X, visualTreeNode.Y, visualTreeNode.Width, visualTreeNode.Height);
    267266        graphics.DrawRectangle(nodeLinePen, visualTreeNode.X, visualTreeNode.Y, visualTreeNode.Width, visualTreeNode.Height);
     
    281280      //calculate areas for the subtrees according to their tree size and call drawFunctionTree
    282281      Point connectFrom = new Point(visualTreeNode.X + visualTreeNode.Width / 2, visualTreeNode.Y + visualTreeNode.Height);
    283       int[] xBoundaries = new int[node.Subtrees.Count() + 1];
     282      int[] xBoundaries = new int[node.SubtreesCount + 1];
    284283      xBoundaries[0] = x;
    285       for (int i = 0; i < node.Subtrees.Count(); i++) {
    286         xBoundaries[i + 1] = (int)(xBoundaries[i] + (width * (double)node.Subtrees.ElementAt(i).GetLength()) / (node.GetLength() - 1));
    287         DrawFunctionTree(node.Subtrees.ElementAt(i), graphics, xBoundaries[i], y + height,
     284      for (int i = 0; i < node.SubtreesCount; i++) {
     285        xBoundaries[i + 1] = (int)(xBoundaries[i] + (width * (double)node.GetSubtree(i).GetLength()) / (node.GetLength() - 1));
     286        DrawFunctionTree(node.GetSubtree(i), graphics, xBoundaries[i], y + height,
    288287          xBoundaries[i + 1] - xBoundaries[i], height, connectFrom);
    289288      }
Note: See TracChangeset for help on using the changeset viewer.