public class IlpPolygon extends IlpPolyPoints implements Shape, IlpPosition, Cloneable
Constructor and Description |
---|
IlpPolygon()
Creates a new
IlpPolygon instance. |
IlpPolygon(IlvPoint[] points)
Creates a new
IlpPolygon instance, connecting given
points. |
IlpPolygon(IlvPoint[] points,
boolean removeRedundant)
Creates a new
IlpPolygon instance, connecting given
points. |
Modifier and Type | Method and Description |
---|---|
void |
applyTransform(IlvTransformer t)
Applies a transform to the points, thereby destructively modifying the
polyline and its segments.
|
Object |
clone()
Creates a copy of this polyline.
|
IlpPolygon |
computeParallel(double apart,
double miterlimit)
Returns a parallel polygon.
|
ilog.cpl.graphic.views.internal.IlpPolyTwoPolylines |
computeThickLinkShape(double thickness,
double miterlimit)
Returns the two polylines bounding the result of blowing up this
polyline to a given thickness.
|
boolean |
contains(double x,
double y) |
boolean |
contains(double x,
double y,
double width,
double height) |
boolean |
contains(Point2D p) |
boolean |
contains(Rectangle2D r) |
boolean |
containsInClosure(double x,
double y)
Determines whether a point is contained in this polygon (inside or
on the border).
|
boolean |
containsInConvexHull(IlvPoint p)
Determines whether a point is contained in the convex hull of this
polygon.
|
boolean |
containsInInterior(double x,
double y)
Determines whether a point is contained in the inside area of this
polygon.
|
double |
getArea()
Returns the area covered by the polygon.
|
IlvPoint |
getGravity2()
Returns the gravity center of the area covered by the polygon.
|
ilog.cpl.graphic.views.internal.IlpPolyPointAndDirection |
getMedian()
Returns the "midpoint" of the polyline, and the direction of the
segment containing it.
|
int |
getNumberOfPoints()
Returns the number of points in the polyline.
|
PathIterator |
getPathIterator(AffineTransform transform) |
PathIterator |
getPathIterator(AffineTransform at,
double flatness) |
void |
insertPoint(IlvPoint p)
Inserts a point into the nearest segment.
|
void |
insertPoint(int index,
IlvPoint p)
Inserts a point into a specific segment.
|
boolean |
intersects(double x,
double y,
double width,
double height) |
boolean |
intersects(Rectangle2D r) |
void |
movePoint(int index,
IlvPoint p)
Moves a specific point to a new location.
|
void |
removePoint(int index)
Removes a specific point.
|
void |
removeRedundantPoints()
Removes all redundant points (points which are between their neighbors).
|
void |
reverse()
Reverses the order of the points, the order of the segments, and the
directions of the segments.
|
equals, getBounds, getBounds2D, getClosestSegment, getGravity0, getGravity1, getNumberOfSegments, getPoint, getPoints, getPointsCloned, getSegment, getSegments, hashCode, toString
finalize, getClass, notify, notifyAll, wait, wait, wait
getBounds, getBounds2D
public IlpPolygon()
IlpPolygon
instance. The segments
must be added afterwards.public IlpPolygon(IlvPoint[] points, boolean removeRedundant)
IlpPolygon
instance, connecting given
points.points
- A non-empty array of points.removeRedundant
- Indicates whether redundant points shall be removed.public IlpPolygon(IlvPoint[] points)
IlpPolygon
instance, connecting given
points.points
- A non-empty array of points.public Object clone()
clone
in class IlpPolyPoints
public int getNumberOfPoints()
getNumberOfPoints
in class IlpPolyPoints
public boolean containsInInterior(double x, double y)
x
- The x coordinate of the point to be tested.y
- The y coordinate of the point to be tested.public boolean containsInClosure(double x, double y)
x
- The x coordinate of the point to be tested.y
- The y coordinate of the point to be tested.public boolean contains(double x, double y)
public boolean contains(Point2D p)
public boolean intersects(double x, double y, double width, double height)
intersects
in interface Shape
public boolean intersects(Rectangle2D r)
intersects
in interface Shape
public boolean contains(double x, double y, double width, double height)
public boolean contains(Rectangle2D r)
public PathIterator getPathIterator(AffineTransform transform)
getPathIterator
in interface Shape
public PathIterator getPathIterator(AffineTransform at, double flatness)
getPathIterator
in interface Shape
public boolean containsInConvexHull(IlvPoint p)
p
- the point to be testedpublic double getArea()
public IlvPoint getGravity2()
public ilog.cpl.graphic.views.internal.IlpPolyPointAndDirection getMedian()
getMedian
in class IlpPolyPoints
public IlpPolygon computeParallel(double apart, double miterlimit)
apart
- distance (positive for a parallel to the right of the
polygon, negative for a parallel to the left of the polygon)miterlimit
- see comments in class IltGraphicUtilpublic ilog.cpl.graphic.views.internal.IlpPolyTwoPolylines computeThickLinkShape(double thickness, double miterlimit)
This is the same as: new IlpPolyTwoPolylines(computeParallel(-0.5*thickness,miterlimit), computeParallel(0.5*thickness,miterlimit))
computeThickLinkShape
in class IlpPolyPoints
miterlimit
- see comments in class IltGraphicUtilpublic void applyTransform(IlvTransformer t)
applyTransform
in class IlpPolyPoints
public void reverse()
reverse
in class IlpPolyPoints
public void insertPoint(int index, IlvPoint p)
insertPoint
in class IlpPolyPoints
index
- Satisfies 0 <= index < getNumberOfSegments().p
- The point to be inserted.public void insertPoint(IlvPoint p)
insertPoint
in class IlpPolyPoints
public void movePoint(int index, IlvPoint p)
movePoint
in class IlpPolyPoints
index
- Satisfies 0 <= index < getNumberOfPoints().p
- The point to be inserted.public void removePoint(int index)
removePoint
in class IlpPolyPoints
index
- Satisfies 0 <= index < getNumberOfPoints().public void removeRedundantPoints()
removeRedundantPoints
in class IlpPolyPoints
© Copyright 2024 Rogue Wave Software, Inc., a Perforce company.. All Rights Reserved.