public abstract class VBOBuilder extends Object implements IGLLoader<DrawableVBO>
VBOBuilder
is responsible for sizing a FloatVBO
, filling
it with vertex coordinates and colors properties, and and configure a
DrawableVBO
with filled buffer.
The builder will be called via method load()
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.
A Quality
setting can be given to configure GL properties of the drawable:
Constructor and Description |
---|
VBOBuilder() |
Modifier and Type | Method and Description |
---|---|
protected int |
computeGeometrySize(DrawableVBO drawable) |
protected int |
computeVerticeBufferSize(int type,
int n,
int dim,
int geometrySize,
boolean hasNormal,
boolean hasColor) |
protected void |
fillWithCollection(DrawableVBO drawable,
Collection<Coord3d> coordinates,
ColorMapper colors,
FloatBuffer vertices,
IntBuffer indices,
BoundingBox3d bounds) |
protected void |
fillWithCollection(DrawableVBO drawable,
Collection<Coord3d> coordinates,
FloatBuffer vertices,
IntBuffer indices,
BoundingBox3d bounds) |
protected void |
fillWithCollection(DrawableVBO drawable,
List<Coord3d> coordinates,
FloatVBO vbo) |
protected void |
fillWithCollection(DrawableVBO drawable,
List<Coord3d> coordinates,
FloatVBO vbo,
ColorMapper coloring) |
protected void |
fillWithRandomBar(int n,
DrawableVBO drawable,
FloatBuffer vertices,
IntBuffer indices,
BoundingBox3d bounds,
ColorMapper colors) |
protected void |
fillWithRandomBar(int n,
DrawableVBO drawable,
FloatVBO vbo,
ColorMapper colors) |
protected int |
geometryTypeToMultiplier(int geometrySize) |
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
|
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)
|
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
|
protected void |
putBar(FloatVBO vbo,
int size,
float x,
float y,
float z,
Color color) |
protected void |
putColor(FloatBuffer vertices,
Color color) |
protected void |
putColor(FloatVBO vbo,
Color color) |
protected void |
putCoord(FloatBuffer vertices,
Coord3d c) |
protected void |
putCoord(FloatVBO vbo,
Coord3d c) |
protected void |
putPoint(FloatVBO vbo,
int id,
Color color,
Coord3d coord) |
protected void fillWithCollection(DrawableVBO drawable, Collection<Coord3d> coordinates, ColorMapper colors, FloatBuffer vertices, IntBuffer indices, BoundingBox3d bounds)
protected void fillWithCollection(DrawableVBO drawable, List<Coord3d> coordinates, FloatVBO vbo)
protected void fillWithCollection(DrawableVBO drawable, List<Coord3d> coordinates, FloatVBO vbo, ColorMapper coloring)
protected void fillWithCollection(DrawableVBO drawable, Collection<Coord3d> coordinates, FloatBuffer vertices, IntBuffer indices, BoundingBox3d bounds)
protected void fillWithRandomBar(int n, DrawableVBO drawable, FloatBuffer vertices, IntBuffer indices, BoundingBox3d bounds, ColorMapper colors)
protected void fillWithRandomBar(int n, DrawableVBO drawable, FloatVBO vbo, ColorMapper colors)
protected void putCoord(FloatBuffer vertices, Coord3d c)
protected void putColor(FloatBuffer vertices, Color color)
protected FloatVBO initFloatVBO(DrawableVBO drawable, boolean hasNormal, boolean hasColor, int n, int dimension)
protected int geometryTypeToMultiplier(int geometrySize)
protected FloatVBO initFloatVBO(DrawableVBO drawable, boolean hasNormal, boolean hasColor, int n)
protected FloatVBO initFloatVBO(DrawableVBO drawable, boolean hasColor, int n)
protected int computeVerticeBufferSize(int type, int n, int dim, int geometrySize, boolean hasNormal, boolean hasColor)
protected int computeGeometrySize(DrawableVBO drawable)
Copyright © 2016. All rights reserved.