Changeset 11009 for branches/DataPreprocessing/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/Formatters/SymbolicExpressionTreeLatexFormatter.cs
- Timestamp:
- 06/12/14 13:26:18 (10 years ago)
- Location:
- branches/DataPreprocessing
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/DataPreprocessing
- Property svn:ignore
-
old new 8 8 FxCopResults.txt 9 9 Google.ProtocolBuffers-0.9.1.dll 10 Google.ProtocolBuffers-2.4.1.473.dll 10 11 HeuristicLab 3.3.5.1.ReSharper.user 11 12 HeuristicLab 3.3.6.0.ReSharper.user 12 13 HeuristicLab.4.5.resharper.user 13 14 HeuristicLab.ExtLibs.6.0.ReSharper.user 15 HeuristicLab.Scripting.Development 14 16 HeuristicLab.resharper.user 15 17 ProtoGen.exe … … 17 19 _ReSharper.HeuristicLab 18 20 _ReSharper.HeuristicLab 3.3 21 _ReSharper.HeuristicLab 3.3 Tests 19 22 _ReSharper.HeuristicLab.ExtLibs 20 23 bin 21 24 protoc.exe 22 _ReSharper.HeuristicLab 3.3 Tests23 Google.ProtocolBuffers-2.4.1.473.dll
-
- Property svn:mergeinfo changed
- Property svn:ignore
-
branches/DataPreprocessing/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views
- Property svn:mergeinfo changed
/trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views merged: 10561,10565,10793,10799-10800,10862,10885,10953
- Property svn:mergeinfo changed
-
branches/DataPreprocessing/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/Formatters/SymbolicExpressionTreeLatexFormatter.cs
r10520 r11009 22 22 using System; 23 23 using System.Collections.Generic; 24 using System.Drawing; 24 25 using System.Globalization; 25 26 using System.Linq; … … 36 37 {"StartSymbol","RPB"} 37 38 }; 38 private readonly ReingoldTilfordLayoutEngine<ISymbolicExpressionTreeNode> layoutEngine = new ReingoldTilfordLayoutEngine<ISymbolicExpressionTreeNode>(); 39 40 private readonly ReingoldTilfordLayoutEngine<ISymbolicExpressionTreeNode> layoutEngine; 39 41 40 42 public SymbolicExpressionTreeLatexFormatter() 41 43 : base("LaTeX/PDF Formatter", "Formatter for symbolic expression trees for use with latex package tikz.") { 42 layoutEngine = new ReingoldTilfordLayoutEngine<ISymbolicExpressionTreeNode> {44 layoutEngine = new ReingoldTilfordLayoutEngine<ISymbolicExpressionTreeNode>(n => n.Subtrees) { 43 45 HorizontalSpacing = 2, 44 46 VerticalSpacing = 2, … … 57 59 58 60 public string Format(ISymbolicExpressionTree symbolicExpressionTree) { 59 layoutEngine.Reset();60 61 var root = symbolicExpressionTree.Root; 61 62 var actualRoot = root.SubtreeCount == 0 ? root.GetSubtree(0) : root; 62 layoutEngine.Initialize(actualRoot, x => x.Subtrees); 63 layoutEngine.CalculateLayout(); 64 var nodeCoordinates = layoutEngine.GetCoordinates(); 63 var nodeCoordinates = layoutEngine.CalculateLayout(actualRoot).ToDictionary(n => n.Content, n => new PointF(n.X, n.Y)); 65 64 var sb = new StringBuilder(); 66 65 var nl = Environment.NewLine;
Note: See TracChangeset
for help on using the changeset viewer.