Example #1
0
 public LineSweeperBase(IEnumerable <Polyline> obstacles, Point sweepDirection)
 {
     Obstacles             = obstacles;
     SweepDirection        = sweepDirection;
     DirectionPerp         = sweepDirection.Rotate(-Math.PI / 2);
     EventQueue            = new BinaryHeapWithComparer <SweepEvent>(this);
     ObstacleSideComparer  = new ObstacleSideComparer(this);
     LeftObstacleSideTree  = new RbTree <SegmentBase>(ObstacleSideComparer);
     RightObstacleSideTree = new RbTree <SegmentBase>(ObstacleSideComparer);
 }
Example #2
0
 protected void RemoveLeftSide(LeftObstacleSide side)
 {
     ObstacleSideComparer.SetOperand(side);
     LeftObstacleSideTree.Remove(side);
 }
Example #3
0
 protected void InsertLeftSide(LeftObstacleSide side)
 {
     ObstacleSideComparer.SetOperand(side);
     LeftObstacleSideTree.Insert((side));
 }
Example #4
0
 protected void InsertRightSide(RightObstacleSide side)
 {
     ObstacleSideComparer.SetOperand(side);
     RightObstacleSideTree.Insert(side);
 }
Example #5
0
 protected void RemoveRightSide(RightObstacleSide side)
 {
     ObstacleSideComparer.SetOperand(side);
     RightObstacleSideTree.Remove(side);
 }