de.grogra.vecmath.geom
public final class IntersectionList extends Variables
Volume. The list is
piecewise sorted in ascending order of distance, i.e., of
Intersection.parameter. The congiguous
pieces are computed by
Volume.computeIntersections(de.grogra.vecmath.geom.Line, int, de.grogra.vecmath.geom.IntersectionList, de.grogra.vecmath.geom.Intersection, de.grogra.vecmath.geom.Intersection).| Modifier and Type | Field and Description |
|---|---|
Intersection[] |
elements
Contains the list of intersections.
|
int |
size
Specifies the number of valid intersections in
elements. |
cache, istack, tmpLine, tmpMatrix3, tmpPoint0, tmpPoint1, tmpPoint2, tmpPoint3, tmpVector0, tmpVector1, tmpVector2, tmpVector3| Constructor and Description |
|---|
IntersectionList() |
| Modifier and Type | Method and Description |
|---|---|
Intersection |
add(Volume v,
Line l,
double p,
int type)
Appends an intersection element to this list and returns
the appended instance.
|
Intersection |
add(Volume v,
Line l,
double p,
int type,
int face)
Appends an intersection element to this list and returns
the appended instance.
|
void |
addSwap(int index)
Appends a new intersection element to this list and swaps it with
the existing element at
index. |
void |
clear()
Clears this list so that the size is 0.
|
int |
findClosestIntersection(double p,
double maxDiff,
int start,
int end)
Returns the index of the intersection whose parameter is
closest to
p. |
void |
remove(int start,
int end)
Removes the elements with indices from
start to
end - 1. |
void |
setSize(int size)
Sets the
size of this list to the specified
value. |
java.lang.String |
toString() |
public Intersection[] elements
size - 1 are valid.public int size
elements.public Intersection add(Volume v, Line l, double p, int type)
v - volume of intersectionl - line of intersectionp - line parameter of intersectiontype - type of intersection (see Intersection.type)public Intersection add(Volume v, Line l, double p, int type, int face)
v - volume of intersectionl - line of intersectionp - line parameter of intersectiontype - type of intersection (see Intersection.type)face - face value of intersectionpublic void addSwap(int index)
index.index - index of the element to be swapped with the new elementpublic void clear()
public int findClosestIntersection(double p,
double maxDiff,
int start,
int end)
p. Only intersection elements with
indices from start to end - 1
and with a parameter value whose difference to p
is less than maxDistance are considered.p - a line parametermaxDiff - maximum difference between p and intersectionsstart - index to start (inclusive)end - index to end (exclusive)public void remove(int start,
int end)
start to
end - 1.start - index to start (inclusive)end - index to end (exclusive)public void setSize(int size)
size of this list to the specified
value. The first size elements
will contain valid instances when this method returns.size - new size of this listpublic java.lang.String toString()
toString in class java.lang.Object