ilog.tgo.grprim
Class IltPolygon

java.lang.Object
  extended by java.awt.Polygon
      extended by ilog.util.IlIntPolygon
          extended by ilog.tgo.grprim.IltPolygon
All Implemented Interfaces:
Shape, Serializable

public class IltPolygon
extends IlIntPolygon

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

See Also:
IltPolyline, Serialized Form

Field Summary
 
Fields inherited from class ilog.util.IlIntPolygon
EvenOddRule, WindingRule
 
Fields inherited from class java.awt.Polygon
bounds, npoints, xpoints, ypoints
 
Constructor Summary
IltPolygon(int[] xpoints, int[] ypoints, int npoints)
          Creates a polygon.
IltPolygon(int[] xpoints, int[] ypoints, int npoints, int fillRule)
          Deprecated. Please use the three-argument constructor. The only supported fillRule is EvenOddRule anyway.
 
Method Summary
 void addPoint(int x, int y)
           
 boolean contains(int x, int y)
          Determines whether a point is contained in the inside area of this polygon.
 boolean containsInClosure(int x, int y)
          Determines whether a point is contained in this polygon (inside or on the border).
 boolean containsInInterior(int x, int y)
          Determines whether a point is contained in the inside area of this polygon.
 Polygon getFillingPolygon()
          Returns a polygon which, when filled according to EvenOddRule, represents (approximately) 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.
 
Methods inherited from class ilog.util.IlIntPolygon
getFillRule, setFillRule, toString
 
Methods inherited from class java.awt.Polygon
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
 

Constructor Detail

IltPolygon

public IltPolygon(int[] xpoints,
                  int[] ypoints,
                  int npoints,
                  int fillRule)
Deprecated. Please use the three-argument constructor. The only supported fillRule is EvenOddRule anyway.

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
Deprecated Since:
JTGO 3.0

IltPolygon

public IltPolygon(int[] xpoints,
                  int[] ypoints,
                  int npoints)
Creates a polygon. The default fillRule is EvenOddRule.

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
Method Detail

containsInInterior

public boolean containsInInterior(int x,
                                  int y)
Determines whether a point is contained in the inside area of this polygon.

Parameters:
x - the x coordinate of the point to be tested
y - the y coordinate of the point to be tested

containsInClosure

public boolean containsInClosure(int x,
                                 int y)
Determines whether a point is contained in this polygon (inside or on the border).

Parameters:
x - the x coordinate of the point to be tested
y - the y coordinate of the point to be tested

contains

public boolean contains(int x,
                        int y)
Determines whether a point is contained in the inside area of this polygon.

Overrides:
contains in class Polygon
Parameters:
x - the x coordinate of the point to be tested
y - the y coordinate of the point to be tested

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.

Overrides:
horizontalLineIntersection in class IlIntPolygon
Parameters:
y - the y coordinate of the horizontal line
Returns:
an enumeration of IltPolygon.IlHorizontalInterval
Internal method or field: do not use!

addPoint

public void addPoint(int x,
                     int y)
Overrides:
addPoint in class Polygon

getFillingPolygon

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

Overrides:
getFillingPolygon in class IlIntPolygon


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