

PREV CLASS NEXT CLASS  FRAMES NO FRAMES  
SUMMARY: INNER  FIELD  CONSTR  METHOD  DETAIL: FIELD  CONSTR  METHOD 
java.lang.Object  +movingregion.TriRepUtil
This class contains a number of static utility methods used by the other classes.
Constructor Summary  
TriRepUtil()

Method Summary  
static void 
computeLineAngles(LineWA[] lines)
Computes the angle between two consecutive lines for all the lines given, and stores this in the LineWA objects. 
static void 
computeOverlapGraph(ConvexHullTreeNode obj1,
ConvexHullTreeNode obj2,
double min_overlap_match)
Computes the overlaps between objects at the same level of the line tree. 
static void 
computeOverlapGraphIter(ConvexHullTreeNode obj1,
ConvexHullTreeNode obj2,
double min_overlap_match)
Iterator function used by computeOverlapGraph . 
static LineWA[] 
convexHull(LineWA[] lt)
Computes the convex hull of a list of lines and places this at the beginning of the array given in the input. 
static double[] 
convexHullDistance(LineWA[] obj1,
LineWA[] obj2)
This function computes the distance between two polygons by computing the smallest convex hull containing both polygons and then computing how much each of the polygons overlap with this convex hull. 
static LineWA[] 
createLineList(int[] xlist,
int[] ylist)
Creates a LineWA list from two sets of coordinate values. 
static LineWA[] 
createLineList(java.util.Vector pointList)
This function turns a vector of LineWA
values into an array of LineWA . 
static int 
findArea(LineWA[] obj)
Finds the area of a polygon represented by a point list. 
static double[] 
findOverlap(LineWA[] obj1,
LineWA[] obj2)
Finds the overlap between two polygons represented by point lists. 
static int 
indexOf(java.lang.Object[] array,
java.lang.Object obj)
Finds where in an array a given object is. 
static int 
indexOf(java.lang.Object[] array,
java.lang.Object obj,
int startindex)
Finds where in an array a given object is. 
static void 
printLineList(LineWA[] lines)
For debugging purposes: prints the coordinate values of the points in a line list to the screen. 
static void 
recomputeOverlapGraph(ConvexHullTreeNode obj1,
ConvexHullTreeNode obj2,
double min_overlap)
Computes the overlaps between objects at the same level of the line tree. 
static void 
removeAllOverlaps(ConvexHullTreeNode obj)
Removes all overlap references to a given convex hull tree node and all it's children from the convex hull tree. 
static void 
removeDuplicates(java.util.List list)
Removes duplicate objects from the given list. 
static void 
removeDuplicatesR(java.util.Vector list)
Removes duplicated without sorting. 
static void 
rotateCycle(LineWA[] shape,
double angle)
This function rotates the given cycle around its center. 
static int 
sameSide(LineWA line1,
LineWA line2,
LineWA p1,
LineWA p2)
Checks whether the points p1 and p2 are on the same side of the line represented by line1 and line2. 
static void 
translateCycle(LineWA[] outline,
int dx,
int dy)
Moves the given cycle by dx and dy. 
Methods inherited from class java.lang.Object 
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait 
Constructor Detail 
public TriRepUtil()
Method Detail 
public static int sameSide(LineWA line1, LineWA line2, LineWA p1, LineWA p2)
line1
 The starting point of the line given as a LineWAline2
 The ending point of the line given as a LineWAp1
 The first pointp2
 The second pointpublic static void removeDuplicates(java.util.List list)
list
 The list of object from which the function should remove
duplicates.public static void removeDuplicatesR(java.util.Vector list)
list
 The list of object from which the function should remove
duplicates.public static LineWA[] convexHull(LineWA[] lt)
Warning: The angle stored in the elements in the input list as well as the ordering of the elements in the list is changed by this function!
lt
 The polygon represented as a list of linespublic static int indexOf(java.lang.Object[] array, java.lang.Object obj)
array
 The array to be searchedobj
 The object to be searched forpublic static int indexOf(java.lang.Object[] array, java.lang.Object obj, int startindex)
array
 The array to be searchedobj
 The object to be searched forstartindex
 The index at which the function should start
searching.public static int findArea(LineWA[] obj)
obj
 The polygon represented as a LineWA array.public static double[] findOverlap(LineWA[] obj1, LineWA[] obj2)
obj1
 The first polygon represented as a LineWA array.obj2
 The second polygon represented as a LineWA array.double
values. The first
is the percentage of obj1 that obj2 overlaps,
and the second is the percentage of obj2 that
obj1 overlaps.public static double[] convexHullDistance(LineWA[] obj1, LineWA[] obj2)
obj1
 The first polygon represented as a LineWA array.obj2
 The second polygon represented as a LineWA array.double
values. The first
is the percentage of the convex hull that obj1 overlaps,
and the second is the percentage of the convex hull that
obj2 overlaps.public static void computeOverlapGraph(ConvexHullTreeNode obj1, ConvexHullTreeNode obj2, double min_overlap_match)
obj1
 The first object represented as a convex hull tree.obj2
 The second object represented as a convex hull tree.min_overlap_match
 The amount of overlap required to consider the
two objects to match.public static void computeOverlapGraphIter(ConvexHullTreeNode obj1, ConvexHullTreeNode obj2, double min_overlap_match)
computeOverlapGraph
.obj1
 The first object represented as a convex hull tree.obj2
 The second object represented as a convex hull tree.min_overlap_match
 The amount of overlap required to consider the
two objects to match.public static void recomputeOverlapGraph(ConvexHullTreeNode obj1, ConvexHullTreeNode obj2, double min_overlap)
computeOverlapGraph
is that this one does not insert
overlap graph edges for the nodes themselves, only for the children.obj1
 The first object represented as a convex hull tree.obj2
 The second object represented as a convex hull tree.min_overlap
 The amount of overlap required to consider the
two objects to match.public static void removeAllOverlaps(ConvexHullTreeNode obj)
obj
 The comvex hull tree node to be removed.public static LineWA[] createLineList(int[] xlist, int[] ylist)
LineWA
list from two sets of coordinate values.
This function also computes the angles between two consecutive lines
and stores these in the LineWA
objects.xlist
 A list of the xcoordinates of the points.ylist
 A list of the ycoordinates of the points.LineWA
objects containing the points
given.public static LineWA[] createLineList(java.util.Vector pointList)
vector
of LineWA
values into an array of LineWA
. The function also
computes the angles between two consecutive lines and stores this
in the LineWA
objects.pointList
 The list of points given as LineWA
's.LineWA
'spublic static void computeLineAngles(LineWA[] lines)
LineWA
objects.lines
 The list of lines.public static void printLineList(LineWA[] lines)
lines
 The list of LineWA
objects to be printedpublic static void rotateCycle(LineWA[] shape, double angle)
shape
 The cycle to be rotated given as a LineWA
array.angle
 The angle in radians that the shape should be rotated.public static void translateCycle(LineWA[] outline, int dx, int dy)
outline
 The cycle to be moved given as a LineWA
array.dx
 How far along the xaxis the cycle should be moved.dy
 How far along the yaxis the cycle should be moved.


PREV CLASS NEXT CLASS  FRAMES NO FRAMES  
SUMMARY: INNER  FIELD  CONSTR  METHOD  DETAIL: FIELD  CONSTR  METHOD 