Constructor and Description |
---|
InterpolatedCurve2D(InterpolatedCurve2D in)
Copy constructor.
|
InterpolatedCurve2D(Interpolator interpolator)
Create an empty instance.
|
Modifier and Type | Method and Description |
---|---|
static double[] |
applySortIndex(double[] a,
int[] remap,
boolean incr)
Sort an array using the index produced by the
insertionSort(double[]) method. |
void |
calculate()
Evaluate the interpolation.
|
boolean |
contains(double x,
double y) |
boolean |
contains(double x,
double y,
double w,
double h) |
boolean |
contains(Point2D p) |
boolean |
contains(Rectangle2D r) |
protected void |
extendXCoords(double newx)
Create extra X coordinates for interpolation points.
|
Rectangle |
getBounds() |
Rectangle2D |
getBounds2D()
Get the floating-point bounds.
|
int |
getCoordCount()
Get the number of coordinates.
|
Interpolator |
getInterpolator()
Get the interpolator.
|
PathIterator |
getPathIterator(AffineTransform at) |
PathIterator |
getPathIterator(AffineTransform at,
double flatness) |
int |
getVertexCount()
Get the number of vertices.
|
double |
getXCoord(int index)
Get an interpolated X-coordinate
|
double[] |
getXCoords()
Get all interpolated X-coordinates.
|
double |
getXVertex(int index)
Get the X-coordinate of a vertex.
|
double[] |
getXVertices()
Get all the X vertices.
|
double |
getYCoord(int index)
Get a interpolated Y-coordinate.
|
double[] |
getYCoords()
Get all interpolated Y-coordinates.
|
double |
getYVertex(int index)
Get the Y-coordinate of a vertex.
|
double[] |
getYVertices()
Get all the Y vertices.
|
static int[] |
insertionSort(double[] a)
Creates an index that sorts a double precision array.
|
boolean |
intersects(double x,
double y,
double w,
double h) |
boolean |
intersects(Rectangle2D r) |
boolean |
isFull()
Return if the Interpolator is full, i.e.
|
boolean |
isIncreasing()
Find out if X coordinates are increasing or decreasing.
|
void |
lineTo(double x,
double y)
Add a new vertex at the end of the curve.
|
void |
moveTo(double x,
double y)
Move the start point of the vertex to the given position.
|
int[] |
orderVertices()
Make sure the vertices are monotonic in some sense.
|
void |
setInterpolator(Interpolator interpolator)
Set the interpolator.
|
void |
setVertex(int index,
double xValue,
double yValue)
Set the coordinates of a vertex.
|
void |
setXVertex(int index,
double value)
Set the X-coordinate of a vertex.
|
void |
setYVertex(int index,
double value)
Set the Y-coordinate of a vertex.
|
String |
toString() |
void |
transform(AffineTransform at)
Transform the vertex positions.
|
void |
translate(double dx,
double dy)
Translate the vertex positions.
|
void |
translateVertex(int index,
double dx,
double dy,
boolean recalc)
Translate the coordinates of a vertex.
|
public InterpolatedCurve2D(Interpolator interpolator)
public InterpolatedCurve2D(InterpolatedCurve2D in)
public void setInterpolator(Interpolator interpolator)
protected void extendXCoords(double newx)
public Interpolator getInterpolator()
public boolean contains(Rectangle2D r)
public boolean contains(double x, double y, double w, double h)
public PathIterator getPathIterator(AffineTransform at, double flatness)
getPathIterator
in interface Shape
public PathIterator getPathIterator(AffineTransform at)
getPathIterator
in interface Shape
public void calculate()
public int[] orderVertices()
public boolean isIncreasing()
public int getVertexCount()
public int getCoordCount()
public boolean intersects(Rectangle2D r)
intersects
in interface Shape
public boolean intersects(double x, double y, double w, double h)
intersects
in interface Shape
public void lineTo(double x, double y)
public void moveTo(double x, double y)
UnsupportedOperationException
- If this isn't the
first vertex.public Rectangle2D getBounds2D()
getBounds2D
in interface Shape
public double[] getXCoords()
public double[] getYCoords()
public double getXCoord(int index)
public double getYCoord(int index)
public boolean isFull()
public double[] getXVertices()
public double[] getYVertices()
public double getXVertex(int index)
public double getYVertex(int index)
public void setXVertex(int index, double value)
public void setYVertex(int index, double value)
public void setVertex(int index, double xValue, double yValue)
public void translateVertex(int index, double dx, double dy, boolean recalc)
If recalc is false then a full re-calculation of the
interpolation coordinates is not performed. This can be used to
defer full re-calculations (if this or other vertices are to be
modified almost immediately) but the user must call either
orderVertices
or setInterpolator
(this can be
with the same interpolator as is currently in use) to force an
eventual re-calculation.
Translation of a vertex is contrained to not break the monotonic nature of X coordinates, so if an attempt to move past another vertex is made this will not be successful.
public void transform(AffineTransform at)
public void translate(double dx, double dy)
public static int[] insertionSort(double[] a)
applySortIndex
methods.public static double[] applySortIndex(double[] a, int[] remap, boolean incr)
insertionSort(double[])
method.Copyright © 2024 Central Laboratory of the Research Councils. All Rights Reserved.