public class CompileableComposite extends AbstractWireframeable implements ISingleColorable, IMultiColorable
CompileableComposite allows storage and subsequent faster execution
of individual contained instances drawing routines in an OpenGL display list.
Compiling the object take the time needed to render it as a standard
AbstractComposite, and rendering it once it is compiled seems to take
roughly half the time up to now. Since compilation occurs during a draw(), the first call to draw() is supposed to be 1.5x longer than
a standard AbstractComposite, while all next cycles would be 0.5x
longer.
Compilation occurs when the content or the display attributes of this
Composite changes (then all add(), remove(), setColor(),
setWireFrameDisplayed(), etc). One can also force rebuilding the object by
calling recompile();
IMPORTANT: for the moment, CompileableComposite should not be use in
a charts using a Quality superior to Intermediate, in other word, you
should not desire to have alpha enabled in your scene. Indeed, alpha requires
ordering of polygons each time the viewpoint changes, which would require to
recompile the object.
Unsupported in Android / OpenGL ES| Modifier and Type | Field and Description |
|---|---|
protected Color |
color |
protected List<AbstractDrawable> |
components |
protected boolean |
detailedToString |
protected ColorMapper |
mapper |
facestatus, wfcolor, wfstatus, wfwidthbbox, boundingBoxColor, boundingBoxDisplayed, displayed, hasListeners, legend, legendDisplayed, listeners, spaceTransformer, transform, transformBefore| Constructor and Description |
|---|
CompileableComposite() |
| Modifier and Type | Method and Description |
|---|---|
void |
add(AbstractDrawable drawable)
Add a Drawable to this composite.
|
void |
add(List<? extends AbstractDrawable> drawables)
Append a list of Drawables to this composite.
|
void |
applyGeometryTransform(Transform transform) |
void |
clear()
Clear the list of Drawables from this composite.
|
protected void |
compile(com.jogamp.opengl.GL gl,
com.jogamp.opengl.glu.GLU glu,
Camera cam)
If you call compile, the display list will be regenerated.
|
void |
draw(com.jogamp.opengl.GL gl,
com.jogamp.opengl.glu.GLU glu,
Camera cam)
Reset the object if required, compile the object if it is not compiled,
and execute actual rendering.
|
protected void |
drawComponents(com.jogamp.opengl.GL gl,
com.jogamp.opengl.glu.GLU glu,
Camera cam) |
protected void |
execute(com.jogamp.opengl.GL gl,
com.jogamp.opengl.glu.GLU glu,
Camera cam) |
AbstractDrawable |
get(int p)
Get a Drawable stored by this composite.
|
BoundingBox3d |
getBounds()
Return the BoundingBox of this object.
|
Color |
getColor()
Get the color.
|
ColorMapper |
getColorMapper()
Get the colormapper.
|
List<AbstractDrawable> |
getDrawables() |
boolean |
isDetailedToString() |
protected void |
nullifyChildrenTransforms()
When a drawable has a null transform, no transform is applied at
draw(...).
|
void |
recompile()
Force the object to be rebuilt and stored as a display list at the next
call to draw().
|
void |
remove(AbstractDrawable drawable)
Remove a Drawable from this composite.
|
protected void |
reset(com.jogamp.opengl.GL gl) |
void |
setColor(Color color)
Set the color.
|
void |
setColorMapper(ColorMapper mapper)
Set the colormapper that will be used by the Drawable, instead of using precomputed colors.
|
void |
setDetailedToString(boolean detailedToString)
When to true, the
toString() method will give the detail of each
element of this composite object in a tree like layout. |
void |
setFaceDisplayed(boolean status)
Set the face display status to on or off.
|
void |
setWireframeColor(Color color)
Set the wireframe color.
|
void |
setWireframeDisplayed(boolean status)
Set the wireframe display status to on or off.
|
void |
setWireframeWidth(float width)
Set the wireframe width.
|
int |
size()
Return the number of Drawable stored by this composite.
|
String |
toString()
Print out information concerning all Drawable of this composite.
|
String |
toString(int depth) |
void |
updateBounds() |
getFaceDisplayed, getWireframeColor, getWireframeDisplayed, getWireframeWidthaddDrawableListener, call, call, callWithAlphaFactor, colorGL2, colorGLES2, dispose, doDrawBounds, doTransform, fireDrawableChanged, fireDrawableChanged, getBarycentre, getBoundingBoxColor, getDistance, getLegend, getLongestDistance, getShortestDistance, getSpaceTransformer, getTransform, getTransformBefore, hasLegend, isBoundingBoxDisplayed, isDisplayed, isLegendDisplayed, negative, removeDrawableListener, setBoundingBoxColor, setBoundingBoxDisplayed, setDisplayed, setLegend, setLegendDisplayed, setSpaceTransformer, setTransform, setTransformBefore, vertexGL2, vertexGLES2protected ColorMapper mapper
protected Color color
protected boolean detailedToString
protected List<AbstractDrawable> components
public void recompile()
public void draw(com.jogamp.opengl.GL gl,
com.jogamp.opengl.glu.GLU glu,
Camera cam)
draw in interface IGLRendererdraw in class AbstractDrawablegl - GL2 contextglu - GLU contextcam - a reference to a shooting Camera.protected void compile(com.jogamp.opengl.GL gl,
com.jogamp.opengl.glu.GLU glu,
Camera cam)
protected void execute(com.jogamp.opengl.GL gl,
com.jogamp.opengl.glu.GLU glu,
Camera cam)
protected void reset(com.jogamp.opengl.GL gl)
protected void nullifyChildrenTransforms()
protected void drawComponents(com.jogamp.opengl.GL gl,
com.jogamp.opengl.glu.GLU glu,
Camera cam)
public void applyGeometryTransform(Transform transform)
applyGeometryTransform in class AbstractDrawablepublic BoundingBox3d getBounds()
AbstractDrawablegetBounds in class AbstractDrawablepublic void updateBounds()
updateBounds in class AbstractDrawablepublic void add(List<? extends AbstractDrawable> drawables)
public void clear()
public void add(AbstractDrawable drawable)
public void remove(AbstractDrawable drawable)
public AbstractDrawable get(int p)
public List<AbstractDrawable> getDrawables()
public int size()
public void setWireframeColor(Color color)
AbstractWireframeablesetWireframeColor in class AbstractWireframeablepublic void setWireframeDisplayed(boolean status)
AbstractWireframeablesetWireframeDisplayed in class AbstractWireframeablepublic void setWireframeWidth(float width)
AbstractWireframeablesetWireframeWidth in class AbstractWireframeablepublic void setFaceDisplayed(boolean status)
AbstractWireframeablesetFaceDisplayed in class AbstractWireframeablepublic void setColorMapper(ColorMapper mapper)
IMultiColorablesetColorMapper in interface IMultiColorablepublic ColorMapper getColorMapper()
IMultiColorablegetColorMapper in interface IMultiColorablepublic void setColor(Color color)
ISingleColorablesetColor in interface ISingleColorablecolor - the colorpublic Color getColor()
ISingleColorablegetColor in interface ISingleColorablepublic String toString()
toString in class AbstractDrawablepublic String toString(int depth)
toString in class AbstractDrawablepublic boolean isDetailedToString()
public void setDetailedToString(boolean detailedToString)
toString() method will give the detail of each
element of this composite object in a tree like layout.Copyright © 2016. All rights reserved.