Changeset 6569 for branches/QAPAlgorithms/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolicExpressionTreeChart.cs
- Timestamp:
- 07/17/11 22:51:11 (13 years ago)
- Location:
- branches/QAPAlgorithms
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/QAPAlgorithms
- Property svn:ignore
-
old new 12 12 *.psess 13 13 *.vsp 14 *.docstates
-
- Property svn:mergeinfo changed
- Property svn:ignore
-
branches/QAPAlgorithms/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolicExpressionTreeChart.cs
r5956 r6569 24 24 using System.Drawing; 25 25 using System.Drawing.Imaging; 26 using System.Linq;27 26 using System.Windows.Forms; 28 27 … … 263 262 264 263 //draw terminal node 265 if (node.Subtrees .Count()== 0) {264 if (node.SubtreesCount == 0) { 266 265 graphics.FillRectangle(nodeFillBrush, visualTreeNode.X, visualTreeNode.Y, visualTreeNode.Width, visualTreeNode.Height); 267 266 graphics.DrawRectangle(nodeLinePen, visualTreeNode.X, visualTreeNode.Y, visualTreeNode.Width, visualTreeNode.Height); … … 281 280 //calculate areas for the subtrees according to their tree size and call drawFunctionTree 282 281 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]; 284 283 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, 288 287 xBoundaries[i + 1] - xBoundaries[i], height, connectFrom); 289 288 }
Note: See TracChangeset
for help on using the changeset viewer.