|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.graphbuilder.curve.MultiPath
A multi-path is a series of paths (sequence of connected points) in n-dimensions. The points and move types (MOVE_TO or LINE_TO) are stored using arrays.
Curve
,
ShapeMultiPath
Field Summary | |
static java.lang.Object |
LINE_TO
|
static java.lang.Object |
MOVE_TO
|
Constructor Summary | |
MultiPath(int dimension)
Constructs a multi-path specifying the minimum required dimension of each point appended to this multi-path. |
Method Summary | |
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. |
java.lang.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,
java.lang.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. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.Object MOVE_TO
public static final java.lang.Object LINE_TO
Constructor Detail |
public MultiPath(int dimension)
java.lang.IllegalArgumentException
- If dimension <= 0.Method Detail |
public int getDimension()
public double getFlatness()
setFlatness(double)
public void setFlatness(double f)
java.lang.IllegalArgumentException
- If the flatness is <= 0.getFlatness()
public double[] get(int index)
set(int, double[])
public void set(int index, double[] p)
java.lang.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 java.lang.Object getType(int index)
setType(int, Object)
public void setType(int index, java.lang.Object type)
java.lang.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)
java.lang.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)
java.lang.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)
java.lang.IllegalArgumentException
- If the point is null or the length of the point is less than the
dimension specified in the constructor.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |