@@ -0,0 +1,1829 @@
+package org.CG.infrastructure;%0A%0Aimport java.util.Iterator;%0Aimport java.util.List;%0Aimport javafx.util.Pair;%0Aimport javax.media.opengl.GL;%0Aimport org.CG.infrastructure.structures.ActiveEdgeTable;%0Aimport org.CG.infrastructure.structures.EdgeNode;%0Aimport org.CG.infrastructure.structures.EdgeTable;%0A%0A/**%0A *%0A * @author ldavid%0A */%0Apublic class ScanLineAlgorithm %7B%0A%0A    protected ActiveEdgeTable aet;%0A    protected EdgeTable et;%0A    protected int yMin, yMax;%0A%0A    public ScanLineAlgorithm(List%3CPair%3CPoint, Point%3E%3E edgePoints) %7B%0A%0A    %7D%0A%0A    public ScanLineAlgorithm(List%3CPair%3CPoint, Point%3E%3E edgePoints, int yMin, int yMax) %7B%0A        if (yMin %3E yMax) %7B%0A            throw new IllegalArgumentException(%0A                %22yMin (%22 + yMin + %22) cannot be greater than yMax (%22 + yMax + %22).%22);%0A        %7D%0A%0A        if (edgePoints == null %7C%7C edgePoints.isEmpty()) %7B%0A            throw new IllegalArgumentException(%0A                %22List of edge points must contain at least one element.%22);%0A        %7D%0A%0A        et = new EdgeTable().addEdges(edgePoints);%0A        aet = new ActiveEdgeTable();%0A%0A        this.yMin = yMin;%0A        this.yMax = yMax;%0A    %7D%0A%0A    public ScanLineAlgorithm draw(GL gl) %7B%0A        for (int y = yMin; y %3C= yMax; y++) %7B%0A            aet.removeEdgesWithMaximumYOf(y);%0A            aet.addEdges(et.getEdgesAtLine(y));%0A%0A            Iterator%3CEdgeNode%3E i = aet.getEdges().iterator();%0A%0A            while (i.hasNext()) %7B%0A                EdgeNode current = i.next();%0A                EdgeNode next = i.next();%0A%0A                for (Rational x = current.getCurrentX();%0A                    next.getCurrentX().gt(x);%0A                    x = x.add(new Rational(1))) %7B%0A                    %0A                    gl.glVertex2i(x.getInteger(), y);%0A                %7D%0A            %7D%0A%0A            aet.nextScanLine();%0A        %7D%0A%0A        return this;%0A    %7D%0A%0A%7D%0A

Add ScanLineAlgorithm class