|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.ObjectFacemorph.template.Contour
public class Contour
Class to store information about a Template's contour
| Constructor Summary | |
|---|---|
Contour()
Construct an empty Contour |
|
Contour(int i)
Construct a contour with initial contour index given |
|
| Method Summary | |
|---|---|
void |
addPoint(int i,
java.util.Vector landmarks)
Adds a point to this contour |
void |
addPointInLine(int i,
java.util.Vector landmarks)
Adds a point to this contour |
void |
calculateContour(java.util.Vector landmarks)
Calculate the position of each point along the curve given the control point positions |
void |
calculateSamples(java.util.Vector landmarks)
Calculate the number of samples along a contour using the piecewise linear distance along the curve |
void |
close()
Makes this a closed contour (closed = true) |
int |
controlPointCount()
Get the number of control points in this contour |
boolean |
convert(java.util.StringTokenizer st)
Read a contour from a StreamTokenizer |
void |
copy(Contour c)
Copies the point indices and sample point positions from c |
void |
deletePoint(int PointNum,
java.util.Vector landmarks)
Deletes the given point index from this contour |
void |
draw(java.awt.Graphics g,
int x_off,
int y_off,
java.awt.Color c)
Draw the contour to the Graphics given, shifting by x_off and y_off and using colour c |
void |
drawZoomed(java.awt.Graphics g,
int x_off,
int y_off,
float xs,
float ys,
java.awt.Color c)
Draw the contour to the Graphics given, shifting by x_off and y_off, scaling by xs, ys and using colour c |
java.util.ArrayList<java.awt.geom.Rectangle2D> |
getBounds(java.util.Vector landmarks)
|
java.awt.geom.Point2D.Float |
getControlPointNormal(int i,
java.util.Vector landmarks)
Gets the direction at right angles to this contour at the control points |
java.util.Vector<java.lang.Integer> |
getControlPoints()
Get the control point vector |
int |
getLength()
Get the length of this contour |
java.util.Vector<java.awt.geom.Point2D.Float> |
getPoints()
Get the control points |
double[] |
getSamples()
|
double |
getTol()
|
boolean |
hitLine(java.awt.geom.Point2D.Float p,
java.util.Vector landmarks)
|
boolean |
isClosed()
Is this a closed contour |
void |
open()
Makes this an open contour (closed = false) |
boolean |
read(java.io.StreamTokenizer st)
Read a contour from a StreamTokenizer |
void |
setLength()
Sets the length to be the maximum t value |
void |
setLength(int len)
Set the total number of samples along the contour |
void |
setSamples(double[] s)
|
void |
setTol(float tol)
|
java.lang.String |
toString()
Convert this contour to a String representation |
java.lang.String |
toURLString()
Convert this contour to a String representation suitable for putting in a URL |
void |
transform(float[][] mat)
Transform this contour's samples using the affine matrix given |
void |
update(java.util.Vector landmarks)
Recalculates the interpolated contour samples from the new landmark positions |
boolean |
write(java.io.PrintStream out)
Write the contour to the PrintStream given |
void |
zoom(float zoomx,
float zoomy,
float crop_x,
float crop_y)
Zooms and shifts the contour |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Contour()
public Contour(int i)
i - The index of the first point on this contour| Method Detail |
|---|
public void setTol(float tol)
public double getTol()
public java.util.ArrayList<java.awt.geom.Rectangle2D> getBounds(java.util.Vector landmarks)
public boolean hitLine(java.awt.geom.Point2D.Float p,
java.util.Vector landmarks)
public void addPoint(int i,
java.util.Vector landmarks)
i - The index of the point to addlandmarks - The array of landmarks hat i indexes into in Template
public void addPointInLine(int i,
java.util.Vector landmarks)
i - The index of the point to addlandmarks - The array of landmarks hat i indexes into in Templatepublic void close()
public void open()
public boolean isClosed()
public void deletePoint(int PointNum,
java.util.Vector landmarks)
PointNum - The index of the point to resetLocation from this contourlandmarks - The array of template landmarkspublic int controlPointCount()
public void update(java.util.Vector landmarks)
landmarks - The array of Template landmarkspublic java.util.Vector<java.awt.geom.Point2D.Float> getPoints()
public void calculateSamples(java.util.Vector landmarks)
landmarks - The array of Template landmark pointspublic void setSamples(double[] s)
public double[] getSamples()
public void setLength(int len)
len - the lengthpublic int getLength()
public void setLength()
public void calculateContour(java.util.Vector landmarks)
landmarks - the control point positionspublic void copy(Contour c)
c - the contour to copy
public void draw(java.awt.Graphics g,
int x_off,
int y_off,
java.awt.Color c)
g - the Graphics to draw tox_off - the x offsety_off - the y offsetc - the colour to use
public void drawZoomed(java.awt.Graphics g,
int x_off,
int y_off,
float xs,
float ys,
java.awt.Color c)
g - the Graphics to draw tox_off - the x offsety_off - the y offsetxs - the x scale factorys - the y scale factorc - the colour to usepublic boolean read(java.io.StreamTokenizer st)
st - The StreamTokenizer used to parse the file
public boolean write(java.io.PrintStream out)
out - The Printstream to write to
public java.lang.String toString()
toString in class java.lang.Objectpublic java.lang.String toURLString()
public boolean convert(java.util.StringTokenizer st)
st - The StreamTokenizer used to parse the file
public void transform(float[][] mat)
mat - The affine transformation matrix to use
public void zoom(float zoomx,
float zoomy,
float crop_x,
float crop_y)
zoomx - zoom x factorzoomy - zoom y factorcrop_x - subtract from each samples x coordcrop_y - subtract from each samples y coord
public java.awt.geom.Point2D.Float getControlPointNormal(int i,
java.util.Vector landmarks)
i - the control point indexlandmarks - the Template's control points
public java.util.Vector<java.lang.Integer> getControlPoints()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||