org.deegree.rendering.r3d.opengl.rendering.model.geometry
Class RenderableTexturedGeometry

java.lang.Object
  extended by org.deegree.rendering.r3d.opengl.rendering.model.geometry.RenderableGeometry
      extended by org.deegree.rendering.r3d.opengl.rendering.model.geometry.RenderableTexturedGeometry
All Implemented Interfaces:
Serializable, MemoryAware, QualityModelPart, JOGLRenderable, RenderableQualityModelPart

public class RenderableTexturedGeometry
extends RenderableGeometry

The RenderableTexturedGeometry is a RenderableGeometry which has texture coordinates assigned to each vertex as well. Currently only one texture is supported.

Version:
$Revision: 30126 $, $Date: 2011-03-22 11:11:00 +0100 (Tue, 22 Mar 2011) $
Author:
Rutger Bezema, last edited by: $Author: aschmitz $
See Also:
Serialized Form

Constructor Summary
RenderableTexturedGeometry(float[] vertices, int openGLType, float[] vertexNormals, SimpleGeometryStyle style, String texture, float[] textureCoordinates, boolean useDirectBuffers)
           
RenderableTexturedGeometry(float[] vertices, int openGLType, float[] vertexNormals, String texture, float[] textureCoordinates, boolean useDirectBuffers)
           
RenderableTexturedGeometry(FloatBuffer vertices, int openGLType, FloatBuffer vertexNormals, SimpleGeometryStyle style, String texture, FloatBuffer textureCoordinates)
           
RenderableTexturedGeometry(int coordPosition, int vertexCount, int openGLType, int normalPosition, SimpleGeometryStyle style, String textureID, int texturePosition)
           
 
Method Summary
 void disableArrays(RenderContext glRenderContext)
           
protected  void enableArrays(RenderContext glRenderContext, DirectGeometryBuffer geomBuffer)
          Load the float buffers and enable the client state.
 String getTexture()
           
 FloatBuffer getTextureCoordinates()
           
 int getTextureOrdinateCount()
           
 int getTexturePosition()
           
 void setTexture(String texture)
           
 void setTextureCoordinates(float[] textureCoordinates)
           
 long sizeOf()
           
 String toString()
           
 
Methods inherited from class org.deegree.rendering.r3d.opengl.rendering.model.geometry.RenderableGeometry
getCoordBuffer, getCoordPosition, getNormalBuffer, getNormalPosition, getOpenGLType, getOrdinateCount, getReadOnlyCoordBuffer, getStyle, getVertexCount, getVertexNormals, render, renderPrepared, setCoordPosition, setNormPosition, setVertexNormals, setVertices, useDirectBuffers
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RenderableTexturedGeometry

public RenderableTexturedGeometry(float[] vertices,
                                  int openGLType,
                                  float[] vertexNormals,
                                  SimpleGeometryStyle style,
                                  String texture,
                                  float[] textureCoordinates,
                                  boolean useDirectBuffers)
Parameters:
vertices -
openGLType -
vertexNormals -
style -
texture - to use
textureCoordinates - of this data
useDirectBuffers - to use direct buffers instead of heap buffers.

RenderableTexturedGeometry

public RenderableTexturedGeometry(FloatBuffer vertices,
                                  int openGLType,
                                  FloatBuffer vertexNormals,
                                  SimpleGeometryStyle style,
                                  String texture,
                                  FloatBuffer textureCoordinates)
Parameters:
vertices -
openGLType -
vertexNormals -
style -
texture - to use
textureCoordinates - of this data

RenderableTexturedGeometry

public RenderableTexturedGeometry(float[] vertices,
                                  int openGLType,
                                  float[] vertexNormals,
                                  String texture,
                                  float[] textureCoordinates,
                                  boolean useDirectBuffers)
Parameters:
vertices -
openGLType -
vertexNormals -
texture -
textureCoordinates -
useDirectBuffers - to use direct buffers instead of heap buffers.

RenderableTexturedGeometry

public RenderableTexturedGeometry(int coordPosition,
                                  int vertexCount,
                                  int openGLType,
                                  int normalPosition,
                                  SimpleGeometryStyle style,
                                  String textureID,
                                  int texturePosition)
Parameters:
coordPosition - in the direct vertex buffer
vertexCount - the number of vertices
openGLType - the opengl type
normalPosition - position in the direct normal buffer
style - to be applied
textureID - of the texture to use.
texturePosition - in the direct texture buffer.
Method Detail

enableArrays

protected void enableArrays(RenderContext glRenderContext,
                            DirectGeometryBuffer geomBuffer)
Description copied from class: RenderableGeometry
Load the float buffers and enable the client state.

Overrides:
enableArrays in class RenderableGeometry
geomBuffer - for which the coord/normal Positions are valid for.

disableArrays

public void disableArrays(RenderContext glRenderContext)
Overrides:
disableArrays in class RenderableGeometry

getTexture

public final String getTexture()
Returns:
the texture

setTexture

public final void setTexture(String texture)
Parameters:
texture - the texture to set

getTextureCoordinates

public final FloatBuffer getTextureCoordinates()
Returns:
the textureCoordinates

setTextureCoordinates

public final void setTextureCoordinates(float[] textureCoordinates)
Parameters:
textureCoordinates - the textureCoordinates to set

toString

public String toString()
Overrides:
toString in class RenderableGeometry

sizeOf

public long sizeOf()
Specified by:
sizeOf in interface MemoryAware
Overrides:
sizeOf in class RenderableGeometry
Returns:
the bytes this geometry occupies

getTextureOrdinateCount

public int getTextureOrdinateCount()
Specified by:
getTextureOrdinateCount in interface RenderableQualityModelPart
Overrides:
getTextureOrdinateCount in class RenderableGeometry
Returns:
the number of texture ordinates in this quality model part

getTexturePosition

public final int getTexturePosition()
Returns:
the texturePosition


Copyright © 2011. All Rights Reserved.