NASA World Wind

gov.nasa.worldwind.ogc.collada.impl
Class ColladaMeshShape

java.lang.Object
  extended by gov.nasa.worldwind.avlist.AVListImpl
      extended by gov.nasa.worldwind.WWObjectImpl
          extended by gov.nasa.worldwind.render.AbstractShape
              extended by gov.nasa.worldwind.render.AbstractGeneralShape
                  extended by gov.nasa.worldwind.ogc.collada.impl.ColladaMeshShape
All Implemented Interfaces:
AVList, MessageListener, Exportable, ExtentHolder, Movable, GeographicExtent, Highlightable, OrderedRenderable, Renderable, Restorable, WWObject, PropertyChangeListener, EventListener

public class ColladaMeshShape
extends AbstractGeneralShape

Shape to render a COLLADA line or triangle mesh. An instance of this shape can render any number of ColladaLines or ColladaTriangles, but a single instance cannot render both lines and triangles. New instances are created by createTriangleMesh and createLineMesh.

This shape supports only COLLADA line and triangle geometries.


Nested Class Summary
protected static class ColladaMeshShape.Geometry
          Geometry and attributes of a COLLADA triangles or lines element.
static class ColladaMeshShape.OrderedMeshShape
          Class to represent an instance of the mesh to be drawn as an ordered renderable.
protected static class ColladaMeshShape.ShapeData
          This class holds globe-specific data for this shape.
 
Nested classes/interfaces inherited from class gov.nasa.worldwind.render.AbstractShape
AbstractShape.AbstractShapeData
 
Field Summary
protected  ColladaBindMaterial bindMaterial
          Material applied to this mesh.
protected  FloatBuffer coordBuffer
          The vertex data buffer for this shape data.
protected  int elementType
          OpenGL element type for this shape (GL.GL_LINES or GL.GL_TRIANGLES).
protected  Map<Matrix,Extent> extentCache
          Cache of shape extents computed for different transform matrices.
protected  List<ColladaMeshShape.Geometry> geometries
          Geometry objects that describe different parts of the mesh.
protected  FloatBuffer normalBuffer
          The slice of the coordBuffer that contains normals.
protected  int normalBufferPosition
          The index of the first normal in the coordBuffer.
protected  int shapeCount
          Total number of shapes (lines or triangles) in this mesh.
protected  int texCoordBufferPosition
          The index of the first texture coordinate in the coordBuffer.
protected  FloatBuffer textureCoordsBuffer
          Texture coordinates for all geometries in this shape.
protected  int vertsPerShape
          Number of vertices per shape.
 
Fields inherited from class gov.nasa.worldwind.render.AbstractGeneralShape
heading, modelPosition, modelScale, pitch, resourceMap, roll
 
Fields inherited from class gov.nasa.worldwind.render.AbstractShape
activeAttributes, altitudeMode, BEogsh, currentData, DEFAULT_ALTITUDE_MODE, DEFAULT_GEOMETRY_GENERATION_INTERVAL, DEFAULT_HIGHLIGHT_MATERIAL, DEFAULT_INTERIOR_MATERIAL, DEFAULT_OUTLINE_MATERIAL, DEFAULT_OUTLINE_PICK_WIDTH, defaultAttributes, delegateOwner, enableBatchPicking, enableBatchRendering, enableDepthOffset, highlightAttrs, highlighted, maxExpiryTime, minExpiryTime, normalAttrs, outlinePickWidth, outlineShapeRenderer, pickLayer, pickSupport, referencePosition, sector, shapeDataCache, VBO_THRESHOLD, viewDistanceExpiration, visible
 
Fields inherited from interface gov.nasa.worldwind.Exportable
FORMAT_NOT_SUPPORTED, FORMAT_PARTIALLY_SUPPORTED, FORMAT_SUPPORTED
 
