|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.deegree.rendering.r3d.opengl.rendering.model.geometry.RenderableGeometry
public class RenderableGeometry
The RenderableGeometry
class uses VertexArrays to render the coordinates of it's geometry in an openGL
context. For this to work the coordinates are expected to be organized as defined by the given openGLType.
Normally you might want to use a set of geometries for a single object (for example to create walls of a house). In
this case the easiest way to create a RenderableQualityModel
(containing RenderableGeometry
(ies)) is
the usage of the Tesselator
. The Tesselator
class can be used to create a sole
RenderableGeometry
as well.
Constructor Summary | |
---|---|
RenderableGeometry(float[] vertices,
int openGLType,
float[] vertexNormals,
boolean useDirectBuffers)
|
|
RenderableGeometry(float[] vertices,
int openGLType,
float[] vertexNormals,
SimpleGeometryStyle style,
boolean useDirectBuffers)
|
|
RenderableGeometry(FloatBuffer vertices,
int openGLType,
FloatBuffer vertexNormals,
SimpleGeometryStyle style)
|
|
RenderableGeometry(int coordPosition,
int vertexCount,
int openGLType,
int normalPosition,
SimpleGeometryStyle style)
|
Method Summary | |
---|---|
void |
disableArrays(RenderContext glRenderContext)
|
protected void |
enableArrays(RenderContext glRenderContext,
DirectGeometryBuffer geomBuffer)
Load the float buffers and enable the client state. |
FloatBuffer |
getCoordBuffer()
|
int |
getCoordPosition()
|
FloatBuffer |
getNormalBuffer()
|
int |
getNormalPosition()
|
int |
getOpenGLType()
|
int |
getOrdinateCount()
|
FloatBuffer |
getReadOnlyCoordBuffer()
|
SimpleGeometryStyle |
getStyle()
|
int |
getTextureOrdinateCount()
|
int |
getVertexCount()
|
FloatBuffer |
getVertexNormals()
|
void |
render(RenderContext glRenderContext)
Called to render this object to an OpenGL context. |
void |
renderPrepared(RenderContext glRenderContext,
DirectGeometryBuffer geomBuffer)
This method is a more specific render method than the JOGLRenderable.render(RenderContext) , it defines a
contract that the geometryBuffer holds the geometry for the implementation and the implementation holds indizes
which are valid for the given buffer. |
void |
setCoordPosition(int coordPosition)
|
void |
setNormPosition(int normalPosition)
|
void |
setVertexNormals(float[] vertexNormals)
|
void |
setVertices(float[] vertices,
int openGLType)
|
long |
sizeOf()
|
String |
toString()
|
boolean |
useDirectBuffers()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public RenderableGeometry(float[] vertices, int openGLType, float[] vertexNormals, SimpleGeometryStyle style, boolean useDirectBuffers)
vertices
- openGLType
- vertexNormals
- style
- useDirectBuffers
- to use direct buffers instead of heap buffers.public RenderableGeometry(float[] vertices, int openGLType, float[] vertexNormals, boolean useDirectBuffers)
vertices
- openGLType
- vertexNormals
- useDirectBuffers
- to use direct buffers instead of heap buffers.public RenderableGeometry(FloatBuffer vertices, int openGLType, FloatBuffer vertexNormals, SimpleGeometryStyle style)
vertices
- openGLType
- vertexNormals
- style
- public RenderableGeometry(int coordPosition, int vertexCount, int openGLType, int normalPosition, SimpleGeometryStyle style)
coordPosition
- vertexCount
- openGLType
- normalPosition
- style
- Method Detail |
---|
public void render(RenderContext glRenderContext)
JOGLRenderable
The following pre-conditions hold:
context
has been set up correctly by the caller.params
matches the projection and the screen size, so the callee can depend
on them to perform view frustum culling and LOD adaptation.
render
in interface JOGLRenderable
glRenderContext
- TODOpublic void renderPrepared(RenderContext glRenderContext, DirectGeometryBuffer geomBuffer)
RenderableQualityModelPart
JOGLRenderable.render(RenderContext)
, it defines a
contract that the geometryBuffer holds the geometry for the implementation and the implementation holds indizes
which are valid for the given buffer.
renderPrepared
in interface RenderableQualityModelPart
glRenderContext
- holding all relevant data for the current gl context.geomBuffer
- holding the vertices, normals and texture coordinates for an instance of an implementation.protected void enableArrays(RenderContext glRenderContext, DirectGeometryBuffer geomBuffer)
glRenderContext
- geomBuffer
- for which the coord/normal Positions are valid for.public void disableArrays(RenderContext glRenderContext)
glRenderContext
- public final void setVertices(float[] vertices, int openGLType)
vertices
- the vertices to setopenGLType
- public final FloatBuffer getVertexNormals()
public final void setVertexNormals(float[] vertexNormals)
vertexNormals
- the vertexNormals to setpublic final int getOpenGLType()
public String toString()
toString
in class Object
public long sizeOf()
sizeOf
in interface MemoryAware
public final SimpleGeometryStyle getStyle()
public final int getVertexCount()
public final FloatBuffer getCoordBuffer()
public FloatBuffer getReadOnlyCoordBuffer()
public boolean useDirectBuffers()
public FloatBuffer getNormalBuffer()
null
if normals are not loaded.public void setCoordPosition(int coordPosition)
coordPosition
- public void setNormPosition(int normalPosition)
normalPosition
- public int getOrdinateCount()
getOrdinateCount
in interface RenderableQualityModelPart
public int getTextureOrdinateCount()
getTextureOrdinateCount
in interface RenderableQualityModelPart
public final int getCoordPosition()
public final int getNormalPosition()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |