j3d.org Code

org.j3d.geom
Class GeometryData

java.lang.Object
  extended by org.j3d.geom.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
 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
GeometryData()
           
 
Method Summary
 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, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TRIANGLES

public static final int TRIANGLES
Generate the geometry as individual unindexed triangles

See Also:
Constant Field Values

QUADS

public static final int QUADS
Generate the geometry as individual unindexed quads

See Also:
Constant Field Values

TRIANGLE_STRIPS

public static final int TRIANGLE_STRIPS
Generate the geometry as a triangle strip array(s)

See Also:
Constant Field Values

TRIANGLE_FANS

public static final int TRIANGLE_FANS
Generate the geometry as a triangle fan array(s)

See Also:
Constant Field Values

INDEXED_QUADS

public static final int INDEXED_QUADS
Generate the geometry as indexed quads

See Also:
Constant Field Values

INDEXED_TRIANGLES

public static final int INDEXED_TRIANGLES
Generate the geometry as an indexed triangle array

See Also:
Constant Field Values

INDEXED_TRIANGLE_STRIPS

public static final int INDEXED_TRIANGLE_STRIPS
Generate the geometry as an indexed triangle strip array

See Also:
Constant Field Values

INDEXED_TRIANGLE_FANS

public static final int INDEXED_TRIANGLE_FANS
Generate the geometry as an indexed triangle fan array

See Also:
Constant Field Values

LINES

public static final int LINES
Generate the geometry as a line array

See Also:
Constant Field Values

LINE_STRIPS

public static final int LINE_STRIPS
Generate the geometry as an line strip array

See Also:
Constant Field Values

INDEXED_LINES

public static final int INDEXED_LINES
Generate the geometry as an indexed line array

See Also:
Constant Field Values

INDEXED_LINE_STRIPS

public static final int INDEXED_LINE_STRIPS
Generate the geometry as an indexed line strip array

See Also:
Constant Field Values

NORMAL_DATA

public static final int NORMAL_DATA
Request for lighting normal data to be produced

See Also:
Constant Field Values

TEXTURE_2D_DATA

public static final int TEXTURE_2D_DATA
Request for 2D Texture coordinate data to be produced

See Also:
Constant Field Values

TEXTURE_3D_DATA

public static final int TEXTURE_3D_DATA
Request for 3D Texture coordinate data to be produced

See Also:
Constant Field Values

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.

Constructor Detail

GeometryData

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

Overrides:
clone in class java.lang.Object
Returns:
The copy of the data

j3d.org Code

Latest Info from http://code.j3d.org/
Copyright © 2001 - j3d.org