public class MultiPath extends Object
Curve
,
ShapeMultiPath
Modifier and Type | Field and Description |
---|---|
static Object |
LINE_TO |
static Object |
MOVE_TO |
Constructor and Description |
---|
MultiPath(int dimension)
Constructs a multi-path specifying the minimum required dimension of each point appended
to this multi-path.
|
Modifier and Type | Method and Description |
---|---|
void |
ensureCapacity(int capacity)
Checks that the point array has the specified capacity, otherwise the capacity of the point
array is increased to be the maximum between twice the current capacity and the specified capacity.
|
double[] |
get(int index)
Returns a reference to the point at the specified index.
|
int |
getCapacity()
Returns the capacity of the internal point array.
|
int |
getDimension()
Returns the dimension.
|
double |
getDistSq(double[] p)
Computes the minimum distance^2 from the specified point to the line segments formed by the
points of this multi-path.
|
double |
getFlatness()
Returns the flatness.
|
int |
getNumPoints()
Returns the size counter.
|
Object |
getType(int index)
Returns the type of the point at the specified index.
|
void |
lineTo(double[] p)
Appends a point of type LINE_TO.
|
void |
moveTo(double[] p)
Appends a point of type MOVE_TO.
|
void |
set(int index,
double[] p)
Sets the point at the specified index.
|
void |
setFlatness(double f)
Sets the flatness.
|
void |
setNumPoints(int n)
Sets the size counter.
|
void |
setType(int index,
Object type)
Sets the type of the point at the specified index.
|
void |
trimArray()
Creates a new point array of exact size, copying the points from the old array into the
new one.
|
public MultiPath(int dimension)
IllegalArgumentException
- If dimension <= 0.public int getDimension()
public double getFlatness()
setFlatness(double)
public void setFlatness(double f)
IllegalArgumentException
- If the flatness is <= 0.getFlatness()
public double[] get(int index)
set(int, double[])
public void set(int index, double[] p)
IllegalArgumentException
- If the point is null or the dimension of the point does not
meet the dimension requirement specified in the constructor.get(int)
public Object getType(int index)
setType(int, Object)
public void setType(int index, Object type)
IllegalArgumentException
- If the specified type unknown or the specified index is 0 and type
is not MOVE_TO.getType(int)
public int getNumPoints()
setNumPoints(int)
public void setNumPoints(int n)
getNumPoints()
public int getCapacity()
public void ensureCapacity(int capacity)
public void trimArray()
public void lineTo(double[] p)
IllegalArgumentException
- If the point is null or the dimension of the point does not meet
the dimension requirement specified in the constructor.moveTo(double[])
public void moveTo(double[] p)
IllegalArgumentException
- If the point is null or the dimension of the point does not meet the
dimension requirement specified in the constructor.lineTo(double[])
public double getDistSq(double[] p)
IllegalArgumentException
- If the point is null or the length of the point is less than the
dimension specified in the constructor.Copyright © 2024. All rights reserved.