|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.bbn.openmap.proj.Clip
public class Clip
Clipping functions.
Method Summary | |
---|---|
static float[] |
liang_clip(int xleft,
int xright,
int ytop,
int ybottom,
float[] x,
float[] y,
int n,
float[] ret_val)
Liang Barsy polygon clipping algorithm. |
static int |
liang_get_buflen(int nverts)
Calculate the float[] 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 float[] liang_clip(int xleft, int xright, int ytop, int ybottom, float[] x, float[] y, int n, float[] ret_val)
Viewport: xleft < xright, ybottom < ytop
Set up with:
float[] ret_val = new float[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
- float[] x coordsy
- float[] y coordsn
- numcoordsret_val
- float[] 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 |