j3d.org Aviatrix3D

org.j3d.aviatrix3d
Class Texture2D

java.lang.Object
  extended byorg.j3d.aviatrix3d.SceneGraphObject
      extended byorg.j3d.aviatrix3d.NodeComponent
          extended byorg.j3d.aviatrix3d.Texture
              extended byorg.j3d.aviatrix3d.Texture2D
All Implemented Interfaces:
java.lang.Comparable, DeletableSceneGraphObject

public class Texture2D
extends Texture

Describes the 2D texture properties of an object.

Version:
$Revision: 1.22 $
Author:
Alan Hudson

Field Summary
protected  int boundaryModeT
          The boundary mode S value
protected  int height
          The height of the main texture.
 
Fields inherited from class org.j3d.aviatrix3d.Texture
ANISOTROPIC_MODE_NONE, ANISOTROPIC_MODE_SINGLE, anisotropicDegree, anisotropicMode, BM_CLAMP, BM_CLAMP_TO_BOUNDARY, BM_CLAMP_TO_EDGE, BM_WRAP, boundaryModeS, displayListMap, format, FORMAT_ALPHA, FORMAT_INTENSITY, FORMAT_INTENSITY_ALPHA, FORMAT_RGB, FORMAT_RGBA, images, magFilter, MAGFILTER_BASE_LEVEL_LINEAR, MAGFILTER_BASE_LEVEL_POINT, MAGFILTER_FASTEST, MAGFILTER_LINEAR_DETAIL, MAGFILTER_LINEAR_DETAIL_ALPHA, MAGFILTER_LINEAR_DETAIL_RGB, MAGFILTER_NICEST, minFilter, MINFILTER_BASE_LEVEL_LINEAR, MINFILTER_BASE_LEVEL_POINT, MINFILTER_FASTEST, MINFILTER_MULTI_LEVEL_LINEAR, MINFILTER_MULTI_LEVEL_POINT, MINFILTER_NICEST, mipMapMode, MODE_BASE_LEVEL, MODE_MIPMAP, numImages, stateChanged, textureIdMap, textureType, width
 
Fields inherited from class org.j3d.aviatrix3d.NodeComponent
liveCount
 
Fields inherited from class org.j3d.aviatrix3d.SceneGraphObject
alive, updateHandler, WRITE_TIMING_MSG
 
Constructor Summary
Texture2D()
          Constructs a texture with default values.
Texture2D(int format, TextureComponent2D singleImage)
          Constructs a texture using just a single image, thus setting it initially as MODE_BASE_LEVEL.
Texture2D(int format, TextureComponent2D[] srcImages, int num)
          Constructs a 2D texture with the specified images.
 
Method Summary
 int compareTo(Texture tex)
          Compares this object with the specified object for order.
 boolean equals(Texture tex)
          Compares this object with the specified object to check for equivalence.
 int getBoundaryModeT()
          Get the current boundary handling for the T parameter.
 int getHeight()
          Get the height of the texture in pixels.
 void renderState(net.java.games.jogl.GL gl, net.java.games.jogl.GLU glu)
          Issue ogl commands needed for this component
 void restoreState(net.java.games.jogl.GL gl, net.java.games.jogl.GLU glu)
          Restore all openGL state to the given drawable
 void setBoundaryModeT(int mode)
          Set the boundary handling for the T parameter.
 
Methods inherited from class org.j3d.aviatrix3d.Texture
cleanup, compareTo, equals, getAnisotropicFilterDegree, getAnisotropicFilterMode, getBoundaryModeS, getFormat, getMagFilter, getMinFilter, getTextureType, getWidth, setAnisotropicFilterDegree, setAnisotropicFilterMode, setBoundaryModeS, setImages, setLive, setMagFilter, setMinFilter
 
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, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

boundaryModeT

protected int boundaryModeT
The boundary mode S value


height

protected int height
The height of the main texture.

Constructor Detail

Texture2D

public Texture2D()
Constructs a texture with default values.


Texture2D

public Texture2D(int format,
                 TextureComponent2D singleImage)
Constructs a texture using just a single image, thus setting it initially as MODE_BASE_LEVEL.


Texture2D

public Texture2D(int format,
                 TextureComponent2D[] srcImages,
                 int num)
Constructs a 2D texture with the specified images. The number of images should be 1 for no mip maps, or all mipmap levels should be provided.

Parameters:
srcImages - The image defining this texture.
num - The number of valid images to take from the array
Method Detail

renderState

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

Overrides:
renderState in class NodeComponent
Parameters:
gl - The gl context to draw with
glu - The utility context to draw with

restoreState

public void restoreState(net.java.games.jogl.GL gl,
                         net.java.games.jogl.GLU glu)
Restore all openGL state to the given drawable

Overrides:
restoreState in class NodeComponent
Parameters:
gl - The gl context to draw with
glu - The utility context to draw with

setBoundaryModeT

public void setBoundaryModeT(int mode)
                      throws InvalidWriteTimingException
Set the boundary handling for the T parameter.

Parameters:
mode - The new mode.
Throws:
InvalidWriteTimingException - An attempt was made to write outside of the NodeUpdateListener callback method

getBoundaryModeT

public int getBoundaryModeT()
Get the current boundary handling for the T parameter.

Returns:
The current mode.

getHeight

public int getHeight()
Get the height of the texture in pixels. If no image is set, this returns -1.

Returns:
a number >= -1

compareTo

public int compareTo(Texture tex)
Compares this object with the specified object for order. Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object. Derived instances should override this to add texture-specific extensions.

Overrides:
compareTo in class Texture
Parameters:
tex - The texture instance to be compared
Returns:
-1, 0 or 1 depending on order

equals

public boolean equals(Texture tex)
Compares this object with the specified object to check for equivalence.

Overrides:
equals in class Texture
Parameters:
tex - The texture instance to be compared
Returns:
true if the objects represent identical values

j3d.org Aviatrix3D

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