Package gov.nasa.worldwind.util
Class PolygonTessellator2
- java.lang.Object
-
- gov.nasa.worldwind.util.PolygonTessellator2
-
public class PolygonTessellator2 extends java.lang.ObjectTODO: 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 classPolygonTessellator2.TessCallbackAdapter
-
Field Summary
Fields Modifier and Type Field Description protected java.nio.IntBufferboundaryIndicesprotected double[]clipprotected double[]coordsprotected java.nio.IntBufferinteriorIndicesprotected booleanisBoundaryEdgeprotected double[]offsetprotected RangepolygonVertexRangeprotected intprevClipCodeprotected com.jogamp.opengl.glu.GLUtessellatortessprotected float[]vertexprotected intvertexStrideprotected java.nio.FloatBuffervertices
-
Constructor Summary
Constructors Constructor Description PolygonTessellator2()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddVertex(double x, double y, double z)voidbeginContour()voidbeginPolygon()protected intclipCode(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.voidendContour()voidendPolygon()intgetBoundaryIndexCount()java.nio.IntBuffergetBoundaryIndices(java.nio.IntBuffer buffer)intgetInteriorIndexCount()java.nio.IntBuffergetInteriorIndices(java.nio.IntBuffer buffer)RangegetPolygonVertexRange()intgetVertexCount()java.nio.FloatBuffergetVertices(java.nio.FloatBuffer buffer)protected voidputBoundaryIndex(int i)protected voidputInteriorIndex(int i)protected intputVertex(double[] coords, int pos)voidreset()voidresetIndices()voidsetPolygonClipCoords(double xMin, double xMax, double yMin, double yMax)voidsetPolygonNormal(double x, double y, double z)voidsetVertexOffset(double x, double y, double z)voidsetVertexStride(int stride)protected voidtessBegin(int type)protected voidtessCombine(double[] coords, java.lang.Object[] vertexData, float[] weight, java.lang.Object[] outData)protected voidtessEdgeFlag(boolean boundaryEdge)protected voidtessEnd()protected voidtessVertex(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.
-
-