Aviatrix3D 1.0

org.j3d.aviatrix3d
Class QuadArray

java.lang.Object
  extended byorg.j3d.aviatrix3d.SceneGraphObject
      extended byorg.j3d.aviatrix3d.NodeComponent
          extended byorg.j3d.aviatrix3d.Geometry
              extended byorg.j3d.aviatrix3d.VertexGeometry
                  extended byorg.j3d.aviatrix3d.QuadArray
All Implemented Interfaces:
PickableObject, Renderable, RenderableObject

public class QuadArray
extends VertexGeometry

An OpenGL QuadArray representation.

Quad Arrays may have an additional edge flag array supplied, in addition to the normal geometry values.

Setting geometry

Part of the optimisation we make is to only copy into the underlying structures the exact number of coordinates, normals etc that are needed. To know this number, we need to know how many coordinates exist before attempting to set anything else. When constructing, or updating, geometry, you should always make sure that you first set the vertex list, then the sizing information for the strip or fan counts, and then set normals as needed.

Version:
$Revision: 1.17.2.1 $
Author:
Justin Couch

Field Summary
 
Fields inherited from class org.j3d.aviatrix3d.VertexGeometry
ATTRIB_CLEAR, ATTRIB_MASK, attribIds, ATTRIBS, attributes, COLOR_3, COLOR_4, COLOR_CLEAR, COLOR_MASK, COLOR_SINGLE, COLOR2, COLOR2_CLEAR, COLOR2_MASK, color2Buffer, color2s, colorBuffer, colors, COORDINATE_2, COORDINATE_3, COORDINATE_4, COORDINATE_CLEAR, COORDINATE_MASK, coordinates, EDGE_CLEAR, EDGE_MASK, EDGES, FOG, FOG_CLEAR, FOG_MASK, fogBuffer, fogCoords, hasMultiTextureAPI, INTERSECT_ALL, INTERSECT_COLOR, INTERSECT_COORDS, INTERSECT_NORMAL, INTERSECT_TEXCOORDS_MULTI, INTERSECT_TEXCOORDS_SINGLE, maxTextureUnits, NORMAL_CLEAR, normalBuffer, normals, NORMALS, numCoords, numRenderedTextureSets, numRequiredCoords, numTextureArrays, numTextureSets, TEXTURE_CLEAR, TEXTURE_COORDINATE_1, TEXTURE_COORDINATE_2, TEXTURE_COORDINATE_3, TEXTURE_COORDINATE_4, TEXTURE_COORDINATE_MULTI, TEXTURE_COORDINATE_SINGLE, TEXTURE_MASK, TEXTURE_SET_AVAILABLE, TEXTURE_SET_CLEAR, textureBuffer, textures, textureSets, textureTypes, vertexBuffer, vertexFormat, wkPolygon
 
Fields inherited from class org.j3d.aviatrix3d.Geometry
bounds, implicitBounds, internalUpdater, INVALID_BOUNDS, lastParentList, parentList, pickFlags, validAlpha
 
Fields inherited from class org.j3d.aviatrix3d.NodeComponent
lastParent, liveCount
 
Fields inherited from class org.j3d.aviatrix3d.SceneGraphObject
alive, LISTENER_SET_NOT_LIVE_MESSAGE, updateHandler, WRITE_TIMING_MSG
 
Fields inherited from interface org.j3d.aviatrix3d.PickableObject
COLLIDABLE_OBJECT, GENERAL_OBJECT, PROXIMITY_OBJECT, VISIBLE_OBJECT
 
Constructor Summary
QuadArray()
          Constructs a QuadArray with default values.
 
Method Summary
 boolean pickLineRay(float[] origin, float[] direction, boolean findAny, float[] dataOut, int dataOutFlags)
          Check for all intersections against this geometry using a line ray and return the exact distance away of the closest picking point.
 boolean pickLineSegment(float[] start, float[] end, boolean findAny, float[] dataOut, int dataOutFlags)
          Check for all intersections against this geometry using a line segment and return the exact distance away of the closest picking point.
 void postRender(net.java.games.jogl.GL gl, net.java.games.jogl.GLU glu)
          Restore all openGL state.
 void render(net.java.games.jogl.GL gl, net.java.games.jogl.GLU glu)
          Issue ogl commands needed for this renderable object.
 void setEdgeFlags(boolean[] flags)
          Set the edge flag reference to the new array.
 void setValidVertexCount(int count)
          Set the number of vertices to the new number.
 void setVertices(int type, float[] vertices, int numValid)
          Set the vertex array reference to the new array.
 
Methods inherited from class org.j3d.aviatrix3d.VertexGeometry
clearVertexState, getColors, getFogCoordinates, getNormals, getSecondaryColors, getTextureCoordinates, getValidVertexCount, getVertexType, getVertices, initPolygonDetails, isMultiTextureAllowed, isVisible, numTextureUnits, ray3DQuadChecked, ray3DTriangleChecked, recomputeBounds, setAttributes, setAttributes, setAttributes, setAttributes, setAttributes, setColors, setFogCoordinates, setLive, setNormals, setSecondaryColors, setSingleColor, setTextureCoordinates, setTextureCoordinates, setTextureCoordinates, setTextureSetMap, setTextureSetMap, setVertexState, setVertices, updateBounds
 
