Modifier and Type | Field and Description |
---|---|
private Rectangle |
clipBounds |
private Point |
p1 |
private Point |
p2 |
Constructor and Description |
---|
LineClip(Point p1,
Point p2,
Rectangle clipBounds) |
Modifier and Type | Method and Description |
---|---|
private boolean |
cohenSutherland(long x1,
long y1,
long x2,
long y2,
long xmin,
long ymin,
long xmax,
long ymax)
see http://en.wikipedia.org/wiki/Cohen-Sutherland
|
private static int |
computeOutCode(long x,
long y,
long xmin,
long ymin,
long xmax,
long ymax)
The outcode of the point.
|
boolean |
execute()
run the clipping algorithm
|
Point |
getP1() |
Point |
getP2() |
public boolean execute()
private boolean cohenSutherland(long x1, long y1, long x2, long y2, long xmin, long ymin, long xmax, long ymax)
private static int computeOutCode(long x, long y, long xmin, long ymin, long xmax, long ymax)