Class GeometryHolder
java.lang.Object
org.web3d.vrml.renderer.common.nodes.GeometryHolder
Data representation of geometry information that is created through the
various generator classes in this package.
This class is similar to the j3d.org GeometryHolder class. It includes data like fogCoordinates and vertex attribs and the ability to store multiple data sets. 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.2 $
- Author:
- Justin Couch, Alan Hudson
-
Field Summary
FieldsModifier and TypeFieldDescriptionint[]
Storage for color index information if the shape type requires it.float[]
Colour values if using per-vertex coloring.float[]
Storage for coordinate information.int
The attributes of the geometry you want created.int
A generator specific field that describes the type of output algorithm you would like to use for the geometry.int
This is the type of geometry that you want to have madestatic final int
Generate the geometry as an indexed line strip arraystatic final int
Generate the geometry as an indexed line arraystatic final int
Generate the geometry as indexed quadsstatic final int
Generate the geometry as an indexed triangle fan arraystatic final int
Generate the geometry as an indexed triangle strip arraystatic final int
Generate the geometry as an indexed triangle arrayint[]
Storage for coordinate index information if the shape type requires it.int
The number of items stored in the indexes arraystatic final int
Generate the geometry as an line strip arraystatic final int
Generate the geometry as a line arraystatic final int
Request for lighting normal data to be producedint[]
Storage for normal index information if the shape type requires it.float[]
Storage for lighting normal information.int
The number of items stored in the strip countsint
The number of texture sets in the textureCoordinates fieldint
The number of unique texture setsstatic final int
Generate the geometry as individual unindexed quadsint[]
Storage for strip counts if the shape type uses itint[]
Storage for texture coordinate index information if the shape type requires it.static final int
Request for 2D Texture coordinate data to be producedstatic final int
Request for 3D Texture coordinate data to be producedfloat[][]
Texture coordinate information if requested.static final int
Generate the geometry as a triangle fan array(s)static final int
Generate the geometry as a triangle strip array(s)static final int
Generate the geometry as individual unindexed trianglesint
The number of vertices stored in the coordinates array -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Convenience method to print out all the data associated with this geometry array.
-
Field Details
-
TRIANGLES
public static final int TRIANGLESGenerate the geometry as individual unindexed triangles- See Also:
-
QUADS
public static final int QUADSGenerate the geometry as individual unindexed quads- See Also:
-
TRIANGLE_STRIPS
public static final int TRIANGLE_STRIPSGenerate the geometry as a triangle strip array(s)- See Also:
-
TRIANGLE_FANS
public static final int TRIANGLE_FANSGenerate the geometry as a triangle fan array(s)- See Also:
-
INDEXED_QUADS
public static final int INDEXED_QUADSGenerate the geometry as indexed quads- See Also:
-
INDEXED_TRIANGLES
public static final int INDEXED_TRIANGLESGenerate the geometry as an indexed triangle array- See Also:
-
INDEXED_TRIANGLE_STRIPS
public static final int INDEXED_TRIANGLE_STRIPSGenerate the geometry as an indexed triangle strip array- See Also:
-
INDEXED_TRIANGLE_FANS
public static final int INDEXED_TRIANGLE_FANSGenerate the geometry as an indexed triangle fan array- See Also:
-
LINES
public static final int LINESGenerate the geometry as a line array- See Also:
-
LINE_STRIPS
public static final int LINE_STRIPSGenerate the geometry as an line strip array- See Also:
-
INDEXED_LINES
public static final int INDEXED_LINESGenerate the geometry as an indexed line array- See Also:
-
INDEXED_LINE_STRIPS
public static final int INDEXED_LINE_STRIPSGenerate the geometry as an indexed line strip array- See Also:
-
NORMAL_DATA
public static final int NORMAL_DATARequest for lighting normal data to be produced- See Also:
-
TEXTURE_2D_DATA
public static final int TEXTURE_2D_DATARequest for 2D Texture coordinate data to be produced- See Also:
-
TEXTURE_3D_DATA
public static final int TEXTURE_3D_DATARequest for 3D Texture coordinate data to be produced- See Also:
-
geometryType
public int geometryTypeThis is the type of geometry that you want to have made -
geometrySubType
public int geometrySubTypeA generator specific field that describes the type of output algorithm you would like to use for the geometry. May be ignored. -
geometryComponents
public int geometryComponentsThe 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 vertexCountThe number of vertices stored in the coordinates array -
coordinates
public float[] coordinatesStorage for coordinate information. These are stored in flat [x1, y1, z1, x2, y2, z2, ...] configuration -
normals
public float[] normalsStorage 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 indexesCountThe number of items stored in the indexes array -
indexes
public int[] indexesStorage for coordinate index information if the shape type requires it. -
numStrips
public int numStripsThe number of items stored in the strip counts -
stripCounts
public int[] stripCountsStorage for strip counts if the shape type uses it -
textureCoordinates
public float[][] textureCoordinatesTexture 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,...] -
numTexSets
public int numTexSetsThe number of texture sets in the textureCoordinates field -
numUniqueTexSets
public int numUniqueTexSetsThe number of unique texture sets -
colors
public float[] colorsColour 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[] normalIndexesStorage 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[] texCoordIndexesStorage 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[] colorIndexesStorage 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 Details
-
GeometryHolder
public GeometryHolder()
-
-
Method Details
-
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.
-