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