Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
02/28/14 11:56:15 (10 years ago)
Author:
bburlacu
Message:

#2076: Got rid of layout adapters. Extracted the previous drawing code and made it into another layout engine called the BoxesLayoutEngine (because it divides the areas necessary for each subtree into boxes and recursively applies the layout). Simplified usage of layout engine so that most of the things are handled internally, and the user just has to provide some lambdas telling the engine how to navigate the original tree. Added context option in the SymbolicExpressionTreeChart to choose which layout engine to use for tree drawing. Moved the SymbolicExpressionTreeLatexFormatter to the HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views assembly because it depends on the layout engine.

Location:
trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/LayoutEngines
Files:
1 edited
1 moved

Legend:

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

    r10471 r10520  
    2424using System.Linq;
    2525
    26 namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding {
    27   public class LayoutNode<T> where T : class {
     26namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views {
     27  public class LayoutNode<T> : object where T : class {
     28    public float Width { get; set; }
     29    public float Height { get; set; }
     30
    2831    public LayoutNode<T> NextLeft {
    2932      get {
     
    7578      }
    7679    }
     80    /// <summary>
     81    /// Translate the position of the layout node according to the given offsets
     82    /// </summary>
     83    /// <param name="dx"></param>
     84    /// <param name="dy"></param>
     85    public void Translate(float dx, float dy) {
     86      X += dx;
     87      Y += dy;
     88    }
     89
     90    public void ResetCoordinates() {
     91      X = 0;
     92      Y = 0;
     93    }
     94
     95    /// <summary>
     96    /// Reset layout-related parameters
     97    /// </summary>
     98    public void Reset() {
     99      Ancestor = this;
     100      Thread = null;
     101      Change = 0;
     102      Shift = 0;
     103      Prelim = 0;
     104      Mod = 0;
     105      ResetCoordinates();
     106    }
    77107  }
    78108}
Note: See TracChangeset for help on using the changeset viewer.