|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object | +--com.bbn.openmap.proj.Clip
Clipping functions.
| Method Summary | |
static int[] |
liang_clip(int xleft,
int xright,
int ytop,
int ybottom,
int[] x,
int[] y,
int n,
int[] ret_val)
Liang Barsy polygon clipping algorithm. |
static int |
liang_get_buflen(int nverts)
Calculate the int[] x,y buffer length for nverts. |
static int |
quickCheckLineClip(int x1,
int y1,
int x2,
int y2,
int xleft,
int xright,
int ytop,
int ybottom)
Check if a line is completely inside or completely outside viewport. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
public static final int liang_get_buflen(int nverts)
nverts - number of verts
public static final int[] liang_clip(int xleft,
int xright,
int ytop,
int ybottom,
int[] x,
int[] y,
int n,
int[] ret_val)
Viewport: xleft < xright, ybottom < ytop
Set up with:
int[] ret_val = new int[n*2*2];
ret_val = liang_clip(,...,ret_val);
Points: xpoints, ypoints, npts HACK: closure on these points?
xleft - left side of viewportxright - right side of viewportytop - top of viewportybottom - bottom of viewportx - int[] x coordsy - int[] y coordsn - numcoordsret_val - int[] clipped polygonliang_get_buflen(int)
public static final int quickCheckLineClip(int x1,
int y1,
int x2,
int y2,
int xleft,
int xright,
int ytop,
int ybottom)
x1 - pt1.xy1 - pt1.yx2 - pt2.xy2 - pt2.yxleft - leftxright - rightytop - ytop < ybottomybottom - ybottom < ytop
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||