Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
04/07/14 22:48:28 (11 years ago)
Author:
bburlacu
Message:

#1772: Changed orientation of trees in the SymbolicExpressionTreeTile. Added a graphical bounding rectangle for each tile.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolicExpressionTreeTile.cs

    r10728 r10729  
    157157        }
    158158      }
     159
     160      // add a bounding rectangle and flip primitives vertically
     161      // draw a rectangle to mark the countour of this tile
     162      var size = this.Size;
     163      var height = size.Height;
     164      var rectangle = new Rectangle(this.Chart, new PointD(0, 0), new PointD(size.Width, size.Height)) {
     165        Pen = new Pen(Color.Gray),
     166        Brush = new SolidBrush(Color.Transparent)
     167      };
     168      this.Add(rectangle);
     169
     170      foreach (var primitive in Primitives) {
     171        var rpb = primitive as RectangularPrimitiveBase;
     172        if (rpb != null) {
     173          rpb.SetPosition(rpb.LowerLeft.X, height - rpb.UpperRight.Y, rpb.UpperRight.X, height - rpb.LowerLeft.Y);
     174        } else {
     175          var line = primitive as LinearPrimitiveBase;
     176          if (line != null) {
     177            line.SetPosition(line.Start.X, height - line.Start.Y, line.End.X, height - line.End.Y);
     178          }
     179        }
     180      }
    159181    }
    160182  }
Note: See TracChangeset for help on using the changeset viewer.