org.jzy3d.plot3d.primitives.vbo.drawable
Class DrawableVBO
- java.lang.Object
-
- org.jzy3d.plot3d.primitives.AbstractDrawable
-
- org.jzy3d.plot3d.primitives.vbo.drawable.DrawableVBO
-
- All Implemented Interfaces:
- IGLBindedResource, IGLRenderer, ISortableDraw
- Direct Known Subclasses:
- BarVBO, ScatterVBO
public class DrawableVBO extends AbstractDrawable implements IGLBindedResource
ADrawableVBOis able to efficiently draw a large collection of geometries. The user must provide a loader that will be later called when the GL context requires loading the VBO data in GPU memory. The loader might freely make settings on the drawable as it is called with a reference to theDrawableVBOis will be loading data into. One can separate data and appearance by setting geometry settings out of loading process. DrawableVBO shape1 = new DrawableVBO(new MemoryVBOLoader(getScatter(size))); shape1.setGeometry(GL.GL_POINTS); shape1.setColor(Color.WHITE);
-
-
Constructor Summary
Constructors Constructor and Description DrawableVBO(IGLLoader<DrawableVBO> loader)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidapplyGeometryTransform(Transform transform)voiddoConfigure(int pointer, int size)voiddoConfigure(int pointer, int size, int byteOffset, int normalOffset, int dimensions)voiddoLoadArrayFloatBuffer(com.jogamp.opengl.GL gl, java.nio.FloatBuffer vertices)voiddoLoadArrayFloatBuffer(com.jogamp.opengl.GL gl, int vertexSize, java.nio.FloatBuffer vertices)voiddoLoadElementIntBuffer(com.jogamp.opengl.GL gl, java.nio.IntBuffer indices)voiddoLoadElementIntBuffer(com.jogamp.opengl.GL gl, int indexSize, java.nio.IntBuffer indices)voiddoSetBoundingBox(BoundingBox3d bounds)voiddraw(com.jogamp.opengl.GL gl, com.jogamp.opengl.glu.GLU glu, Camera cam)Call OpenGL2 routines for rendering the object.ColorgetColor()intgetGeometry()QualitygetQuality()floatgetWidth()booleanhasMountedOnce()Return true if mount(...) has been called at least one timebooleanisHasColorBuffer()voidmount(com.jogamp.opengl.GL gl)Mount resources to gl contextRotatorrotator()Rotatorrotator(boolean start)Returns aRotatorthat can let the VBO turn around Z axis centered at X=0,Y=0.voidsetColor(Color color)voidsetData(com.jogamp.opengl.GL2 gl, java.nio.IntBuffer indices, java.nio.FloatBuffer vertices, BoundingBox3d bounds, int pointer)voidsetData(com.jogamp.opengl.GL gl, FloatVBO vbo)To be called by the VBOBuildervoidsetData(com.jogamp.opengl.GL gl, java.nio.IntBuffer indices, java.nio.FloatBuffer vertices, BoundingBox3d bounds)voidsetGeometry(int geometry)Set geometry, use: GL.GL_TRIANGLES (default) ...voidsetHasColorBuffer(boolean hasColorBuffer)voidsetQuality(Quality quality)voidsetWidth(float width)voidupdateBounds()-
Methods inherited from class org.jzy3d.plot3d.primitives.AbstractDrawable
addDrawableListener, dispose, doTransform, getBarycentre, getBoundingBoxColor, getBounds, getDistance, getLegend, getLongestDistance, getShortestDistance, getSpaceTransformer, getTransform, getTransformBefore, hasLegend, isBoundingBoxDisplayed, isDisplayed, isLegendDisplayed, removeDrawableListener, setBoundingBoxColor, setBoundingBoxDisplayed, setDisplayed, setLegend, setLegendDisplayed, setSpaceTransformer, setTransform, setTransformBefore, toString, toString
-
-
-
-
Constructor Detail
-
DrawableVBO
public DrawableVBO(IGLLoader<DrawableVBO> loader)
-
-
Method Detail
-
hasMountedOnce
public boolean hasMountedOnce()
Description copied from interface:IGLBindedResourceReturn true if mount(...) has been called at least one time- Specified by:
hasMountedOncein interfaceIGLBindedResource
-
mount
public void mount(com.jogamp.opengl.GL gl)
Description copied from interface:IGLBindedResourceMount resources to gl context- Specified by:
mountin interfaceIGLBindedResource
-
draw
public void draw(com.jogamp.opengl.GL gl, com.jogamp.opengl.glu.GLU glu, Camera cam)Description copied from class:AbstractDrawableCall OpenGL2 routines for rendering the object.- Specified by:
drawin interfaceIGLRenderer- Specified by:
drawin classAbstractDrawable- Parameters:
gl- GL2 contextglu- GLU contextcam- a reference to a shooting Camera.
-
getWidth
public float getWidth()
-
setWidth
public void setWidth(float width)
-
getQuality
public Quality getQuality()
-
setQuality
public void setQuality(Quality quality)
-
rotator
public Rotator rotator(boolean start)
Returns aRotatorthat can let the VBO turn around Z axis centered at X=0,Y=0. Must be started byRotator.start()if not started explicitely.
-
rotator
public Rotator rotator()
-
isHasColorBuffer
public boolean isHasColorBuffer()
-
setHasColorBuffer
public void setHasColorBuffer(boolean hasColorBuffer)
-
getGeometry
public int getGeometry()
-
setGeometry
public void setGeometry(int geometry)
Set geometry, use: GL.GL_TRIANGLES (default) ...- Parameters:
geometry-
-
applyGeometryTransform
public void applyGeometryTransform(Transform transform)
- Specified by:
applyGeometryTransformin classAbstractDrawable
-
updateBounds
public void updateBounds()
- Specified by:
updateBoundsin classAbstractDrawable
-
setData
public void setData(com.jogamp.opengl.GL gl, FloatVBO vbo)To be called by the VBOBuilder
-
setData
public void setData(com.jogamp.opengl.GL gl, java.nio.IntBuffer indices, java.nio.FloatBuffer vertices, BoundingBox3d bounds)
-
setData
public void setData(com.jogamp.opengl.GL2 gl, java.nio.IntBuffer indices, java.nio.FloatBuffer vertices, BoundingBox3d bounds, int pointer)
-
doConfigure
public void doConfigure(int pointer, int size)
-
doConfigure
public void doConfigure(int pointer, int size, int byteOffset, int normalOffset, int dimensions)
-
doLoadArrayFloatBuffer
public void doLoadArrayFloatBuffer(com.jogamp.opengl.GL gl, java.nio.FloatBuffer vertices)
-
doLoadArrayFloatBuffer
public void doLoadArrayFloatBuffer(com.jogamp.opengl.GL gl, int vertexSize, java.nio.FloatBuffer vertices)
-
doLoadElementIntBuffer
public void doLoadElementIntBuffer(com.jogamp.opengl.GL gl, java.nio.IntBuffer indices)
-
doLoadElementIntBuffer
public void doLoadElementIntBuffer(com.jogamp.opengl.GL gl, int indexSize, java.nio.IntBuffer indices)
-
doSetBoundingBox
public void doSetBoundingBox(BoundingBox3d bounds)
-
getColor
public Color getColor()
-
setColor
public void setColor(Color color)
-
-
DMelt 3.0 © DataMelt by jWork.ORG