Class 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.
    • 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
    • Constructor Detail

      • PolygonTessellator2

        public PolygonTessellator2()
    • 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.