Package gov.nasa.worldwind.util
Class PolygonTessellator2
- java.lang.Object
-
- gov.nasa.worldwind.util.PolygonTessellator2
-
public class PolygonTessellator2 extends java.lang.Object
TODO: Combine these capabilities into PolygonTessellator with support for pattern used by ShapefileExtrudedPolygons. TODO: Keep the combined class in package gov.nasa.worldwind.util.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static class
PolygonTessellator2.TessCallbackAdapter
-
Field Summary
Fields Modifier and Type Field Description protected java.nio.IntBuffer
boundaryIndices
protected double[]
clip
protected double[]
coords
protected java.nio.IntBuffer
interiorIndices
protected boolean
isBoundaryEdge
protected double[]
offset
protected Range
polygonVertexRange
protected int
prevClipCode
protected com.jogamp.opengl.glu.GLUtessellator
tess
protected float[]
vertex
protected int
vertexStride
protected java.nio.FloatBuffer
vertices
-
Constructor Summary
Constructors Constructor Description PolygonTessellator2()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addVertex(double x, double y, double z)
void
beginContour()
void
beginPolygon()
protected int
clipCode(double x, double y, double z)
Computes a 4-bit code indicating the vertex's location in the 9 cell grid defined by the clip bounds and the eight adjacent spaces defined by extending the min/max boundaries to infinity.0 indicates that the vertex is inside the clip bounds.void
endContour()
void
endPolygon()
int
getBoundaryIndexCount()
java.nio.IntBuffer
getBoundaryIndices(java.nio.IntBuffer buffer)
int
getInteriorIndexCount()
java.nio.IntBuffer
getInteriorIndices(java.nio.IntBuffer buffer)
Range
getPolygonVertexRange()
int
getVertexCount()
java.nio.FloatBuffer
getVertices(java.nio.FloatBuffer buffer)
protected void
putBoundaryIndex(int i)
protected void
putInteriorIndex(int i)
protected int
putVertex(double[] coords, int pos)
void
reset()
void
resetIndices()
void
setPolygonClipCoords(double xMin, double xMax, double yMin, double yMax)
void
setPolygonNormal(double x, double y, double z)
void
setVertexOffset(double x, double y, double z)
void
setVertexStride(int stride)
protected void
tessBegin(int type)
protected void
tessCombine(double[] coords, java.lang.Object[] vertexData, float[] weight, java.lang.Object[] outData)
protected void
tessEdgeFlag(boolean boundaryEdge)
protected void
tessEnd()
protected void
tessVertex(java.lang.Object vertexData)
-
-
-
Field Detail
-
tess
protected com.jogamp.opengl.glu.GLUtessellator tess
-
vertices
protected java.nio.FloatBuffer vertices
-
interiorIndices
protected java.nio.IntBuffer interiorIndices
-
boundaryIndices
protected java.nio.IntBuffer boundaryIndices
-
polygonVertexRange
protected Range polygonVertexRange
-
vertexStride
protected int vertexStride
-
isBoundaryEdge
protected boolean isBoundaryEdge
-
coords
protected double[] coords
-
offset
protected double[] offset
-
clip
protected double[] clip
-
vertex
protected float[] vertex
-
prevClipCode
protected int prevClipCode
-
-
Method Detail
-
getVertexCount
public int getVertexCount()
-
getVertices
public java.nio.FloatBuffer getVertices(java.nio.FloatBuffer buffer)
-
getInteriorIndexCount
public int getInteriorIndexCount()
-
getInteriorIndices
public java.nio.IntBuffer getInteriorIndices(java.nio.IntBuffer buffer)
-
getBoundaryIndexCount
public int getBoundaryIndexCount()
-
getBoundaryIndices
public java.nio.IntBuffer getBoundaryIndices(java.nio.IntBuffer buffer)
-
getPolygonVertexRange
public Range getPolygonVertexRange()
-
reset
public void reset()
-
resetIndices
public void resetIndices()
-
setPolygonNormal
public void setPolygonNormal(double x, double y, double z)
-
setPolygonClipCoords
public void setPolygonClipCoords(double xMin, double xMax, double yMin, double yMax)
-
setVertexStride
public void setVertexStride(int stride)
-
setVertexOffset
public void setVertexOffset(double x, double y, double z)
-
beginPolygon
public void beginPolygon()
-
beginContour
public void beginContour()
-
addVertex
public void addVertex(double x, double y, double z)
-
endContour
public void endContour()
-
endPolygon
public void endPolygon()
-
tessBegin
protected void tessBegin(int type)
-
tessEdgeFlag
protected void tessEdgeFlag(boolean boundaryEdge)
-
tessVertex
protected void tessVertex(java.lang.Object vertexData)
-
tessEnd
protected void tessEnd()
-
tessCombine
protected void tessCombine(double[] coords, java.lang.Object[] vertexData, float[] weight, java.lang.Object[] outData)
-
putVertex
protected int putVertex(double[] coords, int pos)
-
putInteriorIndex
protected void putInteriorIndex(int i)
-
putBoundaryIndex
protected void putBoundaryIndex(int i)
-
clipCode
protected int clipCode(double x, double y, double z)
Computes a 4-bit code indicating the vertex's location in the 9 cell grid defined by the clip bounds and the eight adjacent spaces defined by extending the min/max boundaries to infinity.0 indicates that the vertex is inside the clip bounds.- Parameters:
x
- The x coordinate for computation.y
- The x coordinate for computation.z
- The x coordinate for computation.- Returns:
- The vertex code.
-
-