Exemple #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);
 }
Exemple #2
0
 protected void RemoveLeftSide(LeftObstacleSide side)
 {
     ObstacleSideComparer.SetOperand(side);
     LeftObstacleSideTree.Remove(side);
 }
Exemple #3
0
 protected void InsertLeftSide(LeftObstacleSide side)
 {
     ObstacleSideComparer.SetOperand(side);
     LeftObstacleSideTree.Insert((side));
 }
Exemple #4
0
 protected void InsertRightSide(RightObstacleSide side)
 {
     ObstacleSideComparer.SetOperand(side);
     RightObstacleSideTree.Insert(side);
 }
Exemple #5
0
 protected void RemoveRightSide(RightObstacleSide side)
 {
     ObstacleSideComparer.SetOperand(side);
     RightObstacleSideTree.Remove(side);
 }