com.sun.j3d.utils.geometry
Class EarClip
java.lang.Object
com.sun.j3d.utils.geometry.EarClip
class EarClip
- extends java.lang.Object
Method Summary |
(package private) static void |
classifyAngles(Triangulator triRef,
int ind)
Classifies all the internal angles of the loop referenced by ind. |
(package private) static void |
classifyEars(Triangulator triRef,
int ind)
|
(package private) static boolean |
clipEar(Triangulator triRef,
boolean[] done)
This is the main function that drives the ear-clipping. |
(package private) static boolean |
isEar(Triangulator triRef,
int ind2,
int[] ind1,
int[] ind3,
double[] ratio)
This function checks whether a diagonal is valid, that is, whether it is
locally within the polygon, and whether it does not intersect any other
segment of the polygon. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
EarClip
EarClip()
classifyAngles
static void classifyAngles(Triangulator triRef,
int ind)
- Classifies all the internal angles of the loop referenced by ind.
the following classification is used:
0 ... if angle is 180 degrees
1 ... if angle between 0 and 180 degrees
2 ... if angle is 0 degrees
-1 ... if angle between 180 and 360 degrees
-2 ... if angle is 360 degrees
classifyEars
static void classifyEars(Triangulator triRef,
int ind)
isEar
static boolean isEar(Triangulator triRef,
int ind2,
int[] ind1,
int[] ind3,
double[] ratio)
- This function checks whether a diagonal is valid, that is, whether it is
locally within the polygon, and whether it does not intersect any other
segment of the polygon. also, some degenerate cases get a special
handling.
clipEar
static boolean clipEar(Triangulator triRef,
boolean[] done)
- This is the main function that drives the ear-clipping. it obtains an ear
from set of ears maintained in a priority queue, clips this ear, and
updates all data structures appropriately. (ears are arranged in the
priority queue (i.e., heap) according to a quality criterion that tries
to avoid skinny triangles.)
Copyright 1996-2008 Sun Microsystems, Inc. All Rights Reserved. Use is subject to license terms.