Changeset 1926
 Timestamp:
 Sep 19, 2010, 1:52:32 AM (11 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

trunk/CrypPlugins/WorkspaceManager/View/VisualComponents/CryptoLineView/CryptoLineView.cs
r1924 r1926 78 78 line.InvalidateVisual(); 79 79 } 80 81 Panel p = (this.Parent as Panel); 82 if (p == null) 83 return; 84 foreach (UIElement shape in p.Children) 85 { 86 if (shape is CryptoLineView) 87 shape.InvalidateVisual(); 88 } 80 89 } 81 90 … … 139 148 } 140 149 141 // parallel 150 // parallel, also overlapping case 142 151 if (StartPoint.X == EndPoint.X && StartPointSec.X == EndPointSec.X  143 152 StartPoint.Y == EndPoint.Y && StartPointSec.Y == EndPointSec.Y) … … 147 156 else 148 157 { 149 // ortho nogal158 // orthogonal but maybe not intersected 150 159 Point up, down, left, right; 151 160 if (StartPoint.X == EndPoint.X) … … 276 285 277 286 278 private bool isConnectionPossibleDebugWrapper(Point p1, Point p2) 279 { 280 bool a = isConnectionPossible(p1, p2); 281 bool b = isConnectionPossible(p2, p1); 282 if (a != b) 283 { 284 throw new Exception("State pew!"); 285 } 286 return a; 287 } 287 288 288 private bool isConnectionPossible(Point p1, Point p2) 289 289 { … … 382 382 private bool performOrthogonalPointConnection(Node n1, Point p2, Node n3, List<Node> nodeList) 383 383 { 384 if (isConnectionPossible DebugWrapper(n1.Point, p2) && isConnectionPossibleDebugWrapper(p2, n3.Point))384 if (isConnectionPossible(n1.Point, p2) && isConnectionPossible(p2, n3.Point)) 385 385 { 386 386 Node n2 = new Node() { Point = p2 }; … … 400 400 private void performOrthogonalPointConnection(Node p1, Node p2) 401 401 { 402 if (isConnectionPossible DebugWrapper(p1.Point, p2.Point))402 if (isConnectionPossible(p1.Point, p2.Point)) 403 403 { 404 404 p1.Vertices.Add(p2); … … 432 432 // connect points 433 433 int loopCount = nodeList.Count; 434 const int performanceTradeoffAt = 10; 435 436 LinkedList<Node> path = null; 437 434 438 for(int i=0; i<loopCount; ++i) 435 439 { 440 if (performanceTradeoffAt != 0 && 441 i == performanceTradeoffAt) 442 { 443 StackFrameDijkstra.Dijkstra<Node> dijkstra = new StackFrameDijkstra.Dijkstra<Node>(); 444 path = dijkstra.findPath(nodeList, startNode, endNode); 445 if (path != null) 446 { 447 break; 448 } 449 } 450 436 451 var p1 = nodeList[i]; 437 452 // TODO: inner loop restriction! n²n! … … 439 454 for(int k=i; k<loopCount; ++k) 440 455 { 456 457 441 458 var p2 = nodeList[k]; 442 459 if (p1 == p2) … … 468 485 } 469 486 470 StackFrameDijkstra.Dijkstra<Node> dijkstra = new StackFrameDijkstra.Dijkstra<Node>(); 471 var path = dijkstra.findPath(nodeList, startNode, endNode); 487 if (path == null) 488 { 489 StackFrameDijkstra.Dijkstra<Node> dijkstra = new StackFrameDijkstra.Dijkstra<Node>(); 490 path = dijkstra.findPath(nodeList, startNode, endNode); 491 } 472 492 473 493 if (path != null)
Note: See TracChangeset
for help on using the changeset viewer.