

PREV CLASS NEXT CLASS  FRAMES NO FRAMES  
SUMMARY: INNER  FIELD  CONSTR  METHOD  DETAIL: FIELD  CONSTR  METHOD 
java.lang.Object  +movingregion.TriangleRep
This class is used to create a time slice of a moving cycle. It takes two snapshots of a moving cycle and constructs and stores a graph representation of the moving cycle.
Field Summary  
int[] 
endpoints

double 
min_overlap

double 
min_overlap_match

Constructor Summary  
TriangleRep()
Constructor without parameters. 

TriangleRep(ConvexHullTreeNode root1,
ConvexHullTreeNode root2,
double minOverlMatch)
Constructs the graph representation from two arbitrarily shaped polygons represented by convex hull trees. 

TriangleRep(LineWA[] poly1,
LineWA[] poly2,
double minOverlMatch)
Constructs the graph representation from two arbitrarily shaped polygons represented as lists of lines. 
Method Summary  
int 
findPoint(int x1,
int y1,
int t1)
This function determines which point in the graph structure lies at a given coordinate value. 
int 
getCorrespondingPoint(int index1,
int index2)
Given two points in the same snapshot, finds the third point which forms a triangle with the two points. 
int[] 
getCorrespondingPoint(int x1,
int y1,
int x2,
int y2,
int t1)
Given two points in the same snapshot, finds the third point which forms a triangle with the two points. 
int[] 
getNeighbours(int p1)
This function is used to find which points are the neighbours of a given point. 
int[] 
getNeighbours(java.lang.Object p)
This function is used to find which points are the neighbours of a given point. 
int 
getNumberOfNeighbours(int p1)
Get the number of neighbours that a given point has. 
int 
getNumberOfPoints()
Determines how many points there are in the graph representation. 
int[] 
getOrderedSnapshot(int time)
This function is used to get the points in one snapshot from the graph representation and sort them so that they come in counterclockwise order. 
java.lang.Object 
getPoint(int index)

java.lang.Object[] 
getPoints()
This function returns the list of points as an array of objects. 
int[] 
getPosition(int p1)
Returns the position of a point in spacetime as an integer array. 
int[] 
getSnapshot(int time)
This function is used to get the points in one snapshot from the graph representation. 
boolean 
insertConcavity(TriangleRep concavity,
ConvexHullTreeNode root1,
ConvexHullTreeNode root2)
Inserts a concavity into this graph representation by removing two lines from the graph representation and replacing them with the graph representation of the concavity object. 
void 
insertHalfConcavity(LineWA[] lines,
int p1,
int p2,
int copoint,
int t)
Insert a concavity in one snapshot that is matched to a point in the other into the graph representation. 
void 
insertLine(int p1,
int p2)
Inserts a line from p1 to p2 into the graph. 
int 
insertPoint(int x,
int y,
int t)
Inserts a point into the graph structure. 
boolean 
neighbours(int p1,
int p2)
Test whether two points are neighbours. 
boolean 
pointExists(int index)
This function checks whether a point is stored in a given index in the point list. 
boolean 
removeLine(int p1,
int p2)
Removes a previously inserted line from the graph structure. 
boolean 
removePoint(int p1)
Removes a point from the graph structure. 
void 
saveAsVRML(java.lang.String filename)
Creates a VRML file containing a VRML representation of the graph (an indexedFaceSet). 
void 
translateSnapshot(int dx,
int dy,
int time)
This function moves the coordinate values of each point in the given snapshot. 
void 
writeTriangles(int time,
java.io.OutputStreamWriter fs,
java.util.Vector convertlist)
Writes the individual triangular surfaces containing one line from the given snapshot into the VRML file. 
Methods inherited from class java.lang.Object 
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait 
Field Detail 
public double min_overlap
public double min_overlap_match
public int[] endpoints
Constructor Detail 
public TriangleRep()
public TriangleRep(LineWA[] poly1, LineWA[] poly2, double minOverlMatch)
poly1
 The first snapshot represented as a list of line segmentspoly2
 The second snapshot represented as a list of line segmentsminOverlMatch
 How much overlap between concavities is
necessary for them to be matched to each other.public TriangleRep(ConvexHullTreeNode root1, ConvexHullTreeNode root2, double minOverlMatch)
root1
 The root of the convex hull tree representing the
first snapshot.root2
 The root of the convex hull tree representing the
second snapshot.minOverlMatch
 How much overlap between concavities is
necessary for them to be matched to each other.Method Detail 
public void insertHalfConcavity(LineWA[] lines, int p1, int p2, int copoint, int t)
lines
 The concavity represented as a list of linesp1
 The first point in the line which is to be replaced
by the concavity.p2
 The second point in the line which is to be replaced
by the concavity.copoint
 The point in the other snapshot which is the
"third corner of the triangle" with respect to
p1
and p2
.t
 Indicates which snapshot the concavity belongs to.public int insertPoint(int x, int y, int t)
x
 The xcoordinate of the pointy
 The ycoordinate of the pointt
 Which snapshot the point belongs to.public void insertLine(int p1, int p2)
p1
 The starting point of the linep2
 The ending point of the linepublic boolean removeLine(int p1, int p2)
p1
 The index of the starting point of the line.p2
 The index of the ending point of the line.public boolean removePoint(int p1)
p1
 The index of the point to be removedpublic int[] getPosition(int p1)
p1
 The point.public int[] getNeighbours(int p1)
p1
 The index of the point.public boolean neighbours(int p1, int p2)
p1
 The first point.p2
 The second point.public int getNumberOfNeighbours(int p1)
p1
 the point.public int[] getNeighbours(java.lang.Object p)
p1
 The point given as a PointWNL object.public int getNumberOfPoints()
public java.lang.Object[] getPoints()
PointWNL
objects, they cannot be
interpreted by the functions in other classes.public java.lang.Object getPoint(int index)
public boolean pointExists(int index)
index
 The index.public int[] getSnapshot(int time)
time
 Indicates which snapshot should be returned.public int[] getOrderedSnapshot(int time)
time
 Indicates which snapshot should be returned.public int findPoint(int x1, int y1, int t1)
x
 The xcoordinate of the pointy
 The ycoordinate of the pointt
 Which snapshot the point belongs to.public void translateSnapshot(int dx, int dy, int time)
dx
 How far the snapshot should be moved in the x direction.dy
 How far the snapshot should be moved in the y direction.t
 Which snapshot should be moved.public int[] getCorrespondingPoint(int x1, int y1, int x2, int y2, int t1)
x1
 The xcoordinate of the first point.y1
 The ycoordinate of the first point.x2
 The xcoordinate of the second point.y2
 The ycoordinate of the second point.t
 Which snapshot the points belong to.public int getCorrespondingPoint(int index1, int index2)
index1
 The index pf the first point.index2
 The index of the second point.public boolean insertConcavity(TriangleRep concavity, ConvexHullTreeNode root1, ConvexHullTreeNode root2)
concavity
 The concavity to be inserted.root1
 The root of the first convex hull tree.root2
 The root of the second convex hull tree.public void writeTriangles(int time, java.io.OutputStreamWriter fs, java.util.Vector convertlist) throws java.io.IOException
time
 The snapshot.fs
 The file to write to.convertlist
 List which converts indexes in the point list of
the graph structure to indexes in the point list
of the VRML file.java.io.IOException
 If the function cannot write to the file.public void saveAsVRML(java.lang.String filename) throws java.io.FileNotFoundException, java.io.IOException
filename
 The file name of the VRML file.


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