Constructor Summary
protected ColladaMeshShape(List<? extends ColladaAbstractGeometry> geometries)
          Create an instance of the shape.
 
Method Summary
protected  void addOrderedRenderable(DrawContext dc)
          Adds this shape to the draw context's ordered renderable list.
protected  void applyMaterial(DrawContext dc, Material material)
          Apply a material to the active draw context.
protected  OGLStackHandler beginDrawing(DrawContext dc, int attrMask)
          Establish the OpenGL state needed to draw this shape.
protected  Extent computeExtent(DrawContext dc)
          Compute the shape's extent, using the active orientation matrix.
protected  double computeEyeDistance(DrawContext dc)
          Computes the minimum distance between this shape and the eye point.
protected  Vec4 computeReferenceCenter(DrawContext dc)
          Computes this shape's reference center.
protected  Matrix computeRenderMatrix(DrawContext dc)
          Computes the transform to use during rendering to orient the model.
protected  AbstractShape.AbstractShapeData createCacheEntry(DrawContext dc)
          Creates and returns a new cache entry specific to the subclass.
protected  void createFullGeometry(DrawContext dc)
          Create full geometry for the shape, including normals and texture coordinates.
static ColladaMeshShape createLineMesh(List<ColladaLines> geometries, ColladaBindMaterial bindMaterial)
          Create a line mesh shape.
protected  void createMinimalGeometry(DrawContext dc, ColladaMeshShape.ShapeData shapeData)
          Compute enough geometry to determine this shape's extent, reference point and eye distance.
protected  void createNormals()
          Create this shape's vertex normals.
protected  void createTexCoords()
          Create this shape's texture coordinates.
static ColladaMeshShape createTriangleMesh(List<ColladaTriangles> geometries, ColladaBindMaterial bindMaterial)
          Create a triangle mesh shape.
protected  void createVertexCoords(DrawContext dc)
          Create the shape's vertex coordinates.
protected  void doDrawInterior(DrawContext dc)
          Draws this shape's interior.
protected  void doDrawInteriorVA(DrawContext dc, ColladaMeshShape.Geometry geometry)
          Draw one geometry in the mesh interior using vertex arrays.
protected  void doDrawInteriorVBO(DrawContext dc, ColladaMeshShape.Geometry geometry, int[] vboIds)
          Draw one geometry in the mesh interior using vertex buffer objects.
protected  void doDrawOrderedRenderable(DrawContext dc, PickSupport pickCandidates, Matrix matrix)
          Draw the shape as an OrderedRenderable, using the specified transform matrix.
protected  void doDrawOutline(DrawContext dc)
          Draws this shape's outline.
protected  boolean doMakeOrderedRenderable(DrawContext dc)
          Produces the geometry and other state necessary to represent this shape as an ordered renderable.
protected  void drawBatched(DrawContext dc)
          Draws this ordered renderable and all subsequent Path ordered renderables in the ordered renderable list.
protected  void fillVBO(DrawContext dc)
          Fill this shape's vertex buffer objects.
protected  ColladaEffect getEffect(ColladaAbstractGeometry geometry)
          Indicates the effect applied to a geometry.
protected  String getImageRef(ColladaEffect effect, ColladaTexture texture)
          Indicates the reference string for an image.
protected  ColladaInstanceMaterial getInstanceMaterial(ColladaMeshShape.Geometry geometry)
          Indicates the instance_material element for a geometry.
 Box getLocalExtent(ColladaTraversalContext tc)
           
protected  Material getMaterial(ColladaMeshShape.Geometry geometry)
          Indicates the material applied to a geometry.
protected  String getTexCoordSemantic(ColladaMeshShape.Geometry geometry)
          Indicates the semantic that identifies texture coordinates.
protected  WWTexture getTexture(ColladaMeshShape.Geometry geometry)
          Indicates the texture applied to this shape.
