org.jzy3d.plot3d.primitives
Class CompileableComposite
- java.lang.Object
-
- org.jzy3d.plot3d.primitives.AbstractDrawable
-
- org.jzy3d.plot3d.primitives.AbstractWireframeable
-
- org.jzy3d.plot3d.primitives.CompileableComposite
-
- All Implemented Interfaces:
- IMultiColorable, ISingleColorable, IGLRenderer, ISortableDraw
public class CompileableComposite extends AbstractWireframeable implements ISingleColorable, IMultiColorable
ACompileableCompositeallows 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 standardAbstractComposite, and rendering it once it is compiled seems to take roughly half the time up to now. Since compilation occurs during adraw(), the first call todraw()is supposed to be 1.5x longer than a standardAbstractComposite, 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,CompileableCompositeshould not be use in a charts using aQualitysuperior 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
-
-
Constructor Summary
Constructors Constructor and Description CompileableComposite()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidadd(AbstractDrawable drawable)Add a Drawable to this composite.voidadd(java.util.List<? extends AbstractDrawable> drawables)Append a list of Drawables to this composite.voidapplyGeometryTransform(Transform transform)voidclear()Clear the list of Drawables from this composite.voiddraw(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.AbstractDrawableget(int p)Get a Drawable stored by this composite.BoundingBox3dgetBounds()Return the BoundingBox of this object.ColorgetColor()Get the color.ColorMappergetColorMapper()Get the colormapper.java.util.List<AbstractDrawable>getDrawables()booleanisDetailedToString()voidrecompile()Force the object to be rebuilt and stored as a display list at the next call to draw().voidremove(AbstractDrawable drawable)Remove a Drawable from this composite.voidsetColor(Color color)Set the color.voidsetColorMapper(ColorMapper mapper)Set the colormapper that will be used by the Drawable, instead of using precomputed colors.voidsetDetailedToString(boolean detailedToString)When to true, thetoString()method will give the detail of each element of this composite object in a tree like layout.voidsetFaceDisplayed(boolean status)Set the face display status to on or off.voidsetWireframeColor(Color color)Set the wireframe color.voidsetWireframeDisplayed(boolean status)Set the wireframe display status to on or off.voidsetWireframeWidth(float width)Set the wireframe width.intsize()Return the number of Drawable stored by this composite.java.lang.StringtoString()Print out information concerning all Drawable of this composite.java.lang.StringtoString(int depth)voidupdateBounds()-
Methods inherited from class org.jzy3d.plot3d.primitives.AbstractWireframeable
getFaceDisplayed, getWireframeColor, getWireframeDisplayed, getWireframeWidth
-
Methods inherited from class org.jzy3d.plot3d.primitives.AbstractDrawable
addDrawableListener, dispose, doTransform, getBarycentre, getBoundingBoxColor, getDistance, getLegend, getLongestDistance, getShortestDistance, getSpaceTransformer, getTransform, getTransformBefore, hasLegend, isBoundingBoxDisplayed, isDisplayed, isLegendDisplayed, removeDrawableListener, setBoundingBoxColor, setBoundingBoxDisplayed, setDisplayed, setLegend, setLegendDisplayed, setSpaceTransformer, setTransform, setTransformBefore
-
-
-
-
Method Detail
-
recompile
public void recompile()
Force the object to be rebuilt and stored as a display list at the next call to draw().
-
draw
public 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.- Specified by:
drawin interfaceIGLRenderer- Specified by:
drawin classAbstractDrawable- Parameters:
gl- GL2 contextglu- GLU contextcam- a reference to a shooting Camera.
-
applyGeometryTransform
public void applyGeometryTransform(Transform transform)
- Specified by:
applyGeometryTransformin classAbstractDrawable
-
getBounds
public BoundingBox3d getBounds()
Description copied from class:AbstractDrawableReturn the BoundingBox of this object.- Overrides:
getBoundsin classAbstractDrawable- Returns:
- a bounding box
-
updateBounds
public void updateBounds()
- Specified by:
updateBoundsin classAbstractDrawable
-
add
public void add(java.util.List<? extends AbstractDrawable> drawables)
Append a list of Drawables to this composite.
-
clear
public void clear()
Clear the list of Drawables from this composite.
-
add
public void add(AbstractDrawable drawable)
Add a Drawable to this composite.
-
remove
public void remove(AbstractDrawable drawable)
Remove a Drawable from this composite.
-
get
public AbstractDrawable get(int p)
Get a Drawable stored by this composite.
-
getDrawables
public java.util.List<AbstractDrawable> getDrawables()
-
size
public int size()
Return the number of Drawable stored by this composite.
-
setWireframeColor
public void setWireframeColor(Color color)
Description copied from class:AbstractWireframeableSet the wireframe color.- Overrides:
setWireframeColorin classAbstractWireframeable
-
setWireframeDisplayed
public void setWireframeDisplayed(boolean status)
Description copied from class:AbstractWireframeableSet the wireframe display status to on or off.- Overrides:
setWireframeDisplayedin classAbstractWireframeable
-
setWireframeWidth
public void setWireframeWidth(float width)
Description copied from class:AbstractWireframeableSet the wireframe width.- Overrides:
setWireframeWidthin classAbstractWireframeable
-
setFaceDisplayed
public void setFaceDisplayed(boolean status)
Description copied from class:AbstractWireframeableSet the face display status to on or off.- Overrides:
setFaceDisplayedin classAbstractWireframeable
-
setColorMapper
public void setColorMapper(ColorMapper mapper)
Description copied from interface:IMultiColorableSet the colormapper that will be used by the Drawable, instead of using precomputed colors.- Specified by:
setColorMapperin interfaceIMultiColorable
-
getColorMapper
public ColorMapper getColorMapper()
Description copied from interface:IMultiColorableGet the colormapper.- Specified by:
getColorMapperin interfaceIMultiColorable
-
setColor
public void setColor(Color color)
Description copied from interface:ISingleColorableSet the color.- Specified by:
setColorin interfaceISingleColorable- Parameters:
color- the color
-
getColor
public Color getColor()
Description copied from interface:ISingleColorableGet the color.- Specified by:
getColorin interfaceISingleColorable- Returns:
- color the color.
-
toString
public java.lang.String toString()
Print out information concerning all Drawable of this composite.- Overrides:
toStringin classAbstractDrawable
-
toString
public java.lang.String toString(int depth)
- Overrides:
toStringin classAbstractDrawable
-
isDetailedToString
public boolean isDetailedToString()
-
setDetailedToString
public void setDetailedToString(boolean detailedToString)
When to true, thetoString()method will give the detail of each element of this composite object in a tree like layout.
-
-
DMelt 3.0 © DataMelt by jWork.ORG