org.eclipse.birt.chart.internal.computations
Class Clip

java.lang.Object
  extended byorg.eclipse.birt.chart.internal.computations.Clip

public class Clip
extends java.lang.Object

Clip is 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 a polyClass argument. This java.lang.Class object is assumed to implement the Poly interface and have a no argument constructor. This was done so that the user of the algorithm could create their own classes that implement the Poly interface 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.

Author:
Dan Bridenbecker, Solution Engineering, Inc.

Method Summary
static IPolygon intersection(IPolygon p1, IPolygon p2)
          Return the intersection of p1 and p2 where the return type is of PolyDefault.
static IPolygon intersection(IPolygon p1, IPolygon p2, java.lang.Class polyClass)
          Return the intersection of p1 and p2 where the return type is of polyClass.
static IPolygon union(IPolygon p1, IPolygon p2)
          Return the union of p1 and p2 where the return type is of PolyDefault.
static IPolygon union(IPolygon p1, IPolygon p2, java.lang.Class polyClass)
          Return the union of p1 and p2 where the return type is of polyClass.
static IPolygon xor(IPolygon p1, IPolygon p2)
          Return the xor of p1 and p2 where the return type is of PolyDefault.
static IPolygon xor(IPolygon p1, IPolygon p2, java.lang.Class polyClass)
          Return the xor of p1 and p2 where the return type is of polyClass.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

intersection

public static IPolygon intersection(IPolygon p1,
                                    IPolygon p2,
                                    java.lang.Class polyClass)
Return the intersection of p1 and p2 where the return type is of polyClass. See the note in the class description for more on polyClass.

Parameters:
p1 - One of the polygons to performt he intersection with
p2 - One of the polygons to performt he intersection with
polyClass - The type of Poly to return

union

public static IPolygon union(IPolygon p1,
                             IPolygon p2,
                             java.lang.Class polyClass)
Return the union of p1 and p2 where the return type is of polyClass. See the note in the class description for more on polyClass.

Parameters:
p1 - One of the polygons to performt he union with
p2 - One of the polygons to performt he union with
polyClass - The type of Poly to return

xor

public static IPolygon xor(IPolygon p1,
                           IPolygon p2,
                           java.lang.Class polyClass)
Return the xor of p1 and p2 where the return type is of polyClass. See the note in the class description for more on polyClass.

Parameters:
p1 - One of the polygons to performt he xor with
p2 - One of the polygons to performt he xor with
polyClass - The type of Poly to return

intersection

public static IPolygon intersection(IPolygon p1,
                                    IPolygon p2)
Return the intersection of p1 and p2 where the return type is of PolyDefault.

Parameters:
p1 - One of the polygons to performt he intersection with
p2 - One of the polygons to performt he intersection with

union

public static IPolygon union(IPolygon p1,
                             IPolygon p2)
Return the union of p1 and p2 where the return type is of PolyDefault.

Parameters:
p1 - One of the polygons to performt he union with
p2 - One of the polygons to performt he union with

xor

public static IPolygon xor(IPolygon p1,
                           IPolygon p2)
Return the xor of p1 and p2 where the return type is of PolyDefault.

Parameters:
p1 - One of the polygons to performt he xor with
p2 - One of the polygons to performt he xor with


Copyright © 2005 Actuate Corp. All rights reserved.