Changeset 10677 for branches/HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views
- Timestamp:
- 03/28/14 16:23:40 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolicExpressionTreeTile.cs
r10655 r10677 58 58 } 59 59 public ReingoldTilfordLayoutEngine<ISymbolicExpressionTreeNode> LayoutEngine { get; set; } 60 private Dictionary<IPrimitive, ISymbolicExpressionTreeNode> primitiveMap;60 private readonly Dictionary<IPrimitive, ISymbolicExpressionTreeNode> primitiveMap; 61 61 62 62 public SymbolicExpressionTreeTile(IChart chart) 63 63 : base(chart) { 64 64 primitiveMap = new Dictionary<IPrimitive, ISymbolicExpressionTreeNode>(); 65 66 Group = new Group(chart); 65 67 } 66 68 public SymbolicExpressionTreeTile(IChart chart, ISymbolicExpressionTree tree) 67 69 : this(chart) { 68 SymbolicExpressionTree = tree;69 70 PreferredNodeWidth = 80; 70 71 PreferredNodeHeight = 40; 72 SymbolicExpressionTree = tree; 71 73 } 72 74 private void GeneratePrimitives(double preferredNodeWidth, double preferredNodeHeight) { 73 75 Clear(); 74 ISymbolicExpressionTreeNode root = Root;75 if ( root.Symbol is ProgramRootSymbol && root.SubtreeCount == 1) { root = root.GetSubtree(0); }76 var visualNodes = LayoutEngine.CalculateLayout( root);76 var actualRoot = Root; 77 if (Root.Symbol is ProgramRootSymbol && Root.SubtreeCount == 1) { actualRoot = Root.GetSubtree(0); } 78 var visualNodes = LayoutEngine.CalculateLayout(actualRoot); 77 79 78 80 var font = new Font(FontFamily.GenericSansSerif, 10, GraphicsUnit.Pixel);
Note: See TracChangeset
for help on using the changeset viewer.