Ejemplo n.º 1
0
        internal SweepLine(List <gEdge> edges, SweepLineType type)
        {
            this.sweepLineType = type;
            this.eventsList    = new List <SweepEvent>(edges.Count * 2);
            this.activeEvents  = new List <SweepEvent>(edges.Count);

            edges.ForEach(e => this.AddNewEvent(e));
        }
Ejemplo n.º 2
0
        // TODO: Seems that Q gets corrupted somehow. Check with Tests
        internal SweepLine(gPolygon subject, gPolygon clip, SweepLineType type)
        {
            this.sweepLineType = type;
            this.subject       = subject;
            this.clip          = clip;
            var totalEdges = subject.Edges.Count + clip.Edges.Count;

            this.eventsList   = new List <SweepEvent>(totalEdges * 2);
            this.activeEvents = new List <SweepEvent>(totalEdges);

            subject.Edges.ForEach(e => this.AddNewEvent(e, PolygonType.Subject));
            clip.Edges.ForEach(e => this.AddNewEvent(e, PolygonType.Clip));
        }