com.seisw.util.geom
Class Clip
- java.lang.Object
-
- com.seisw.util.geom.Clip
-
public class Clip extends java.lang.ObjectClipis a Java version of the General Poly Clipper algorithm developed by Alan Murta (gpc@cs.man.ac.uk). The home page for the original source can be found at http://www.cs.man.ac.uk/aig/staff/alan/software/.polyClass:Some of the public methods below take apolyClassargument. Thisjava.lang.Classobject is assumed to implement thePolyinterface and have a no argument constructor. This was done so that the user of the algorithm could create their own classes that implement thePolyinterface and still uses this algorithm.Implementation Note: The converted algorithm does support the difference operation, but a public method has not been provided and it has not been tested. To do so, simply follow what has been done for intersection.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method and Description static Polydiff(Poly p1, Poly p2)Return the difference ofp2fromp1where the return type is ofPolyDefault.static Polydiff(Poly p1, Poly p2, java.lang.Class class1)static Polyintersection(Poly p1, Poly p2)Return the intersection ofp1andp2where the return type is ofPolyDefault.static Polyintersection(Poly p1, Poly p2, java.lang.Class polyClass)e return type is ofpolyClass.static Polyunion(Poly p1, Poly p2)Return the union ofp1andp2where the return type is ofPolyDefault.static Polyunion(Poly p1, Poly p2, java.lang.Class polyClass)Return the union ofp1andp2where the return type is ofpolyClass.static Polyxor(Poly p1, Poly p2)Return the xor ofp1andp2where the return type is ofPolyDefault.static Polyxor(Poly p1, Poly p2, java.lang.Class polyClass)Return the xor ofp1andp2where the return type is ofpolyClass.
-
-
-
Method Detail
-
intersection
public static Poly intersection(Poly p1, Poly p2, java.lang.Class polyClass)
e return type is ofpolyClass. See the note in the class description for more onpolyClass. - Parameters:
p1- One of the polygons to performt he intersection withp2- One of the polygons to performt he intersection withpolyClass- The type ofPolyto return
-
union
public static Poly union(Poly p1, Poly p2, java.lang.Class polyClass)
Return the union ofp1andp2where the return type is ofpolyClass. See the note in the class description for more onpolyClass. - Parameters:
p1- One of the polygons to performt he union withp2- One of the polygons to performt he union withpolyClass- The type ofPolyto return
-
xor
public static Poly xor(Poly p1, Poly p2, java.lang.Class polyClass)
Return the xor ofp1andp2where the return type is ofpolyClass. See the note in the class description for more onpolyClass. - Parameters:
p1- One of the polygons to performt he xor withp2- One of the polygons to performt he xor withpolyClass- The type ofPolyto return
-
intersection
public static Poly intersection(Poly p1, Poly p2)
Return the intersection ofp1andp2where the return type is ofPolyDefault.- Parameters:
p1- One of the polygons to performt he intersection withp2- One of the polygons to performt he intersection with
-
union
public static Poly union(Poly p1, Poly p2)
Return the union ofp1andp2where the return type is ofPolyDefault.- Parameters:
p1- One of the polygons to performt he union withp2- One of the polygons to performt he union with
-
xor
public static Poly xor(Poly p1, Poly p2)
Return the xor ofp1andp2where the return type is ofPolyDefault.- Parameters:
p1- One of the polygons to performt he xor withp2- One of the polygons to performt he xor with
-
diff
public static Poly diff(Poly p1, Poly p2)
Return the difference ofp2fromp1where the return type is ofPolyDefault.- Parameters:
p1- The polygon to subtract from.p2- The polygon to subtract.
-
-
DMelt 3.0 © DataMelt by jWork.ORG