Class VBOBuilder
- java.lang.Object
-
- org.jzy3d.plot3d.primitives.vbo.builders.VBOBuilder
-
- All Implemented Interfaces:
IGLLoader<DrawableVBO>
- Direct Known Subclasses:
CubeVBOBuilder,ShaderMeshVBOBuilder,ShaderWaterfallVBOBuilder,VBOBuilderListCoord3d
public abstract class VBOBuilder extends Object implements IGLLoader<DrawableVBO>
TheVBOBuilderis responsible for sizing aFloatVBO, filling it with vertex coordinates and colors properties, and configure aDrawableVBOwith filled buffer. The builder will be called via methodload()once GL context is ready to store geometry in GPU for the given DrawableVBO instance. This is where builder actually draw the object by setting coordinates, colors, and rendering parameters. AQualitysetting can be given to configure GL properties of the drawable:- Author:
- Martin Pernollet
-
-
Constructor Summary
Constructors Constructor Description VBOBuilder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected intcomputeGeometrySize(DrawableVBO drawable)protected intcomputeVerticeBufferSize(int type, int n, int dim, int geometrySize, boolean hasNormal, boolean hasColor)protected voidfillWithCollection(DrawableVBO drawable, Collection<Coord3d> coordinates, FloatBuffer vertices, IntBuffer indices, BoundingBox3d bounds)protected voidfillWithCollection(DrawableVBO drawable, Collection<Coord3d> coordinates, ColorMapper colors, FloatBuffer vertices, IntBuffer indices, BoundingBox3d bounds)protected voidfillWithCollection(DrawableVBO drawable, List<Coord3d> coordinates, FloatVBO vbo)protected voidfillWithCollection(DrawableVBO drawable, List<Coord3d> coordinates, FloatVBO vbo, ColorMapper coloring)protected voidfillWithRandomBar(int n, DrawableVBO drawable, FloatBuffer vertices, IntBuffer indices, BoundingBox3d bounds, ColorMapper colors)protected voidfillWithRandomBar(int n, DrawableVBO drawable, FloatVBO vbo, ColorMapper colors)protected intgeometryTypeToMultiplier(int geometrySize)protected FloatVBOinitFloatVBO(DrawableVBO drawable, boolean hasNormal, boolean hasColor, int n)Setup buffers dimensions according to various parameters: target drawable representation type (point, line, etc), having color per vertex or not, having normals defined (default to false) 3 dimensionsprotected FloatVBOinitFloatVBO(DrawableVBO drawable, boolean hasNormal, boolean hasColor, int n, int dimension)Setup buffers dimensions according to various parameters: target drawable representation type (point, line, etc), having color per vertex or not, having normals defined (default to false) number of dimensions (default to 3)protected FloatVBOinitFloatVBO(DrawableVBO drawable, boolean hasColor, int n)Setup buffers dimensions according to various parameters: target drawable representation type (point, line, etc), having color per vertex or not, no normals defined 3 dimensionsprotected voidputBar(FloatVBO vbo, int size, float x, float y, float z, Color color)protected voidputColor(FloatBuffer vertices, Color color)protected voidputColor(FloatVBO vbo, Color color)protected voidputCoord(FloatBuffer vertices, Coord3d c)protected voidputCoord(FloatVBO vbo, Coord3d c)protected voidputPoint(FloatVBO vbo, int id, Color color, Coord3d coord)
-
-
-
Method Detail
-
fillWithCollection
protected void fillWithCollection(DrawableVBO drawable, Collection<Coord3d> coordinates, ColorMapper colors, FloatBuffer vertices, IntBuffer indices, BoundingBox3d bounds)
-
fillWithCollection
protected void fillWithCollection(DrawableVBO drawable, List<Coord3d> coordinates, FloatVBO vbo)
-
fillWithCollection
protected void fillWithCollection(DrawableVBO drawable, List<Coord3d> coordinates, FloatVBO vbo, ColorMapper coloring)
-
fillWithCollection
protected void fillWithCollection(DrawableVBO drawable, Collection<Coord3d> coordinates, FloatBuffer vertices, IntBuffer indices, BoundingBox3d bounds)
-
fillWithRandomBar
protected void fillWithRandomBar(int n, DrawableVBO drawable, FloatBuffer vertices, IntBuffer indices, BoundingBox3d bounds, ColorMapper colors)
-
fillWithRandomBar
protected void fillWithRandomBar(int n, DrawableVBO drawable, FloatVBO vbo, ColorMapper colors)
-
putCoord
protected void putCoord(FloatBuffer vertices, Coord3d c)
-
putColor
protected void putColor(FloatBuffer vertices, Color color)
-
initFloatVBO
protected FloatVBO initFloatVBO(DrawableVBO drawable, boolean hasNormal, boolean hasColor, int n, int dimension)
Setup buffers dimensions according to various parameters:- target drawable representation type (point, line, etc),
- having color per vertex or not,
- having normals defined (default to false)
- number of dimensions (default to 3)
-
geometryTypeToMultiplier
protected int geometryTypeToMultiplier(int geometrySize)
-
initFloatVBO
protected FloatVBO initFloatVBO(DrawableVBO drawable, boolean hasNormal, boolean hasColor, int n)
Setup buffers dimensions according to various parameters:- target drawable representation type (point, line, etc),
- having color per vertex or not,
- having normals defined (default to false)
- 3 dimensions
-
initFloatVBO
protected FloatVBO initFloatVBO(DrawableVBO drawable, boolean hasColor, int n)
Setup buffers dimensions according to various parameters:- target drawable representation type (point, line, etc),
- having color per vertex or not,
- no normals defined
- 3 dimensions
-
computeVerticeBufferSize
protected int computeVerticeBufferSize(int type, int n, int dim, int geometrySize, boolean hasNormal, boolean hasColor)
-
computeGeometrySize
protected int computeGeometrySize(DrawableVBO drawable)
-
-