ilog.util
Class IlIntPolygon

java.lang.Object
  extended by java.awt.Polygon
      extended by ilog.util.IlIntPolygon
All Implemented Interfaces:
Shape, Serializable
Direct Known Subclasses:
IltPolygon

public class IlIntPolygon
extends Polygon

This class describes a polygon where all the corners have integer coordinates.

Since:
JTGO 3.0
See Also:
Serialized Form

Field Summary
static int EvenOddRule
          Mode for filling polygons: If the winding number of an area is even, this area is filled.
static int WindingRule
          Mode for filling polygons: If the winding number of an area is nonzero, this area is filled.
 
Fields inherited from class java.awt.Polygon
bounds, npoints, xpoints, ypoints
 
Constructor Summary
IlIntPolygon(int[] xpoints, int[] ypoints, int npoints)
          Creates a polygon.
IlIntPolygon(int[] xpoints, int[] ypoints, int npoints, int fillRule)
          Deprecated. Use the three-argument constructor. The only supported fillRule is EvenOddRule.
 
Method Summary
 Polygon getFillingPolygon()
          Returns a polygon which, when filled according to EvenOddRule, represents (approximately) this polygon.
protected  int getFillRule()
          Returns the mode for filling this polygon.
 Enumeration horizontalLineIntersection(int y)
          Intersects this polygon with a given horizontal line, and returns an enumeration of the intervals belonging to the polygon.
protected  void setFillRule(int r)
          Sets the mode for filling this polygon.
 String toString()
          Returns the String representation of this IlIntPolygon's values.
 
Methods inherited from class java.awt.Polygon
addPoint, contains, contains, contains, contains, contains, contains, getBoundingBox, getBounds, getBounds2D, getPathIterator, getPathIterator, inside, intersects, intersects, invalidate, reset, translate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

EvenOddRule

public static final int EvenOddRule
Mode for filling polygons: If the winding number of an area is even, this area is filled.

See Also:
Constant Field Values

WindingRule

public static final int WindingRule
Mode for filling polygons: If the winding number of an area is nonzero, this area is filled.

See Also:
Constant Field Values
Constructor Detail

IlIntPolygon

public IlIntPolygon(int[] xpoints,
                    int[] ypoints,
                    int npoints)
Creates a polygon.

Note: The implementation may remove redundant points.

Parameters:
xpoints - the array of x coordinates
ypoints - the array of y coordinates
npoints - the total number of points in the polygon

IlIntPolygon

public IlIntPolygon(int[] xpoints,
                    int[] ypoints,
                    int npoints,
                    int fillRule)
Deprecated. Use the three-argument constructor. The only supported fillRule is EvenOddRule.

Creates a polygon.

Note: The implementation may remove redundant points.

Parameters:
xpoints - the array of x coordinates
ypoints - the array of y coordinates
npoints - the total number of points in the polygon
fillRule - the filling mode of this polygon (EvenOddRule)
Deprecated Since:
JTGO 3.0
Method Detail

getFillRule

protected int getFillRule()
Returns the mode for filling this polygon.

Internal method or field: do not use!

setFillRule

protected void setFillRule(int r)
Sets the mode for filling this polygon.

Parameters:
r -
Internal method or field: do not use!

getFillingPolygon

public Polygon getFillingPolygon()
Returns a polygon which, when filled according to EvenOddRule, represents (approximately) this polygon.


horizontalLineIntersection

public Enumeration horizontalLineIntersection(int y)
Intersects this polygon with a given horizontal line, and returns an enumeration of the intervals belonging to the polygon.

Parameters:
y - the y coordinate of the horizontal line
Returns:
an empty enumeration
Internal method or field: do not use!

toString

public String toString()
Returns the String representation of this IlIntPolygon's values.

Overrides:
toString in class Object


Copyright © 1996-2007 ILOG S.A. All rights reserved.   Documentation homepage.   . All Rights Reserved.