protected  String getTextureSource(ColladaAbstractGeometry geometry)
          Indicates the source (file path or URL) of the texture applied to a geometry.
 List<Intersection> intersect(Line line, Terrain terrain)
          Compute the intersections of a specified line with this shape.
protected  boolean isDoubleSided(ColladaAbstractGeometry geometry)
          Indicates whether or not a geometry is double sided.
protected  boolean isOrderedRenderableValid(DrawContext dc)
          Determines whether this shape's ordered renderable state is valid and can be rendered.
protected  boolean mustApplyTexture(ColladaMeshShape.Geometry geometry)
          Indicates whether or not a texture must be applied to a geometry.
protected  boolean mustApplyTexture(DrawContext dc)
          Indicates whether texture should be applied to this shape.
 void pick(DrawContext dc, Point pickPoint, Matrix matrix)
          Pick the mesh in a given orientation.
 void render(DrawContext dc, Matrix matrix)
          Render the mesh in a given orientation.
 void setModelPosition(Position modelPosition)
          Specifies this shape's geographic position.
protected  void setModelViewMatrix(DrawContext dc)
          Called during drawing to set the modelview matrix to apply the correct position, scale and orientation for this shape.
 
Methods inherited from class gov.nasa.worldwind.render.AbstractGeneralShape
computeEyeDistance, computeReferencePoint, doExportAsKML, getCurrent, getHeading, getModelPosition, getModelScale, getPitch, getReferencePosition, getResourceMap, getRoll, getSector, initialize, moveTo, setHeading, setModelScale, setPitch, setResourceMap, setRoll
 
Methods inherited from class gov.nasa.worldwind.render.AbstractShape
checkViewDistanceExpiration, clearCachedVbos, computeExtentFromPositions, computePoint, countTriangleVertices, createPickedObject, determineActiveAttributes, doDrawOrderedRenderable, doGetRestorableState, doRestoreState, drawInterior, drawOrderedRenderable, drawOutline, endDrawing, export, exportAsKML, getActiveAttributes, getAltitudeMode, getAttributes, getCurrentData, getDelegateOwner, getDistanceFromEye, getExtent, getExtent, getGeometryRegenerationInterval, getHighlightAttributes, getOutlinePickWidth, getReferencePoint, getRestorableState, getVboIds, intersectsFrustum, isEnableBatchPicking, isEnableBatchRendering, isEnableDepthOffset, isExportFormatSupported, isHighlighted, isTerrainDependent, isViewDistanceExpiration, isVisible, makeOrderedRenderable, makeTexture, move, mustApplyLighting, mustApplyLighting, mustCreateNormals, mustCreateNormals, mustDrawInterior, mustDrawOutline, mustRegenerateGeometry, pick, prepareToDrawInterior, prepareToDrawOutline, render, reset, restoreState, setAltitudeMode, setAttributes, setDelegateOwner, setEnableBatchPicking, setEnableBatchRendering, setEnableDepthOffset, setGeometryRegenerationInterval, setHighlightAttributes, setHighlighted, setOutlinePickWidth, setReferencePosition, setViewDistanceExpiration, setVisible, shouldUseVBOs
 
Methods inherited from class gov.nasa.worldwind.WWObjectImpl
onMessage, propertyChange
 
Methods inherited from class gov.nasa.worldwind.avlist.AVListImpl
addPropertyChangeListener, addPropertyChangeListener, clearList, copy, firePropertyChange, firePropertyChange, getBooleanValue, getBooleanValue, getChangeSupport, getDoubleValue, getDoubleValue, getEntries, getIntegerValue, getIntegerValue, getLongValue, getLongValue, getRestorableStateForAVPair, getStringValue, getStringValue, getStringValue, getValue, getValues, hasKey, removeKey, removePropertyChangeListener, removePropertyChangeListener, setValue, setValues
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface gov.nasa.worldwind.avlist.AVList
addPropertyChangeListener, addPropertyChangeListener, clearList, copy, firePropertyChange, firePropertyChange, getEntries, getStringValue, getValue, getValues, hasKey, removeKey, removePropertyChangeListener, removePropertyChangeListener, setValue, setValues
 

