Class Volume
- java.lang.Object
-
- org.jzy3d.plot3d.primitives.Drawable
-
- org.jzy3d.plot3d.primitives.volume.Volume
-
- All Implemented Interfaces:
IGLBindedResource,IGLRenderer,ISortableDraw
public class Volume extends Drawable implements IGLBindedResource
https://developer.nvidia.com/gpugems/gpugems/part-vi-beyond-triangles/chapter-39-volume-rendering-techniques https://www.codeproject.com/Articles/352270/Getting-Started-with-Volume-Rendering-using-OpenGL https://community.khronos.org/t/volume-rendering-with-3d-textures/73681
-
-
Field Summary
Fields Modifier and Type Field Description protected Bufferbufferprotected booleandisposedprotected booleanmountedprotected int[]shapeprotected inttexIDThe GL texture ID.-
Fields inherited from class org.jzy3d.plot3d.primitives.Drawable
bbox, boundingBoxColor, boundingBoxDisplayed, displayed, hasListeners, legend, legendDisplayed, listeners, spaceTransformer, transform, transformBefore
-
-
Constructor Summary
Constructors Constructor Description Volume(FloatBuffer buffer, int[] shape, BoundingBox3d bbox)Instanciate a drawable volume.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidapplyGeometryTransform(Transform transform)voidbind(com.jogamp.opengl.GL2 gl)voiddispose()Performs all required operation to cleanup the Drawable.voiddraw(IPainter painter)Call OpenGL2 routines for rendering the object.booleanhasMountedOnce()Return true if mount(...) has been called at least one timevoidmount(IPainter painter)Mount resources to gl contextvoidupdateBounds()-
Methods inherited from class org.jzy3d.plot3d.primitives.Drawable
addDrawableListener, asWireframeable, 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 Detail
-
texID
protected int texID
The GL texture ID.
-
buffer
protected Buffer buffer
-
shape
protected int[] shape
-
mounted
protected boolean mounted
-
disposed
protected boolean disposed
-
-
Constructor Detail
-
Volume
public Volume(FloatBuffer buffer, int[] shape, BoundingBox3d bbox)
Instanciate a drawable volume.- Parameters:
buffer- provides (x,y,z,V) tuples where (x,y,z) are voxel index in the volume and V the value used for coloring voxelsshape- a 3 element array indicating the number of voxels for each dimensionmapper- the colormap handler that will apply a colormap to a value rangebbox- the real world range of each axis, since the input buffer provide tuples with index and not coordinates
-
-
Method Detail
-
mount
public void mount(IPainter painter)
Description copied from interface:IGLBindedResourceMount resources to gl context- Specified by:
mountin interfaceIGLBindedResource
-
hasMountedOnce
public boolean hasMountedOnce()
Description copied from interface:IGLBindedResourceReturn true if mount(...) has been called at least one time- Specified by:
hasMountedOncein interfaceIGLBindedResource
-
bind
public void bind(com.jogamp.opengl.GL2 gl) throws com.jogamp.opengl.GLException- Throws:
com.jogamp.opengl.GLException
-
draw
public void draw(IPainter painter)
Description copied from class:DrawableCall OpenGL2 routines for rendering the object.- Specified by:
drawin interfaceIGLRenderer- Specified by:
drawin classDrawable
-
applyGeometryTransform
public void applyGeometryTransform(Transform transform)
- Specified by:
applyGeometryTransformin classDrawable
-
dispose
public void dispose()
Description copied from class:DrawablePerforms all required operation to cleanup the Drawable.
-
updateBounds
public void updateBounds()
- Specified by:
updateBoundsin classDrawable
-
-