NASA World Wind

gov.nasa.worldwind.render
Class FramebufferTexture

java.lang.Object
  extended by gov.nasa.worldwind.render.FramebufferTexture
All Implemented Interfaces:
WWTexture
Direct Known Subclasses:
FBOTexture

public class FramebufferTexture
extends java.lang.Object
implements WWTexture


Field Summary
protected  java.util.List<LatLon> corners
           
protected static int DEFAULT_TESSELLATION_DENSITY
           
protected  int height
           
protected  Sector sector
           
protected  WWTexture sourceTexture
           
protected  int tessellationDensity
           
protected  com.sun.opengl.util.texture.TextureCoords textureCoords
           
protected  int width
           
 
Constructor Summary
FramebufferTexture(DrawContext dc, WWTexture imageSource, Sector sector, java.util.List<LatLon> corners)
           
 
Method Summary
 void applyInternalTransform(DrawContext dc)
          Applies any necessary transformations to the texture prior to its being rendered.
 boolean bind(DrawContext dc)
          Makes the texture the current texture for rendering.
protected  Matrix computeGeographicToCartesianTransform(Sector sector)
           
protected  void drawQuad(DrawContext dc, BilinearInterpolator interp, int slices, int stacks)
           
protected  void drawQuad(DrawContext dc, Matrix geoToCartesian, int slices, int stacks)
           
protected  void generateTexture(DrawContext dc, int width, int height)
           
 java.util.List<LatLon> getCorners()
           
 int getHeight(DrawContext dc)
          Returns the texture's height
 java.lang.Object getImageSource()
          Returns the texture's image source.
 Sector getSector()
           
protected  int getTessellationDensity()
           
 com.sun.opengl.util.texture.TextureCoords getTexCoords()
          Returns the texture's texture coordinates, which may be other than [0,0],[1,1] if the texture size is not a power of two or the texture must be flipped when rendered.
 int getWidth(DrawContext dc)
          Returns the texture's width.
protected  void initialize(DrawContext dc)
           
protected  com.sun.opengl.util.texture.Texture initializeTexture(DrawContext dc)
           
 boolean isTextureCurrent(DrawContext dc)
          Indicates whether the texture is currently available for use without regenerating it from its image source.
 boolean isTextureInitializationFailed()
          Indicates whether an attempt to initialize the texture failed, which occurs when the image source is a non-existent image file or for other reasons specific to the image source.
protected  Vec4 transformToQuadCoordinates(Matrix geoToCartesian, LatLon latLon)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

corners

protected java.util.List<LatLon> corners

DEFAULT_TESSELLATION_DENSITY

protected static final int DEFAULT_TESSELLATION_DENSITY
See Also:
Constant Field Values

height

protected int height

sector

protected Sector sector

sourceTexture

protected WWTexture sourceTexture

tessellationDensity

protected int tessellationDensity

textureCoords

protected com.sun.opengl.util.texture.TextureCoords textureCoords

width

protected int width
Constructor Detail

FramebufferTexture

public FramebufferTexture(DrawContext dc,
                          WWTexture imageSource,
                          Sector sector,
                          java.util.List<LatLon> corners)
Method Detail

applyInternalTransform

public void applyInternalTransform(DrawContext dc)
Description copied from interface: WWTexture
Applies any necessary transformations to the texture prior to its being rendered. A common transformation is mapping texture coordinates from a flipped or non-square state to conventionally oriented OpenGL values.

Specified by:
applyInternalTransform in interface WWTexture
Parameters:
dc - the current draw context.

bind

public boolean bind(DrawContext dc)
Description copied from interface: WWTexture
Makes the texture the current texture for rendering. If the texture has not been created from its image source, creates the texture from its source.

If a texture cannot be created from its image source it cannot be bound. This method returns an indication of whether the texture was bound or was not bound due to a failure during creation.

Specified by:
bind in interface WWTexture
Parameters:
dc - the current draw context.
Returns:
true if the texture was bound, otherwise false.

computeGeographicToCartesianTransform

protected Matrix computeGeographicToCartesianTransform(Sector sector)

drawQuad

protected void drawQuad(DrawContext dc,
                        BilinearInterpolator interp,
                        int slices,
                        int stacks)

drawQuad

protected void drawQuad(DrawContext dc,
                        Matrix geoToCartesian,
                        int slices,
                        int stacks)

generateTexture

protected void generateTexture(DrawContext dc,
                               int width,
                               int height)

getCorners

public java.util.List<LatLon> getCorners()

getHeight

public int getHeight(DrawContext dc)
Description copied from interface: WWTexture
Returns the texture's height

Specified by:
getHeight in interface WWTexture
Parameters:
dc - the current draw context
Returns:
the texture's height, or 0 if the texture's size is currently unknown.

getImageSource

public java.lang.Object getImageSource()
Description copied from interface: WWTexture
Returns the texture's image source.

Specified by:
getImageSource in interface WWTexture
Returns:
the texture's image source.

getSector

public Sector getSector()

getTessellationDensity

protected int getTessellationDensity()

getTexCoords

public com.sun.opengl.util.texture.TextureCoords getTexCoords()
Description copied from interface: WWTexture
Returns the texture's texture coordinates, which may be other than [0,0],[1,1] if the texture size is not a power of two or the texture must be flipped when rendered.

Specified by:
getTexCoords in interface WWTexture
Returns:
returns the texture's texture coordinates.

getWidth

public int getWidth(DrawContext dc)
Description copied from interface: WWTexture
Returns the texture's width.

Specified by:
getWidth in interface WWTexture
Parameters:
dc - the current draw context
Returns:
the texture's width, or 0 if the texture's size is currently unknown.

initialize

protected void initialize(DrawContext dc)

initializeTexture

protected com.sun.opengl.util.texture.Texture initializeTexture(DrawContext dc)

isTextureCurrent

public boolean isTextureCurrent(DrawContext dc)
Description copied from interface: WWTexture
Indicates whether the texture is currently available for use without regenerating it from its image source.

Specified by:
isTextureCurrent in interface WWTexture
Parameters:
dc - the current draw context
Returns:
true if the texture is available and consistent with its image source, otherwise false.

isTextureInitializationFailed

public boolean isTextureInitializationFailed()
Description copied from interface: WWTexture
Indicates whether an attempt to initialize the texture failed, which occurs when the image source is a non-existent image file or for other reasons specific to the image source.

Specified by:
isTextureInitializationFailed in interface WWTexture
Returns:
true if texture initialization failed, otherwise false.

transformToQuadCoordinates

protected Vec4 transformToQuadCoordinates(Matrix geoToCartesian,
                                          LatLon latLon)

NASA World Wind