Field Detail

bindMaterial

protected ColladaBindMaterial bindMaterial
Material applied to this mesh.


coordBuffer

protected FloatBuffer coordBuffer
The vertex data buffer for this shape data. The first part contains vertex coordinates, the second part contains normals, and the third part contains texture coordinates.


elementType

protected int elementType
OpenGL element type for this shape (GL.GL_LINES or GL.GL_TRIANGLES).


extentCache

protected Map<Matrix,Extent> extentCache
Cache of shape extents computed for different transform matrices.


geometries

protected List<ColladaMeshShape.Geometry> geometries
Geometry objects that describe different parts of the mesh.


normalBuffer

protected FloatBuffer normalBuffer
The slice of the coordBuffer that contains normals.


normalBufferPosition

protected int normalBufferPosition
The index of the first normal in the coordBuffer.


shapeCount

protected int shapeCount
Total number of shapes (lines or triangles) in this mesh. Equal to the sum of the shapes in each geometry.


texCoordBufferPosition

protected int texCoordBufferPosition
The index of the first texture coordinate in the coordBuffer.


textureCoordsBuffer

protected FloatBuffer textureCoordsBuffer
Texture coordinates for all geometries in this shape.


vertsPerShape

protected int vertsPerShape
Number of vertices per shape. Two in the case of a line mesh, three in the case of a triangle mesh.

Constructor Detail

ColladaMeshShape

protected ColladaMeshShape(List<? extends ColladaAbstractGeometry> geometries)
Create an instance of the shape.

Parameters:
geometries - Geometries to render. All geometries must be of the same type (either ColladaTriangles or ColladaLines.
Method Detail

addOrderedRenderable

protected void addOrderedRenderable(DrawContext dc)
Adds this shape to the draw context's ordered renderable list. Overridden because this shape uses ColladaMeshShape.OrderedMeshShape to represent this drawn instance of the mesh in the ordered renderable queue.

Overrides:
addOrderedRenderable in class AbstractShape
Parameters:
dc - the current draw context.

applyMaterial

protected void applyMaterial(DrawContext dc,
                             Material material)
Apply a material to the active draw context.

Parameters:
dc - Current draw context.
material - Material to apply.

beginDrawing

protected OGLStackHandler beginDrawing(DrawContext dc,
                                       int attrMask)
Description copied from class: AbstractShape
Establish the OpenGL state needed to draw this shape.

A AbstractShape.AbstractShapeData must be current when this method is called.

Overrides:
beginDrawing in class AbstractShape
Parameters:
dc - the current draw context.
attrMask - an attribute mask indicating state the caller will set. This base class implementation sets GL_CURRENT_BIT, GL_LINE_BIT, GL_HINT_BIT, GL_POLYGON_BIT, GL_COLOR_BUFFER_BIT, and GL_TRANSFORM_BIT.
Returns:
the stack handler used to set the OpenGL state. Callers should use this to set additional state, especially state indicated in the attribute mask argument.

computeExtent

protected Extent computeExtent(DrawContext dc)
Compute the shape's extent, using the active orientation matrix.

Parameters:
dc - Current draw context.
Returns:
The spatial extent of the shape, or null if the extent cannot be determined.

computeEyeDistance

protected double computeEyeDistance(DrawContext dc)
Computes the minimum distance between this shape and the eye point.

A AbstractShape.AbstractShapeData must be current when this method is called.

Parameters:
dc - the current draw context.
Returns:
the minimum distance from the shape to the eye point.

computeReferenceCenter

protected Vec4 computeReferenceCenter(DrawContext dc)
Computes this shape's reference center.

Parameters:
dc - the current draw context.
Returns:
the computed reference center, or null if it cannot be computed.

computeRenderMatrix

protected Matrix computeRenderMatrix(DrawContext dc)
Computes the transform to use during rendering to orient the model.

Parameters:
dc - the current draw context
Returns:
the modelview transform for this shape.

createCacheEntry

protected AbstractShape.AbstractShapeData createCacheEntry(DrawContext dc)
Creates and returns a new cache entry specific to the subclass.

Specified by:
createCacheEntry in class AbstractShape
Parameters:
dc - the current draw context.
Returns:
a data cache entry for the state in the specified draw context.

createFullGeometry

protected void createFullGeometry(DrawContext dc)
Create full geometry for the shape, including normals and texture coordinates.

Parameters:
dc - Current draw context.

createLineMesh

public static ColladaMeshShape createLineMesh(List<ColladaLines> geometries,
                                              ColladaBindMaterial bindMaterial)
Create a line mesh shape.

Parameters:
geometries - COLLADA elements that defines geometry for this shape. Must contain at least one element.
bindMaterial - Material applied to the mesh. May be null.

createMinimalGeometry

protected void createMinimalGeometry(DrawContext dc,
                                     ColladaMeshShape.ShapeData shapeData)
Compute enough geometry to determine this shape's extent, reference point and eye distance.

A AbstractShape.AbstractShapeData must be current when this method is called.

Parameters:
dc - the current draw context.
shapeData - the current shape data for this shape.

createNormals

protected void createNormals()
Create this shape's vertex normals. The normals are stored in normalBuffer.


createTexCoords

protected void createTexCoords()
Create this shape's texture coordinates. The texture coordinates are stored in textureCoordsBuffer.


createTriangleMesh

public static ColladaMeshShape createTriangleMesh(List<ColladaTriangles> geometries,
                                                  ColladaBindMaterial bindMaterial)
Create a triangle mesh shape.

Parameters:
geometries - COLLADA elements that defines geometry for this shape. Must contain at least one element.
bindMaterial - Material applied to the mesh. May be null.

createVertexCoords

protected void createVertexCoords(DrawContext dc)
Create the shape's vertex coordinates. The coordinates are stored in coordBuffer.

Parameters:
dc - Current draw context.

doDrawInterior

protected void doDrawInterior(DrawContext dc)
Draws this shape's interior. Called immediately after calling AbstractShape.prepareToDrawInterior(DrawContext, ShapeAttributes, ShapeAttributes), which establishes OpenGL state for lighting, blending, pick color and interior attributes. Subclasses should execute the drawing commands specific to the type of shape.

A AbstractShape.AbstractShapeData must be current when this method is called.

Specified by:
doDrawInterior in class AbstractShape
Parameters:
dc - the current draw context.

doDrawInteriorVA

protected void doDrawInteriorVA(DrawContext dc,
                                ColladaMeshShape.Geometry geometry)
Draw one geometry in the mesh interior using vertex arrays.

Parameters:
dc - Current draw context.
geometry - Geometry to draw.

doDrawInteriorVBO

protected void doDrawInteriorVBO(DrawContext dc,
                                 ColladaMeshShape.Geometry geometry,
                                 int[] vboIds)
Draw one geometry in the mesh interior using vertex buffer objects.

Parameters:
dc - Current draw context.
geometry - Geometry to draw.
vboIds - Array of vertex buffer identifiers. The first element of the array identifies the buffer that contains vertex coordinates and normal vectors.

doDrawOrderedRenderable

protected void doDrawOrderedRenderable(DrawContext dc,
                                       PickSupport pickCandidates,
                                       Matrix matrix)
Draw the shape as an OrderedRenderable, using the specified transform matrix.

Parameters:
dc - Current draw context.
pickCandidates - Pick candidates for this frame.
matrix - Transform matrix to apply before trying shape. m

doDrawOutline

protected void doDrawOutline(DrawContext dc)
Draws this shape's outline. Called immediately after calling AbstractShape.prepareToDrawOutline(DrawContext, ShapeAttributes, ShapeAttributes), which establishes OpenGL state for lighting, blending, pick color and line attributes. Subclasses should execute the drawing commands specific to the type of shape.

A AbstractShape.AbstractShapeData must be current when this method is called. Does nothing, all drawing is performed by doDrawInterior(gov.nasa.worldwind.render.DrawContext).

Specified by:
doDrawOutline in class AbstractShape
Parameters:
dc - the current draw context.

doMakeOrderedRenderable

protected boolean doMakeOrderedRenderable(DrawContext dc)
Produces the geometry and other state necessary to represent this shape as an ordered renderable. Places this shape on the draw context's ordered renderable list for subsequent rendering. This method is called during AbstractShape.pick(DrawContext, java.awt.Point) and AbstractShape.render(DrawContext) when it's been determined that the shape is likely to be visible.

Specified by:
doMakeOrderedRenderable in class AbstractShape
Parameters:
dc - the current draw context.
Returns:
true if the ordered renderable state was successfully computed, otherwise false, in which case the current pick or render pass is terminated for this shape. Subclasses should return false if it is not possible to create the ordered renderable state.
See Also:
AbstractShape.pick(DrawContext, java.awt.Point), AbstractShape.render(DrawContext)

drawBatched

protected void drawBatched(DrawContext dc)
Draws this ordered renderable and all subsequent Path ordered renderables in the ordered renderable list. If the current pick mode is true, only shapes within the same layer are drawn as a batch.

A AbstractShape.AbstractShapeData must be current when this method is called. Overridden because ColladaMeshShape uses OrderedMeshShape instead of adding itself to the ordered renderable queue.

Overrides:
drawBatched in class AbstractShape
Parameters:
dc - the current draw context.

fillVBO

protected void fillVBO(DrawContext dc)
Fill this shape's vertex buffer objects. If the vertex buffer object resource IDs don't yet exist, create them.

A AbstractShape.AbstractShapeData must be current when this method is called.

Specified by:
fillVBO in class AbstractShape
Parameters:
dc - the current draw context.

getEffect

protected ColladaEffect getEffect(ColladaAbstractGeometry geometry)
Indicates the effect applied to a geometry.

Parameters:
geometry - Geometry for which to find effect.
Returns:
Effect applied to the specified geometry, or null if no effect is defined, or the effect is not available.

getImageRef

protected String getImageRef(ColladaEffect effect,
                             ColladaTexture texture)
Indicates the reference string for an image. The image reference identifies an image element in this, or another COLLADA file. For example, "#myImage".

Parameters:
effect - Effect that defines the texture.
texture - Texture for which to find the image reference.
Returns:
The image reference, or null if it cannot be resolved.

getInstanceMaterial

protected ColladaInstanceMaterial getInstanceMaterial(ColladaMeshShape.Geometry geometry)
Indicates the instance_material element for a geometry.

Parameters:
geometry - Geometry for which to find material.
Returns:
Material for the specified geometry, or null if the material cannot be resolved.

getLocalExtent

public Box getLocalExtent(ColladaTraversalContext tc)

getMaterial

protected Material getMaterial(ColladaMeshShape.Geometry geometry)
Indicates the material applied to a geometry.

Parameters:
geometry - Geometry for which to find material.
Returns:
Material to apply to the geometry. If the COLLADA document does not define a material, this method return a default material.

getTexCoordSemantic

protected String getTexCoordSemantic(ColladaMeshShape.Geometry geometry)
Indicates the semantic that identifies texture coordinates. This may be specified for each material using a bind_vertex_input element.

Parameters:
geometry - Geometry for which to find semantic.
Returns:
The semantic string that identifies the texture coordinates, or null if the geometry does not define the semantic.

getTexture

protected WWTexture getTexture(ColladaMeshShape.Geometry geometry)
Indicates the texture applied to this shape.

Returns:
The texture that must be applied to the shape, or null if there is no texture, or the texture is not available.

getTextureSource

protected String getTextureSource(ColladaAbstractGeometry geometry)
Indicates the source (file path or URL) of the texture applied to a geometry.

Parameters:
geometry - Geometry for which to find texture source.
Returns:
The source of the texture, or null if it cannot be resolved.

intersect

public List<Intersection> intersect(Line line,
                                    Terrain terrain)
                             throws InterruptedException
Compute the intersections of a specified line with this shape. If the shape's altitude mode is other than WorldWind.ABSOLUTE, the shape's geometry is created relative to the specified terrain rather than the terrain used during rendering, which may be at lower level of detail than required for accurate intersection determination.

COLLADA shapes do not support intersection tests because the shape may be rendered multiple times with different transform matrices. It's not possible to determine intersection without the transform matrix applied when the shape is rendered.

Specified by:
intersect in class AbstractShape
Parameters:
line - the line to intersect.
terrain - the Terrain to use when computing the shape's geometry.
Returns:
Always returns null.
Throws:
InterruptedException - if the operation is interrupted.
See Also:
Terrain

isDoubleSided

protected boolean isDoubleSided(ColladaAbstractGeometry geometry)
Indicates whether or not a geometry is double sided. A geometry is double sided if its effect element contains a technique for the profile "GOOGLEEARTH", and the technique includes a double_sided field. The double_sided field is not part of the COLLADA specification, but many COLLADA models packaged in KML include the element.

Parameters:
geometry - Geometry to test.
Returns:
True if the geometry is marked as double sided. Otherwise false.

isOrderedRenderableValid

protected boolean isOrderedRenderableValid(DrawContext dc)
Determines whether this shape's ordered renderable state is valid and can be rendered. Called by AbstractShape.makeOrderedRenderable(DrawContext)just prior to adding the shape to the ordered renderable list.

Specified by:
isOrderedRenderableValid in class AbstractShape
Parameters:
dc - the current draw context.
Returns:
true if this shape is ready to be rendered as an ordered renderable.

mustApplyTexture

protected boolean mustApplyTexture(ColladaMeshShape.Geometry geometry)
Indicates whether or not a texture must be applied to a geometry.

Parameters:
geometry - Geometry to test.
Returns:
True if the specified geometry includes a texture.

mustApplyTexture

protected boolean mustApplyTexture(DrawContext dc)
Indicates whether texture should be applied to this shape. Called during rendering to determine whether texture state should be established during preparation for interior drawing.

Note: This method always returns false during the pick pass.

Specified by:
mustApplyTexture in class AbstractShape
Parameters:
dc - the current draw context
Returns:
True if any geometry in this shape includes a texture.

pick

public void pick(DrawContext dc,
                 Point pickPoint,
                 Matrix matrix)
Pick the mesh in a given orientation.

Parameters:
dc - Current draw context.
pickPoint - Current pick point.
matrix - Matrix to multiply with the current modelview matrix to orient the mesh.

render

public void render(DrawContext dc,
                   Matrix matrix)
Render the mesh in a given orientation.

Parameters:
dc - Current draw context.
matrix - Matrix to be multiply with the current modelview matrix to orient the mesh.

setModelPosition

public void setModelPosition(Position modelPosition)
Specifies this shape's geographic position. The position's altitude is relative to this shape's altitude mode. Overridden to invalidate cached geometry when the model position is changed.

Overrides:
setModelPosition in class AbstractGeneralShape
Parameters:
modelPosition - this shape's geographic position.

setModelViewMatrix

protected void setModelViewMatrix(DrawContext dc)
Called during drawing to set the modelview matrix to apply the correct position, scale and orientation for this shape.

Parameters:
dc - the current DrawContext
Throws:
IllegalArgumentException - if draw context is null or the draw context GL is null

NASA World Wind