Package technology.tabula
Class CohenSutherlandClipping
java.lang.Object
technology.tabula.CohenSutherlandClipping
public final class CohenSutherlandClipping extends Object
Implements the well known Cohen Sutherland line
clipping algorithm (line against clip rectangle).
-
Constructor Summary
Constructors Constructor Description CohenSutherlandClipping()Creates a Cohen Sutherland clipper with clip window (0, 0, 0, 0).CohenSutherlandClipping(Rectangle2D clipWindow)Creates a Cohen Sutherland clipper with the given clip window. -
Method Summary
Modifier and Type Method Description booleanclip(Line2D.Float line)Clips a given line against the clip window.voidsetClip(Rectangle2D clipWindow)Sets the clip rectangle.
-
Constructor Details
-
CohenSutherlandClipping
public CohenSutherlandClipping()Creates a Cohen Sutherland clipper with clip window (0, 0, 0, 0). -
CohenSutherlandClipping
Creates a Cohen Sutherland clipper with the given clip window.- Parameters:
clipWindow- the clip window to use.
-
-
Method Details