|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--edu.mit.sketch.toolkit.Blackboard
Polygons recognized by the tablet are sent here. This class decides between candidate polygons and returns it.
| Field Summary | |
static int |
best_index
Best index (index of the best fit). |
static double |
distance_difference
Pixel distance tolerance index_difference and distance_difference are used during computation of intersection etc. |
static GeneralPath |
general_path
A general path object obtained from the hybrid fits. |
static Fit[] |
hybrid_fits
The array of hybrid fits obtained from speed and direction fits. |
static int |
index_difference
Index difference tolerance. |
static Range[] |
ranges
The ranges for the segments in the general_path |
| Constructor Summary | |
Blackboard()
|
|
| Method Summary | |
static GeneralPath |
adjustGeneralPath(GeneralPath general_path,
StrokeData data)
Improve the fit by reducing the least square error. |
static void |
checkCertaintyBounds(Vertex[] vertices)
See if all the certainty values are between 0 and 1. |
static GeneralPath |
computeGeneralPath(Vertex[] intersection,
Vertex[] superset,
Fit[] fits,
StrokeData data)
Compute a GeneralPath given the information in the arguments. |
static boolean |
containsWithTolerance(Vertex[] vertices,
Vertex vertex,
int index_difference_tolerance,
double distance_tolerance)
Return true if the array contains a Vertex that is sufficiently close to the argument vertex given the tolerances. |
static Vertex[] |
decide(Vertex[] speed_fit,
Vertex[] direction_fit,
Point[] points,
StrokeData data)
a and b are two possible polygon matches for points. |
static Vertex[] |
getContiguosExcludedPointSequence(int start_pointer,
Vertex[] subset,
Vertex[] superset)
Return the sequence of contiguos point sequence that is included in superset, but is excluded in subset. |
static Point[] |
getControlPoints(Vertex v1,
Vertex v2,
StrokeData data)
Return the control points to be used for drawing a curve from v1 to v2. |
static Point[] |
getControlPoints(Vertex v1,
Vertex v2,
StrokeData data,
int left_offset,
int right_offset)
Return the control points to be used for drawing a curve from v1 to v2. |
static Vertex[] |
getCurvatureFit(Point[] points,
Vertex[] vertices,
double scale)
Returns a curvature fit. |
static Vertex[] |
getCurvatureFitOld(Point[] points,
Vertex[] vertices,
double scale)
Returns a curvature fit. |
static Fit[] |
getHybridFits(Vertex[] speed_fit,
Vertex[] direction_fit,
Point[] points)
Computes the hybrid fits from speed_fit and direction_fit |
static int |
getIndexInVertices(Vertex[] vertices,
Vertex vertex,
int index_difference_tolerance,
double distance_tolerance)
Return the index in subset if the array contains a Vertex that is sufficiently close to the argument vertex given the tolerances. |
static Vertex[] |
getIntersection(Vertex[] a,
Vertex[] b,
int bias)
Get the common points in a and b. |
static int[] |
getPolygonIndices(Point[] output_polygon,
Point[] points)
get the indices of output_polygon in the array points. |
static Vertex[] |
getSymmetricDifference(Vertex[] a,
Vertex[] b,
Vertex[] intersection,
int bias)
Get the symmetric difference of a and b. |
static Vertex[] |
getUnion(Vertex[] a,
Vertex[] b)
Get all the points in a and b. |
static Vertex[] |
insertVertex(Vertex[] vertices,
Vertex vertex)
Return the vertices obtained by inserting the input vertex to the appropriate slot in the input vertices. |
static double |
leastSquaresForPolygon(Vertex[] vertices,
Point[] points)
calculate the lsq error. |
static Vertex[] |
overlay(Vertex[] subset,
Vertex[] superset,
int index_tolerance,
double distance_tolerance)
Overlay subset and superset so the vertices very close to one another are collapsed into one. |
static void |
paintGeneralPath(GeneralPath general_path)
Paint the general path |
static void |
paintGeneralPathConvexHulls(GeneralPath general_path)
Show convex hulls for the curves |
static void |
paintGeneralPathInSegments(GeneralPath general_path)
Paint the general path in segments |
static void |
printPoints(Point[] points,
String name)
Print the points array. |
static void |
printPointsWithIndices(Point[] points,
String name,
Point[] real_points)
Print the points assuming with their corresponding indices in real_points. |
static Vertex[] |
removeCloseVertices(Vertex[] vertices,
int index_tolerance,
double distance_tolerance)
Remove vertices closer than index_tolerance in indices or, distance_tolerance spatially. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static Fit[] hybrid_fits
public static GeneralPath general_path
public static Range[] ranges
public static int index_difference
public static double distance_difference
public static int best_index
| Constructor Detail |
public Blackboard()
| Method Detail |
public static Vertex[] decide(Vertex[] speed_fit,
Vertex[] direction_fit,
Point[] points,
StrokeData data)
public static Vertex[] getCurvatureFitOld(Point[] points,
Vertex[] vertices,
double scale)
public static Vertex[] getCurvatureFit(Point[] points,
Vertex[] vertices,
double scale)
public static Fit[] getHybridFits(Vertex[] speed_fit,
Vertex[] direction_fit,
Point[] points)
public static GeneralPath adjustGeneralPath(GeneralPath general_path,
StrokeData data)
public static GeneralPath computeGeneralPath(Vertex[] intersection,
Vertex[] superset,
Fit[] fits,
StrokeData data)
public static Vertex[] getContiguosExcludedPointSequence(int start_pointer,
Vertex[] subset,
Vertex[] superset)
public static double leastSquaresForPolygon(Vertex[] vertices,
Point[] points)
public static int[] getPolygonIndices(Point[] output_polygon,
Point[] points)
public static void printPoints(Point[] points,
String name)
public static boolean containsWithTolerance(Vertex[] vertices,
Vertex vertex,
int index_difference_tolerance,
double distance_tolerance)
public static Vertex[] getSymmetricDifference(Vertex[] a,
Vertex[] b,
Vertex[] intersection,
int bias)
public static Vertex[] overlay(Vertex[] subset,
Vertex[] superset,
int index_tolerance,
double distance_tolerance)
public static int getIndexInVertices(Vertex[] vertices,
Vertex vertex,
int index_difference_tolerance,
double distance_tolerance)
public static Vertex[] removeCloseVertices(Vertex[] vertices,
int index_tolerance,
double distance_tolerance)
public static Vertex[] getIntersection(Vertex[] a,
Vertex[] b,
int bias)
public static Vertex[] getUnion(Vertex[] a,
Vertex[] b)
public static void printPointsWithIndices(Point[] points,
String name,
Point[] real_points)
public static void checkCertaintyBounds(Vertex[] vertices)
public static void paintGeneralPath(GeneralPath general_path)
public static void paintGeneralPathInSegments(GeneralPath general_path)
public static void paintGeneralPathConvexHulls(GeneralPath general_path)
public static Vertex[] insertVertex(Vertex[] vertices,
Vertex vertex)
public static Point[] getControlPoints(Vertex v1,
Vertex v2,
StrokeData data)
public static Point[] getControlPoints(Vertex v1,
Vertex v2,
StrokeData data,
int left_offset,
int right_offset)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||