|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sun.j3d.utils.geometry.Triangulator
public class Triangulator
Triangulator is a utility for turning arbitrary polygons into triangles so they can be rendered by Java 3D. Polygons can be concave, nonplanar, and can contain holes.
GeometryInfo
Field Summary | |
---|---|
(package private) boolean |
ccwLoop
|
(package private) int[] |
chains
|
(package private) java.lang.Object[] |
colors
|
private static int |
DEBUG
|
(package private) Distance[] |
distances
|
(package private) static int |
EARS_RANDOM
|
(package private) static int |
EARS_SEQUENCE
|
(package private) static int |
EARS_SORTED
|
(package private) boolean |
earsRandom
|
(package private) boolean |
earsSorted
|
(package private) double |
epsilon
|
(package private) int[] |
faces
|
(package private) int |
firstNode
|
(package private) GeometryInfo |
gInfo
|
(package private) HeapNode[] |
heap
|
(package private) int |
identCntr
|
(package private) static int |
INC_DIST_BK
|
(package private) static int |
INC_LIST_BK
|
(package private) static int |
INC_LOOP_BK
|
(package private) static int |
INC_POINT_BK
|
(package private) static int |
INC_TRI_BK
|
(package private) Left[] |
leftMost
|
(package private) ListNode[] |
list
|
(package private) int |
loopMax
|
(package private) int |
loopMin
|
(package private) int[] |
loops
|
(package private) int |
maxNumChains
|
(package private) int |
maxNumDist
|
(package private) int |
maxNumHeap
|
(package private) int |
maxNumLeftMost
|
(package private) int |
maxNumList
|
(package private) int |
maxNumLoops
|
(package private) int |
maxNumPoints
|
(package private) int |
maxNumPolyArea
|
(package private) int |
maxNumPUnsorted
|
(package private) int |
maxNumTriangles
|
(package private) boolean |
noHashingEdges
|
(package private) boolean |
noHashingPnts
|
(package private) Vector3f[] |
normals
|
(package private) int |
numChains
|
(package private) int |
numFaces
|
(package private) int |
numHeap
|
(package private) int |
numList
|
(package private) int |
numLoops
|
(package private) int |
numPoints
|
(package private) int |
numReflex
|
(package private) int |
numTexSets
|
(package private) int |
numTriangles
|
(package private) int |
numVtxList
|
(package private) int |
numZero
|
(package private) Point2f[] |
points
|
(package private) double[] |
polyArea
|
(package private) Point2f[] |
pUnsorted
|
(package private) java.util.Random |
randomGen
|
(package private) int |
reflexVertices
|
(package private) int[] |
stripCounts
|
(package private) Triangle[] |
triangles
|
(package private) int[] |
vertexIndices
|
(package private) Point3f[] |
vertices
|
(package private) PntNode[] |
vtxList
|
(package private) static double |
ZERO
|
Constructor Summary | |
---|---|
Triangulator()
Deprecated. This class is created automatically when needed in GeometryInfo and never needs to be used directly. Putting data into a GeometryInfo with primitive POLYGON_ARRAY automatically causes the triangulator to be created and used. |
|
Triangulator(int earOrder)
Deprecated. This class is created automatically when needed in GeometryInfo and never needs to be used directly. Putting data into a GeometryInfo with primitive POLYGON_ARRAY automatically causes the triangulator to be created and used. |
Method Summary | |
---|---|
(package private) void |
deleteHook(int currLoop)
|
(package private) void |
deleteLinks(int ind)
Deletes node ind from list (with destroying its data fields) |
(package private) int |
fetchData(int ind1)
obtains the data store at ind1 |
(package private) int |
fetchNextData(int ind1)
Returns pointer to the successor of ind1. |
(package private) int |
fetchPrevData(int ind1)
returns pointer to the successor of ind1. |
(package private) int |
getAngle(int ind)
|
(package private) int |
getNextChain(boolean[] done)
|
(package private) int |
getNode()
|
(package private) void |
initPnts(int number)
|
(package private) boolean |
inLoopList(int loop)
|
(package private) boolean |
inPointsList(int index)
|
(package private) boolean |
inPolyList(int ind)
|
(package private) void |
insertAfter(int ind1,
int ind2)
Inserts node ind2 after node ind1. |
(package private) int |
makeHook()
Allocates storage for a dummy list node; pointers are set to itself. |
(package private) int |
makeLoopHeader()
|
(package private) int |
makeNode(int index)
Allocates storage for a new list node, and stores the index of the point at this node. |
(package private) void |
preProcessList(int i1)
|
(package private) void |
printListData()
|
(package private) void |
printVtxList()
|
(package private) void |
resetPolyList(int ind)
|
(package private) void |
rotateLinks(int ind1,
int ind2)
|
(package private) void |
setAngle(int ind,
int convex)
|
(package private) void |
setEpsilon(double eps)
|
(package private) void |
splitSplice(int ind1,
int ind2,
int ind3,
int ind4)
|
(package private) void |
storeChain(int ind)
|
(package private) int |
storePoint(double x,
double y)
|
(package private) void |
storeTriangle(int i,
int j,
int k)
|
(package private) void |
swapLinks(int ind1)
swap the list pointers in order to change the orientation. |
void |
triangulate(GeometryInfo gi)
This routine converts the GeometryInfo object from primitive type POLYGON_ARRAY to primitive type TRIANGLE_ARRAY using polygon decomposition techniques. |
(package private) void |
updateIndex(int ind,
int index)
|
(package private) void |
writeTriangleToGeomInfo()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
GeometryInfo gInfo
int[] faces
int[] loops
int[] chains
Point2f[] points
Triangle[] triangles
ListNode[] list
java.util.Random randomGen
int numPoints
int maxNumPoints
int numList
int maxNumList
int numLoops
int maxNumLoops
int numTriangles
int maxNumTriangles
int numFaces
int numTexSets
int firstNode
int numChains
int maxNumChains
Point2f[] pUnsorted
int maxNumPUnsorted
boolean noHashingEdges
boolean noHashingPnts
int loopMin
int loopMax
PntNode[] vtxList
int numVtxList
int numReflex
int reflexVertices
Distance[] distances
int maxNumDist
Left[] leftMost
int maxNumLeftMost
HeapNode[] heap
int numHeap
int maxNumHeap
int numZero
int maxNumPolyArea
double[] polyArea
int[] stripCounts
int[] vertexIndices
Point3f[] vertices
java.lang.Object[] colors
Vector3f[] normals
boolean ccwLoop
boolean earsRandom
boolean earsSorted
int identCntr
double epsilon
static final double ZERO
static final int EARS_SEQUENCE
static final int EARS_RANDOM
static final int EARS_SORTED
static final int INC_LIST_BK
static final int INC_LOOP_BK
static final int INC_TRI_BK
static final int INC_POINT_BK
static final int INC_DIST_BK
private static final int DEBUG
Constructor Detail |
---|
public Triangulator()
public Triangulator(int earOrder)
Method Detail |
---|
public void triangulate(GeometryInfo gi)
Example of usage: Triangulator tr = new Triangulator(); tr.triangulate(ginfo); // ginfo contains the geometry. shape.setGeometry(ginfo.getGeometryArray()); // shape is a Shape3D.
gi
- Geometry to be triangulatedvoid printVtxList()
void printListData()
void preProcessList(int i1)
void writeTriangleToGeomInfo()
void setEpsilon(double eps)
boolean inPolyList(int ind)
void updateIndex(int ind, int index)
int getAngle(int ind)
void setAngle(int ind, int convex)
void resetPolyList(int ind)
int getNode()
boolean inLoopList(int loop)
void deleteHook(int currLoop)
void deleteLinks(int ind)
void rotateLinks(int ind1, int ind2)
void storeChain(int ind)
int getNextChain(boolean[] done)
void splitSplice(int ind1, int ind2, int ind3, int ind4)
int makeHook()
int makeLoopHeader()
int makeNode(int index)
void insertAfter(int ind1, int ind2)
int fetchNextData(int ind1)
int fetchData(int ind1)
int fetchPrevData(int ind1)
void swapLinks(int ind1)
void storeTriangle(int i, int j, int k)
void initPnts(int number)
boolean inPointsList(int index)
int storePoint(double x, double y)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |