Package org.jzy3d.plot3d.primitives
Class CompileableComposite
java.lang.Object
org.jzy3d.plot3d.primitives.Drawable
org.jzy3d.plot3d.primitives.Wireframeable
org.jzy3d.plot3d.primitives.CompileableComposite
- All Implemented Interfaces:
IMultiColorable
,ISingleColorable
,IGLRenderer
,ISortableDraw
public class CompileableComposite
extends Wireframeable
implements ISingleColorable, IMultiColorable
A
, the first call to
is supposed to be 1.5x longer
than a standard
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 Composite
, and
rendering it once it is compiled seems to take roughly half the time up to now. Since compilation
occurs during a
invalid @link
draw()
invalid @link
draw()
Composite
, 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- Author:
- Nils Hoffmann
-
Field Summary
Fields inherited from class org.jzy3d.plot3d.primitives.Wireframeable
depthFunctionChangeForWireframe, faceDisplayed, materialAmbiantReflection, materialDiffuseReflection, materialEmission, materialShininess, materialSpecularReflection, NO_OVERLAP_DEPTH_RATIO, polygonOffsetFactor, polygonOffsetFillEnable, polygonOffsetUnit, polygonWireframeDepthTrick, reflectLight, wireframeColor, wireframeColorFromPolygonPoints, wireframeDisplayed, wireframeWidth, wireframeWithLineLoop
Fields inherited from class org.jzy3d.plot3d.primitives.Drawable
bbox, boundingBoxColor, boundingBoxDisplayed, displayed, hasListeners, legend, legendDisplayed, listeners, spaceTransformer, transform, transformBefore
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Append a list of Drawables to this composite.void
Add a Drawable to this composite.void
applyGeometryTransform
(Transform transform) void
clear()
Clear the list of Drawables from this composite.protected void
If you call compile, the display list will be regenerated.void
Reset the object if required, compile the object if it is not compiled, and execute actual rendering.protected void
drawComponents
(IPainter painter) protected void
get
(int p) Get a Drawable stored by this composite.Return the BoundingBox of this object.getColor()
Get the color.Get the colormapper.boolean
protected void
When a drawable has a null transform, no transform is applied at draw(...).void
Force the object to be rebuilt and stored as a display list at the next call to draw().void
Remove a Drawable from this composite.protected void
void
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, thetoString()
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.toString()
Print out information concerning all Drawable of this composite.toString
(int depth) void
Methods inherited from class org.jzy3d.plot3d.primitives.Wireframeable
applyDepthRangeDefault, applyDepthRangeForOverlying, applyDepthRangeForUnderlying, applyMaterial, doDrawBoundsIfDisplayed, getMaterialAmbiantReflection, getMaterialDiffuseReflection, getMaterialEmission, getMaterialShininess, getMaterialSpecularReflection, getPolygonOffsetFactor, getPolygonOffsetUnit, getWireframeColor, getWireframeWidth, isFaceDisplayed, isPolygonOffsetFillEnable, isPolygonWireframeDepthTrick, isReflectLight, isWireframeColorFromPolygonPoints, isWireframeDisplayed, polygonOffsetFillDisable, polygonOffsetFillEnable, polygonOffsetLineDisable, polygonOffsetLineEnable, setMaterialAmbiantReflection, setMaterialDiffuseReflection, setMaterialEmission, setMaterialShininess, setMaterialSpecularReflection, setPolygonOffsetFactor, setPolygonOffsetFillEnable, setPolygonOffsetUnit, setPolygonWireframeDepthTrick, setReflectLight, setWireframeColorFromPolygonPoints
Methods inherited from class org.jzy3d.plot3d.primitives.Drawable
addDrawableListener, asWireframeable, dispose, doTransform, fireDrawableChanged, fireDrawableChanged, getBarycentre, getBoundingBoxColor, getDistance, getLegend, getLongestDistance, getShortestDistance, getSpaceTransformer, getTransform, getTransformBefore, hasLegend, isBoundingBoxDisplayed, isDisplayed, isLegendDisplayed, removeDrawableListener, setBoundingBoxColor, setBoundingBoxDisplayed, setDisplayed, setLegend, setLegendDisplayed, setSpaceTransformer, setTransform, setTransformBefore
-
Field Details
-
mapper
-
color
-
detailedToString
protected boolean detailedToString -
components
-
-
Constructor Details
-
CompileableComposite
public CompileableComposite()
-
-
Method Details
-
recompile
public void recompile()Force the object to be rebuilt and stored as a display list at the next call to draw(). -
draw
Reset the object if required, compile the object if it is not compiled, and execute actual rendering.- Specified by:
draw
in interfaceIGLRenderer
- Specified by:
draw
in classDrawable
-
compile
If you call compile, the display list will be regenerated.- Parameters:
painter
- TODO
-
execute
-
reset
-
nullifyChildrenTransforms
protected void nullifyChildrenTransforms()When a drawable has a null transform, no transform is applied at draw(...). -
drawComponents
-
applyGeometryTransform
- Specified by:
applyGeometryTransform
in classDrawable
-
getBounds
Description copied from class:Drawable
Return the BoundingBox of this object. -
updateBounds
public void updateBounds()- Specified by:
updateBounds
in classDrawable
-
add
Append a list of Drawables to this composite. -
clear
public void clear()Clear the list of Drawables from this composite. -
add
Add a Drawable to this composite. -
remove
Remove a Drawable from this composite. -
get
Get a Drawable stored by this composite. -
getDrawables
-
size
public int size()Return the number of Drawable stored by this composite. -
setWireframeColor
Description copied from class:Wireframeable
Set the wireframe color.- Overrides:
setWireframeColor
in classWireframeable
-
setWireframeDisplayed
public void setWireframeDisplayed(boolean status) Description copied from class:Wireframeable
Set the wireframe display status to on or off.- Overrides:
setWireframeDisplayed
in classWireframeable
-
setWireframeWidth
public void setWireframeWidth(float width) Description copied from class:Wireframeable
Set the wireframe width.- Overrides:
setWireframeWidth
in classWireframeable
-
setFaceDisplayed
public void setFaceDisplayed(boolean status) Description copied from class:Wireframeable
Set the face display status to on or off.- Overrides:
setFaceDisplayed
in classWireframeable
-
setColorMapper
Description copied from interface:IMultiColorable
Set the colormapper that will be used by the Drawable, instead of using precomputed colors.- Specified by:
setColorMapper
in interfaceIMultiColorable
-
getColorMapper
Description copied from interface:IMultiColorable
Get the colormapper.- Specified by:
getColorMapper
in interfaceIMultiColorable
-
setColor
Description copied from interface:ISingleColorable
Set the color.- Specified by:
setColor
in interfaceISingleColorable
- Parameters:
color
- the color
-
getColor
Description copied from interface:ISingleColorable
Get the color.- Specified by:
getColor
in interfaceISingleColorable
- Returns:
- color the color.
-
toString
Print out information concerning all Drawable of this composite. -
toString
-
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.
-