public class IlvPointArray extends Object implements Serializable, IlvPersistentObject
IlvPointArray
is a class that encapsulates an array of
IlvPoint
so that you can more easily manipulate the array.Constructor and Description |
---|
IlvPointArray()
Creates an empty
IlvPointArray . |
IlvPointArray(IlvInputStream stream)
Reads an
IlvPointArray from
an IlvInputStream . |
IlvPointArray(IlvPoint[] points,
boolean copy)
Creates an
IlvPointArray . |
IlvPointArray(IlvPointArray source)
Creates a new
IlvPointArray
by copying another one. |
Modifier and Type | Method and Description |
---|---|
void |
addPoints(IlvPoint[] pts,
int where)
Adds the specified array of
IlvPoint at the
specified index. |
void |
applyTransform(IlvTransformer t)
Applies the transformer to each point of the array.
|
void |
boundingBox(IlvRect rect,
IlvTransformer t)
Computes a rectangle obtained by applying the specified
transformer to the bounding box of the
IlvPointArray . |
static void |
DrawPaths(Graphics dst,
Color color,
IlvPointArray[] paths)
Strokes in the specified path using the specified
Graphics . |
static void |
FillPaths(Graphics dst,
Color color,
IlvPointArray[] paths)
Fills in the specified path using the specified
Graphics . |
int |
getNumberOfPoints()
Returns the number of
IlvPoint in the internal array. |
IlvPoint |
getPoint(int index)
Returns the
IlvPoint stored at the specified index. |
IlvPoint[] |
getPoints()
Returns the internal array of
IlvPoint . |
void |
movePoint(int index,
double x,
double y)
Changes the position of the point at the specified index.
|
int |
nbHorizontalIntersection(IlvPoint p)
Returns the number of times an infinite horizontal ray intersects
the polyline formed by the array of
IlvPoint of the object. |
boolean |
outlineContains(IlvPoint p)
Returns
true if the point p lies
on a segment of the polyline formed by the array of
IlvPoint of the object. |
void |
removePoints(int start,
int count)
Removes points starting at the specified index.
|
void |
setPoints(IlvPoint[] pts,
boolean copy)
Changes the points of the
IlvPointArray . |
void |
write(IlvOutputStream stream)
Writes the object to an
IlvOutputStream . |
public IlvPointArray()
IlvPointArray
.public IlvPointArray(IlvPoint[] points, boolean copy)
IlvPointArray
.points
- the array of points.copy
- if true
the array of points will be copied
before being used by the object, otherwise, the array will be
used internally by the object and you must not use it anymore.public IlvPointArray(IlvInputStream stream) throws IlvReadFileException
IlvPointArray
from
an IlvInputStream
.stream
- the input stream.IlvReadFileException
- when an error occurs while reading.public IlvPointArray(IlvPointArray source)
IlvPointArray
by copying another one.source
- the array to copy.public int getNumberOfPoints()
IlvPoint
in the internal array.public IlvPoint[] getPoints()
IlvPoint
. This array must
not be modified.public IlvPoint getPoint(int index)
IlvPoint
stored at the specified index.index
- the index.public void movePoint(int index, double x, double y)
index
- the index of the point.x
- the new x.y
- the new y.public void addPoints(IlvPoint[] pts, int where)
IlvPoint
at the
specified index.public void removePoints(int start, int count)
count
consecutive points starting at
the index start
.public void boundingBox(IlvRect rect, IlvTransformer t)
IlvPointArray
.rect
- a rectangle to store the result.t
- the transformer.public void setPoints(IlvPoint[] pts, boolean copy)
IlvPointArray
.pts
- the new points.copy
- if true
, a copy of the array of points is made, otherwise
the user must no longer modify it.public boolean outlineContains(IlvPoint p)
true
if the point p
lies
on a segment of the polyline formed by the array of
IlvPoint
of the object.public int nbHorizontalIntersection(IlvPoint p)
IlvPoint
of the object.
The ray starts at p
and goes toward positive x.public void applyTransform(IlvTransformer t)
t
- the transformer to apply.public void write(IlvOutputStream stream) throws IOException
IlvOutputStream
.write
in interface IlvPersistentObject
stream
- the output stream.IOException
- thrown when an exception occurs during
the write operation for this object.public static void FillPaths(Graphics dst, Color color, IlvPointArray[] paths)
Graphics
.dst
- the destination Graphics
.color
- the color to fill the path with.paths
- the path to fill.public static void DrawPaths(Graphics dst, Color color, IlvPointArray[] paths)
Graphics
.dst
- the destination Graphics
.color
- the color to draw the path with.paths
- the path to draw.© Copyright 2024 Rogue Wave Software, Inc., a Perforce company.. All Rights Reserved.