

PREV CLASS NEXT CLASS  FRAMES NO FRAMES  
SUMMARY: INNER  FIELD  CONSTR  METHOD  DETAIL: FIELD  CONSTR  METHOD 
java.lang.Object  +movingregion.ConvexHullTreeNode
This class represents a node in the convex hull tree. The node contains a polygon representation of an object or concavity, and links to child nodes representing concavities in the object. The polygon represented in a convex hull tree node is convex.
Field Summary  
static int 
X_DISP

static int 
Y_DISP

Constructor Summary  
ConvexHullTreeNode()
Creates an empty convex hull tree node 

ConvexHullTreeNode(LineWA[] linelist,
double min,
double minmatch)
Creates a convex hull tree from the given polygon. 

ConvexHullTreeNode(LineWA[] linelist,
int level,
double min,
double minmatch)
Creates a convex hull tree from the given polygon. 
Method Summary  
ConvexHullTreeNode 
createChild(int lineindex)
This function creates an empty convex hull tree node and associates it with a given line in this object. 
int[] 
drawThis(java.awt.Graphics g,
int xdisp,
int ydisp)
This function draws this convex hull three node in a "flattened" way. 
void 
drawTree(java.awt.Graphics g,
int xdisp,
int ydisp)
Draws the convex hull tree with this node as its root. 
ConvexHullTreeNode[] 
getChildren()
Returns all children of this node. 
LineWA 
getLine(int index)
This function returns the line at a given position in the line list. 
LineWA[] 
getLineForChild(ConvexHullTreeNode child)
This function finds the line a given child of this node is associated with. 
LineWA[] 
getLines()
Gets the polygon stored in the convex hull tree that has this node as its root. 
LineWA[] 
getOrderedOutLine()
Gets the polygon stored in the node with the point with the smallest ycoordinate first. 
LineWA[] 
getOutLine()
Gets the polygon stored in the node in the order in which it is stored internally. 
OverlapGraphEdge[] 
getOverlapEdges()
Returns all overlap graph edges going from this node. 
ConvexHullTreeNode[] 
getOverlappingNodes()
Returns all convex hull tree nodes that overlaps with this node. 
int 
getSmallestPoint()
Gets the smallest point. 
void 
insertChild(int lineindex,
ConvexHullTreeNode child)
This function links a particular line in this object to a given convex hull tree node, thereby making it a child of this node. 
int 
insertLine(LineWA line)
This function inserts a new line at the end of the list of lines defining the polygon represented by this object. 
void 
insertOverlap(double amount,
ConvexHullTreeNode node)
This function inserts an overlap graph edge between this node and another node. 
boolean 
isMatched()
Finds whether this object has already been matched to another convex hull tree node or not. 
LineWA[] 
joinChildren(ConvexHullTreeNode[] tojoin)
This function takes the given nodes, which must be children of this node, and creates a single convex hull tree node out of them. 
int 
numberOfLines()
Finds the number of lines that makes op the polygon stored in this node. 
void 
removeAllOverlaps()
Removes all overlap edges going out from this node. 
void 
removeLine(int index)
This function removes a line from the polygon. 
void 
removeOverlap(ConvexHullTreeNode node)
This function removes an overlap graph edge between this node and another node. 
void 
setMatched(boolean val)
Sets the variable indicating whether this object has been matched to another or not. 
void 
sortOverlapEdges()
This function sorts the overlap graph edges of this node by the amount of overlap. 
Methods inherited from class java.lang.Object 
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait 
Field Detail 
public static final int Y_DISP
public static final int X_DISP
Constructor Detail 
public ConvexHullTreeNode()
public ConvexHullTreeNode(LineWA[] linelist, double min, double minmatch)
linelist
 The polygon represented as a list of LineWA
objects.min
 The minimum overlap required for an edge to be added to the
overlap graphminmatch
 The minimum overlap required for two convex hull tree
nodes to match.public ConvexHullTreeNode(LineWA[] linelist, int level, double min, double minmatch)
linelist
 The polygon represented as a list of LineWA
objects.level
 Which level of the convex hull tree this node is onmin
 The minimum overlap required for an edge to be added to the
overlap graphminmatch
 The minimum overlap required for two convex hull tree
nodes to match.Method Detail 
public int insertLine(LineWA line)
line
 The line represented by a LineWA
object.public void removeLine(int index)
index
 The line represented by its index in the list of lines.public LineWA getLine(int index)
index
 The line represented by its index in the list of lines.LineWA
object.
Modifications to this LineWA
object are also
reflected in the line stored in this object!public ConvexHullTreeNode createChild(int lineindex)
lineindex
 The line represented by its index in the list of lines.public void insertChild(int lineindex, ConvexHullTreeNode child)
lineindex
 The line represented by its index in the list of lines.child
 The convex hull tree node which should be linked to
the line.public void insertOverlap(double amount, ConvexHullTreeNode node)
amount
 How much the two nodes overlap, given as the percentage
of this object that is overlapped by the other object.node
 The convex hull tree node that overlaps this node.public void removeOverlap(ConvexHullTreeNode node)
node
 The other node.public void removeAllOverlaps()
public int numberOfLines()
public ConvexHullTreeNode[] getChildren()
ConvexHullTreeNode
array.public OverlapGraphEdge[] getOverlapEdges()
OverlapGraphEdge
array.public ConvexHullTreeNode[] getOverlappingNodes()
ConvexHullTreeNode
array.public void sortOverlapEdges()
public LineWA[] getLineForChild(ConvexHullTreeNode child)
child
 The child node.LineWA
objects, the one associated
with the child node and the next one. If the convex hull tree
node given as parameter to this function is not a child
of this node, this function returns NULL.public int getSmallestPoint()
public int[] drawThis(java.awt.Graphics g, int xdisp, int ydisp)
g
 The graphic into which the function should draw.xdisp
 Displacement in the x directionydisp
 Displacement in the y direction.public void drawTree(java.awt.Graphics g, int xdisp, int ydisp)
g
 The graphic into which the function should draw.xdisp
 Displacement in the x directionydisp
 Displacement in the y direction.public LineWA[] getOutLine()
LineWA
array.public LineWA[] getOrderedOutLine()
LineWA
array.public LineWA[] getLines()
LineWA
array.public void setMatched(boolean val)
val
 TRUE if this object has been matched, FALSE otherwise.public boolean isMatched()
public LineWA[] joinChildren(ConvexHullTreeNode[] tojoin)
tojoin
 The convex hull tree nodes which should be joinen.LineWA
objects.
This function will return null if there is an error.


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