Class DrawableVBO
java.lang.Object
org.jzy3d.plot3d.primitives.Drawable
org.jzy3d.plot3d.primitives.vbo.drawable.DrawableVBO
- All Implemented Interfaces:
IGLBindedResource, IGLRenderer, ISortableDraw
- Direct Known Subclasses:
BarVBO, CubeVBO, PolygonVBO, ScatterVBO, ShaderMeshDrawableVBO, ShaderWaterfallDrawableVBO, SphereVBO, TriangleStripVBO, TriangleVBO
A
DrawableVBO is 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 the
DrawableVBO is 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(GLConstants.GL_POINTS); shape1.setColor(Color.WHITE);- Author:
- Martin Pernollet
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected int[]protected intprotected Colorprotected intprotected intprotected int[]protected intprotected booleanprotected IGLLoader<DrawableVBO> protected intprotected intprotected PolygonModeprotected floatprotected booleanprotected floatprotected Qualityprotected intprotected floatFields inherited from class Drawable
bbox, boundingBoxColor, boundingBoxDisplayed, displayed, hasListeners, legend, legendDisplayed, listeners, spaceTransformer, transform, transformBefore -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidapplyGeometryTransform(Transform transform) protected voidapplyPolygonModeFillGL2(IPainter painter) protected voidapplyQuality(IPainter painter) protected voidapplyVertices(IPainter painter) protected voidapplyWidth(IPainter painter) protected voidprotected voidprotected voidprotected voiddisableColor(IPainter painter) protected voidvoiddoConfigure(int pointer, int size) voiddoConfigure(int pointer, int size, int byteOffset, int normalOffset, int dimensions) protected voiddoDrawElements(IPainter painter) voiddoLoadArrayFloatBuffer(IPainter painter, int vertexSize, FloatBuffer vertices) voiddoLoadArrayFloatBuffer(IPainter painter, FloatBuffer vertices) voiddoLoadElementIntBuffer(IPainter painter, int indexSize, IntBuffer indices) voiddoLoadElementIntBuffer(IPainter painter, IntBuffer indices) voiddoSetBoundingBox(BoundingBox3d bounds) voidCall OpenGL2 routines for rendering the object.protected voidgetColor()intfloatfloatfloatgetWidth()booleanReturn true if mount(...) has been called at least one timebooleanbooleanvoidMount resources to gl contextprotected voidprotected voidpolygonOffseFillEnable(IPainter painter) protected voidpolygonOffsetFillDisable(IPainter painter) rotator()rotator(boolean start) Returns aRotatorthat can let the VBO turn around Z axis centered at X=0,Y=0.voidvoidsetData(IPainter painter, IntBuffer indices, FloatBuffer vertices, BoundingBox3d bounds) voidsetData(IPainter painter, IntBuffer indices, FloatBuffer vertices, BoundingBox3d bounds, int pointer) voidTo be called by the VBOBuildervoidsetGeometry(int geometry) Set geometry, use: GLConstants.GL_TRIANGLES (default) ...voidsetHasColorBuffer(boolean hasColorBuffer) voidsetPolygonMode(PolygonMode polygonMode) A null polygonMode imply no any call to painter.glPolygonMode(...) at renderingvoidsetPolygonOffsetFactor(float polygonOffsetFactor) voidsetPolygonOffsetFillEnable(boolean polygonOffsetFillEnable) voidsetPolygonOffsetUnit(float polygonOffsetUnit) voidsetQuality(Quality quality) voidsetWidth(float width) voidMethods inherited from class Drawable
addDrawableListener, asWireframeable, dispose, doDrawBoundsIfDisplayed, doTransform, fireDrawableChanged, fireDrawableChanged, 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
-
Field Details
-
geometry
protected int geometry -
width
protected float width -
quality
-
colorChannelNumber
protected int colorChannelNumber -
polygonMode
-
byteOffset
protected int byteOffset -
normalOffset
protected int normalOffset -
dimensions
protected int dimensions -
size
protected int size -
pointer
protected int pointer -
arrayName
protected int[] arrayName -
elementName
protected int[] elementName -
hasMountedOnce
protected boolean hasMountedOnce -
color
-
polygonOffsetFillEnable
protected boolean polygonOffsetFillEnable -
polygonOffsetFactor
protected float polygonOffsetFactor -
polygonOffsetUnit
protected float polygonOffsetUnit -
loader
-
-
Constructor Details
-
DrawableVBO
-
-
Method Details
-
hasMountedOnce
public boolean hasMountedOnce()Description copied from interface:IGLBindedResourceReturn true if mount(...) has been called at least one time- Specified by:
hasMountedOncein interfaceIGLBindedResource
-
mount
Description copied from interface:IGLBindedResourceMount resources to gl context- Specified by:
mountin interfaceIGLBindedResource
-
draw
-
getWidth
public float getWidth() -
setWidth
public void setWidth(float width) -
getQuality
-
setQuality
-
doDrawElements
-
disableColor
-
pointers
-
color
-
enable
-
disable
-
applyVertices
-
applyWidth
-
applyQuality
-
applyPolygonModeFillGL2
-
polygonOffseFillEnable
-
polygonOffsetFillDisable
-
doBindGL2
-
rotator
-
rotator
-
rotator
-
configure
-
isHasColorBuffer
public boolean isHasColorBuffer() -
setHasColorBuffer
public void setHasColorBuffer(boolean hasColorBuffer) -
getGeometry
public int getGeometry() -
setGeometry
public void setGeometry(int geometry) Set geometry, use: GLConstants.GL_TRIANGLES (default) ...- Parameters:
geometry-
-
applyGeometryTransform
- Specified by:
applyGeometryTransformin classDrawable
-
updateBounds
public void updateBounds()- Specified by:
updateBoundsin classDrawable
-
setData
-
setData
public void setData(IPainter painter, IntBuffer indices, FloatBuffer vertices, BoundingBox3d bounds) -
setData
public void setData(IPainter painter, IntBuffer indices, 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
-
doLoadArrayFloatBuffer
-
doLoadElementIntBuffer
-
doLoadElementIntBuffer
-
doSetBoundingBox
-
getPolygonMode
-
setPolygonMode
A null polygonMode imply no any call to painter.glPolygonMode(...) at rendering -
isPolygonOffsetFillEnable
public boolean isPolygonOffsetFillEnable() -
setPolygonOffsetFillEnable
public void setPolygonOffsetFillEnable(boolean polygonOffsetFillEnable) -
getPolygonOffsetFactor
public float getPolygonOffsetFactor() -
setPolygonOffsetFactor
public void setPolygonOffsetFactor(float polygonOffsetFactor) -
getPolygonOffsetUnit
public float getPolygonOffsetUnit() -
setPolygonOffsetUnit
public void setPolygonOffsetUnit(float polygonOffsetUnit) -
getColor
-
setColor
-