Class GeometryData

  • All Implemented Interfaces:
    java.lang.Cloneable

    public class GeometryData
    extends java.lang.Object
    implements java.lang.Cloneable
    Data representation of geometry information that is created through the various generator classes in this package.

    This data representation is used to hold information needed to generate geometry from one of the generator classes in this package. In general, data does not get filled in for items that are not requested.

    The type of data to be produced can be changed with each call. While it is possible to ask for both 2D and 3D texture coordinates, the code will only generate 2D values if asked.

    Version:
    $Revision: 1.10 $
    Author:
    Justin Couch
    • Field Summary

      Fields 
      Modifier and Type Field Description
      int[] colorIndexes
      Storage for color index information if the shape type requires it.
      float[] colors
      Colour values if using per-vertex coloring.
      float[] coordinates
      Storage for coordinate information.
      int geometryComponents
      The attributes of the geometry you want created.
      int geometrySubType
      A generator specific field that describes the type of output algorithm you would like to use for the geometry.
      int geometryType
      This is the type of geometry that you want to have made
      static int INDEXED_LINE_STRIPS
      Generate the geometry as an indexed line strip array
      static int INDEXED_LINES
      Generate the geometry as an indexed line array
      static int INDEXED_QUADS
      Generate the geometry as indexed quads
      static int INDEXED_TRIANGLE_FANS
      Generate the geometry as an indexed triangle fan array
      static int INDEXED_TRIANGLE_STRIPS
      Generate the geometry as an indexed triangle strip array
      static int INDEXED_TRIANGLES
      Generate the geometry as an indexed triangle array
      int[] indexes
      Storage for coordinate index information if the shape type requires it.
      int indexesCount
      The number of items stored in the indexes array
      static int LINE_STRIPS
      Generate the geometry as an line strip array
      static int LINES
      Generate the geometry as a line array
      static int NORMAL_DATA
      Request for lighting normal data to be produced
      int[] normalIndexes
      Storage for normal index information if the shape type requires it.
      float[] normals
      Storage for lighting normal information.
      int numStrips
      The number of items stored in the strip counts
      static int QUADS
      Generate the geometry as individual unindexed quads
      int[] stripCounts
      Storage for strip counts if the shape type uses it
      int[] texCoordIndexes
      Storage for texture coordinate index information if the shape type requires it.
      static int TEXTURE_2D_DATA
      Request for 2D Texture coordinate data to be produced
      static int TEXTURE_3D_DATA
      Request for 3D Texture coordinate data to be produced
      float[] textureCoordinates
      Texture coordinate information if requested.
      static int TRIANGLE_FANS
      Generate the geometry as a triangle fan array(s)
      static int TRIANGLE_STRIPS
      Generate the geometry as a triangle strip array(s)
      static int TRIANGLES
      Generate the geometry as individual unindexed triangles
      int vertexCount
      The number of vertices stored in the coordinates array
    • Constructor Summary

      Constructors 
      Constructor Description
      GeometryData()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.Object clone()
      Make a copy of this object with identical data.
      void prettyPrint()
      Convenience method to print out all the data associated with this geometry array.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • geometryType

        public int geometryType
        This is the type of geometry that you want to have made
      • geometrySubType

        public int geometrySubType
        A generator specific field that describes the type of output algorithm you would like to use for the geometry. May be ignored.
      • geometryComponents

        public int geometryComponents
        The attributes of the geometry you want created. This is an OR'd list of the above variables. It is not possible to generate anything without the raw geometry being computed.
      • vertexCount

        public int vertexCount
        The number of vertices stored in the coordinates array
      • coordinates

        public float[] coordinates
        Storage for coordinate information. These are stored in flat [x1, y1, z1, x2, y2, z2, ...] configuration
      • normals

        public float[] normals
        Storage for lighting normal information. This should be at least the length of the coordinates array. Data is stored in the same fashion. If normals are requested, the count is the same as vertexCount.
      • indexesCount

        public int indexesCount
        The number of items stored in the indexes array
      • indexes

        public int[] indexes
        Storage for coordinate index information if the shape type requires it.
      • numStrips

        public int numStrips
        The number of items stored in the strip counts
      • stripCounts

        public int[] stripCounts
        Storage for strip counts if the shape type uses it
      • textureCoordinates

        public float[] textureCoordinates
        Texture coordinate information if requested. May be 2D or 3D depending on the requested type. If 2D the values are stored [s1, t1, s2, t2...] For 3D coordinates it is stores as [r1, s1, t1, r2, s2, t2,...]
      • colors

        public float[] colors
        Colour values if using per-vertex coloring. This array will be identical in length to the coordinate array and index values match etc.
      • normalIndexes

        public int[] normalIndexes
        Storage for normal index information if the shape type requires it. Not used by the geometry generation classes, but may be by 3rd party software.
      • texCoordIndexes

        public int[] texCoordIndexes
        Storage for texture coordinate index information if the shape type requires it. Not used by the geometry generation classes, but may be by 3rd party software.
      • colorIndexes

        public int[] colorIndexes
        Storage for color index information if the shape type requires it. Not used by the geometry generation classes, but may be by 3rd party software.
    • Method Detail

      • prettyPrint

        public void prettyPrint()
        Convenience method to print out all the data associated with this geometry array. Prints one vertex per line. Ignores index information.
      • clone

        public java.lang.Object clone()
        Make a copy of this object with identical data. Does a deep copy of all data associated.
        Returns:
        The copy of the data