deegree-core-3.0-pre-nightly (2010/03/05 00:01) - official

org.deegree.rendering.r3d.opengl.rendering.dem.texturing
Class TextureTile

java.lang.Object
  extended by org.deegree.rendering.r3d.opengl.rendering.dem.texturing.TextureTile

public class TextureTile
extends Object

The TextureTile define the parameters necessary to create, request and render a texture to the DEM. Texture are created and rendered with following options:

Version:
$Revision: $, $Date: $
Author:
Rutger Bezema, last edited by: $Author: rbezema $

Constructor Summary
TextureTile(double minX, double minY, double maxX, double maxY, float metersPerPixel, int textureWidth, int textureHeight, PooledByteBuffer pooledBuffer, boolean hasAlpha, boolean enableCaching)
          Construct a new texture tile.
TextureTile(double minX, double minY, double maxX, double maxY, int textureWidth, int textureHeight, ByteBuffer imageData, boolean hasAlpha, boolean enableCaching)
          Construct a new texture tile.
 
Method Summary
 void disable(javax.media.opengl.GL gl, int refID)
          Remove the texture from the context.
 void dispose()
          Clean up all reference to the byte buffer.
 int enable(javax.media.opengl.GL gl, int refID)
           
 boolean enableCaching()
           
 boolean equals(Object other)
           
 int getHeight()
           
 int getId()
           
 ByteBuffer getImageData()
           
 double getMaxX()
           
 double getMaxY()
           
 double getMetersPerPixel()
           
 double getMinX()
           
 double getMinY()
           
 int getWidth()
           
 int hashCode()
          Implementation as proposed by Joshua Block in Effective Java (Addison-Wesley 2001), which supplies an even distribution and is relatively fast.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TextureTile

public TextureTile(double minX,
                   double minY,
                   double maxX,
                   double maxY,
                   int textureWidth,
                   int textureHeight,
                   ByteBuffer imageData,
                   boolean hasAlpha,
                   boolean enableCaching)
Construct a new texture tile.

Parameters:
minX -
minY -
maxX -
maxY -
textureWidth -
textureHeight -
imageData -
hasAlpha -
enableCaching -

TextureTile

public TextureTile(double minX,
                   double minY,
                   double maxX,
                   double maxY,
                   float metersPerPixel,
                   int textureWidth,
                   int textureHeight,
                   PooledByteBuffer pooledBuffer,
                   boolean hasAlpha,
                   boolean enableCaching)
Construct a new texture tile.

Parameters:
minX -
minY -
maxX -
maxY -
metersPerPixel - the resolution of a pixel in meters.
textureWidth -
textureHeight -
pooledBuffer -
hasAlpha -
enableCaching - true if the gpu cache of the TextureManager and / or the memory cache of the TextureTileManager should be used.
Method Detail

dispose

public void dispose()
Clean up all reference to the byte buffer.


enableCaching

public boolean enableCaching()
Returns:
true if the given texture tile should be cached.

getImageData

public ByteBuffer getImageData()
Returns:
the actual data.

getMinX

public double getMinX()
Returns:
the min x position in world coordinates.

getMinY

public double getMinY()
Returns:
the min y position in world coordinates.

getMaxX

public double getMaxX()
Returns:
the max x position in world coordinates.

getMaxY

public double getMaxY()
Returns:
the max Y position in world coordinates.

getMetersPerPixel

public double getMetersPerPixel()
Returns:
the number of meters this texture projects onto one pixel.

getWidth

public int getWidth()
Returns:
the width of the image.

getHeight

public int getHeight()
Returns:
the height of the image.

enable

public int enable(javax.media.opengl.GL gl,
                  int refID)
Parameters:
gl - context to load this texture to.
refID - of the enabling fragment.
Returns:
the opengl texture id.

disable

public void disable(javax.media.opengl.GL gl,
                    int refID)
Remove the texture from the context.

Parameters:
gl -
refID - of the fragment which needed this texture tile.

toString

public String toString()
Overrides:
toString in class Object

getId

public int getId()
Returns:
the GL-texture object id of this texture tile.

hashCode

public int hashCode()
Implementation as proposed by Joshua Block in Effective Java (Addison-Wesley 2001), which supplies an even distribution and is relatively fast. It is created from field f as follows:

Combining the hash code(s) computed above: result = 37 * result + code;

Overrides:
hashCode in class Object
Returns:
(int) ( result >>> 32 ) ^ (int) result;
See Also:
Object.hashCode()

equals

public boolean equals(Object other)
Overrides:
equals in class Object

deegree-core-3.0-pre-nightly (2010/03/05 00:01) - official

an open source project founded by lat/lon, Bonn, Germany.
For more information visit: http://www.deegree.org

]]>