Methods inherited from class org.j3d.aviatrix3d.Geometry
addParent, boundsChanged, getBounds, getPickMask, hasTransparency, markBoundsDirty, pickBatch, pickSingle, removeParent, setBounds, setPickMask
 
Methods inherited from class org.j3d.aviatrix3d.NodeComponent
addParent, getParents, hasChanged, numParents, removeParent
 
Methods inherited from class org.j3d.aviatrix3d.SceneGraphObject
checkForCyclicChild, checkForCyclicParent, dataChanged, getUserData, isLive, setUpdateHandler, setUserData
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

QuadArray

public QuadArray()
Constructs a QuadArray with default values.

Method Detail

render

public void render(net.java.games.jogl.GL gl,
                   net.java.games.jogl.GLU glu)
Issue ogl commands needed for this renderable object.

Parameters:
gl - The gl context to draw with
glu - The utility context to draw with

postRender

public void postRender(net.java.games.jogl.GL gl,
                       net.java.games.jogl.GLU glu)
Restore all openGL state.

Parameters:
gl - The gl context to draw with
glu - The utility context to draw with

setValidVertexCount

public void setValidVertexCount(int count)
                         throws java.lang.IllegalStateException,
                                java.lang.IllegalArgumentException,
                                InvalidWriteTimingException
Set the number of vertices to the new number.

In a live scene graph, can only be called during the bounds changed callback.

Overrides:
setValidVertexCount in class VertexGeometry
Parameters:
count - The new number, must be >= 0
Throws:
java.lang.IllegalStateException - This call was not made during the update callback if the node is live
java.lang.IllegalArgumentException - The number is negative
InvalidWriteTimingException - An attempt was made to write outside of the NodeUpdateListener callback method

setVertices

public void setVertices(int type,
                        float[] vertices,
                        int numValid)
                 throws java.lang.IllegalStateException,
                        java.lang.IllegalArgumentException,
                        InvalidWriteTimingException
Set the vertex array reference to the new array. The number of valid items is taken from the second parameter. This replaces the existing vertex list array reference with the new reference.

In a live scene graph, can only be called during the bounds changed callback.

Overrides:
setVertices in class VertexGeometry
Parameters:
type - The number of dimensions to the coordinates - 2D, 3D or 4D
vertices - The new array reference to use for vertex information
numValid - The number of valid values to use in the array
Throws:
java.lang.IllegalStateException - This call was not made during the update callback if the node is live
java.lang.IllegalArgumentException - The number is negative
InvalidWriteTimingException - An attempt was made to write outside of the NodeUpdateListener callback method

pickLineSegment

public boolean pickLineSegment(float[] start,
                               float[] end,
                               boolean findAny,
                               float[] dataOut,
                               int dataOutFlags)
                        throws NotPickableException
Check for all intersections against this geometry using a line segment and return the exact distance away of the closest picking point.

Overrides:
pickLineSegment in class Geometry
Parameters:
start - The start point of the segment
end - The end point of the segment
findAny - True if it only has to find a single intersection and can exit as soon as it finds the first intersection. False if it must find the closest polygon
dataOut - An array to put the data in for the intersection. Exact format is described by the flags
dataOutFlags - A set of derived-class specific flags describing what data should be included in the output array
Returns:
True if an intersection was found according to the input request
Throws:
NotPickableException - This object has been marked as non pickable, but you decided to try to call the method anyway

pickLineRay

public boolean pickLineRay(float[] origin,
                           float[] direction,
                           boolean findAny,
                           float[] dataOut,
                           int dataOutFlags)
                    throws NotPickableException
Check for all intersections against this geometry using a line ray and return the exact distance away of the closest picking point. Default implementation always returns false indicating that nothing was found. Derived classes should override and provide a real implementation.

Overrides:
pickLineRay in class Geometry
Parameters:
origin - The start point of the ray
direction - The direction vector of the ray
findAny - True if it only has to find a single intersection and can exit as soon as it finds the first intersection. False if it must find the closest polygon
dataOut - An array to put the data in for the intersection. Exact format is described by the flags
dataOutFlags - A set of derived-class specific flags describing what data should be included in the output array
Returns:
True if an intersection was found according to the input request
Throws:
NotPickableException - This object has been marked as non pickable, but you decided to try to call the method anyway

setEdgeFlags

public void setEdgeFlags(boolean[] flags)
                  throws java.lang.IllegalStateException,
                         java.lang.IllegalArgumentException,
                         InvalidWriteTimingException
Set the edge flag reference to the new array. The number of valid items is taken to be the length of the array (there's only one flag per edge). This replaces the existing edge flag array reference with the new reference. If set to null, will clear the use of edge flags.

In a live scene graph, can only be called during the data changed callback.

Parameters:
flags - The new array reference to use for edge flag information
Throws:
java.lang.IllegalStateException - This call was not made during the update callback if the node is live
InvalidWriteTimingException - An attempt was made to write outside of the NodeUpdateListener callback method
java.lang.IllegalArgumentException

Aviatrix3D 1.0

Latest Info from http://aviatrix3d.j3d.org/
Copyright © 2003 - 2005 j3d.org