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: 29127 $, $Date: 2011-01-10 16:13:35 +0100 (Mon, 10 Jan 2011) $
Author:
Rutger Bezema, last edited by: $Author: aschmitz $

Constructor Summary
TextureTile(double minX, double minY, double maxX, double maxY, double dataMinX, double dataMinY, double dataMaxX, double dataMaxY, int textureWidth, int textureHeight, ByteBuffer imageData, boolean hasAlpha, boolean enableCaching)
           
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)
           
 double getDataMaxX()
           
 double getDataMaxY()
           
 double getDataMinX()
           
 double getDataMinY()
           
 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,
                   double dataMinX,
                   double dataMinY,
                   double dataMaxX,
                   double dataMaxY,
                   int textureWidth,
                   int textureHeight,
                   ByteBuffer imageData,
                   boolean hasAlpha,
                   boolean enableCaching)
Parameters:
minX -
minY -
maxX -
maxY -
dataMinX -
dataMinY -
dataMaxX -
dataMaxY -
textureWidth -
textureHeight -
imageData -
hasAlpha -
enableCaching -
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.

getDataMinX

public final double getDataMinX()
Returns:
the dataMinX

getDataMinY

public final double getDataMinY()
Returns:
the dataMinY

getDataMaxX

public final double getDataMaxX()
Returns:
the dataMaxX

getDataMaxY

public final double getDataMaxY()
Returns:
the dataMaxY

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


Copyright © 2011. All Rights Reserved.