Package org.jzy3d.plot3d.primitives
Class Composite
java.lang.Object
org.jzy3d.plot3d.primitives.Drawable
org.jzy3d.plot3d.primitives.Wireframeable
org.jzy3d.plot3d.primitives.Composite
- All Implemented Interfaces:
IMultiColorable
,ISingleColorable
,IGLBindedResource
,IGLRenderer
,ISortableDraw
- Direct Known Subclasses:
Arrow
,BarycenterAnnotation
,Cone
,ContourLevel
,CubeComposite
,Cylinder
,EnlightableBar
,FlatLine2d
,HistogramBar
,LineStripInterpolated
,ParallelepipedComposite
,Shape
,TesselatedPolygon
,TexturedCube
,TexturedCylinder
public class Composite
extends Wireframeable
implements ISingleColorable, IMultiColorable, IGLBindedResource
A
can take all items independently to sort them for optimized
translucency rendering.
Composite
gathers several Drawable
and provides default methods managing them
all in one call : drawing, getting bounds, setting face or wireframe colors, etc.
Composite
s have the nice property of being decomposable (see Decomposition
),
meaning a scene
invalid @link
Graph
- Author:
- Martin Pernollet
-
Field Summary
Modifier and TypeFieldDescriptionprotected Color
protected boolean
protected boolean
protected ColorMapper
protected Transform
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, transformBefore
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Append a list of Drawables to this composite.void
Add a Drawable to this composite.void
void
applyGeometryTransform
(Transform transform) boolean
This indicate to a scene graph if the Composite consider it is worth being decomposed or not.void
clear()
Clear the list of Drawables from this composite.void
Delegate rendering iteratively to all Drawable of this composite.get
(int p) Get a Drawable stored by this composite.Creates and return a BoundingBox3d that embed all available Drawable bounds.getColor()
Get the color.Get the colormapper.Return the transform that was affected to this composite.boolean
Return true if mount(...) has been called at least one timeboolean
void
Mount resources to gl contextvoid
Remove a Drawable from this composite.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
setDisplayed
(boolean status) Set to true or false the displayed status of this object.void
setFaceDisplayed
(boolean status) Set the face display status to on or off.void
setMaterialAmbiantReflection
(Color materialAmbiantReflection) void
setMaterialDiffuseReflection
(Color materialDiffuseReflection) void
setMaterialEmission
(Color materialEmission) void
setMaterialShininess
(float shininess) void
setMaterialSpecularReflection
(Color materialSpecularReflection) void
setPolygonOffsetFillEnable
(boolean polygonOffsetFillEnable) void
setPolygonWireframeDepthTrick
(boolean polygonOffsetFillEnable) May be used as alternative toWireframeable.setPolygonOffsetFillEnable(boolean)
in case it is not supported by underlying OpenGL version (Polygon offset appears as off version 2).void
setReflectLight
(boolean reflectLight) If true, drawing this object will set ambient, diffuse, specular and shininess parameters.void
setSpaceTransformer
(SpaceTransformer spaceTransformer) void
setTransform
(Transform transform) Delegate transforming iteratively to all Drawable of this composite and stores the given transform for keeping the ability of retrieving it.void
setTransformBefore
(Transform transform) void
setWireframeColor
(Color color) Set the wireframe color.void
setWireframeColorFromPolygonPoints
(boolean status) 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, setPolygonOffsetFactor, setPolygonOffsetUnit
Methods inherited from class org.jzy3d.plot3d.primitives.Drawable
addDrawableListener, asWireframeable, dispose, doTransform, fireDrawableChanged, fireDrawableChanged, getBarycentre, getBoundingBoxColor, getDistance, getLegend, getLongestDistance, getShortestDistance, getSpaceTransformer, getTransformBefore, hasLegend, isBoundingBoxDisplayed, isDisplayed, isLegendDisplayed, removeDrawableListener, setBoundingBoxColor, setBoundingBoxDisplayed, setLegend, setLegendDisplayed
-
Field Details
-
hasMountedOnce
protected boolean hasMountedOnce -
components
-
transform
-
mapper
-
color
-
detailedToString
protected boolean detailedToString
-
-
Constructor Details
-
Composite
public Composite() -
Composite
-
Composite
-
-
Method Details
-
canDecompose
public boolean canDecompose()This indicate to a scene graph if the Composite consider it is worth being decomposed or not.- Returns:
- will return true only if the Composite has face displayed (simply because decomposing wireframe-only drawable is useless)
-
mount
Description copied from interface:IGLBindedResource
Mount resources to gl context- Specified by:
mount
in interfaceIGLBindedResource
-
hasMountedOnce
public boolean hasMountedOnce()Description copied from interface:IGLBindedResource
Return true if mount(...) has been called at least one time- Specified by:
hasMountedOnce
in interfaceIGLBindedResource
-
add
Append a list of Drawables to this composite. -
add
-
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. -
draw
Delegate rendering iteratively to all Drawable of this composite.- Specified by:
draw
in interfaceIGLRenderer
- Specified by:
draw
in classDrawable
-
setTransform
Delegate transforming iteratively to all Drawable of this composite and stores the given transform for keeping the ability of retrieving it.- Overrides:
setTransform
in classDrawable
-
setTransformBefore
- Overrides:
setTransformBefore
in classDrawable
-
setSpaceTransformer
- Overrides:
setSpaceTransformer
in classDrawable
-
getTransform
Return the transform that was affected to this composite.- Overrides:
getTransform
in classDrawable
- Returns:
- transform
-
getBounds
Creates and return a BoundingBox3d that embed all available Drawable bounds. -
updateBounds
public void updateBounds()- Specified by:
updateBounds
in classDrawable
-
applyGeometryTransform
- Specified by:
applyGeometryTransform
in classDrawable
-
setWireframeColor
Description copied from class:Wireframeable
Set the wireframe color.- Overrides:
setWireframeColor
in classWireframeable
-
setWireframeColorFromPolygonPoints
public void setWireframeColorFromPolygonPoints(boolean status) - Overrides:
setWireframeColorFromPolygonPoints
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
-
setDisplayed
public void setDisplayed(boolean status) Description copied from class:Drawable
Set to true or false the displayed status of this object.- Overrides:
setDisplayed
in classDrawable
-
setPolygonOffsetFillEnable
public void setPolygonOffsetFillEnable(boolean polygonOffsetFillEnable) - Overrides:
setPolygonOffsetFillEnable
in classWireframeable
- Parameters:
polygonOffsetFillEnable
- statuscomposite
-
-
setPolygonWireframeDepthTrick
public void setPolygonWireframeDepthTrick(boolean polygonOffsetFillEnable) Description copied from class:Wireframeable
May be used as alternative toWireframeable.setPolygonOffsetFillEnable(boolean)
in case it is not supported by underlying OpenGL version (Polygon offset appears as off version 2).- Overrides:
setPolygonWireframeDepthTrick
in classWireframeable
-
setReflectLight
public void setReflectLight(boolean reflectLight) Description copied from class:Wireframeable
If true, drawing this object will set ambient, diffuse, specular and shininess parameters. If the drawable has no normal defined, then the normal will be automatically processed.- Overrides:
setReflectLight
in classWireframeable
-
setMaterialAmbiantReflection
- Overrides:
setMaterialAmbiantReflection
in classWireframeable
-
setMaterialDiffuseReflection
- Overrides:
setMaterialDiffuseReflection
in classWireframeable
-
setMaterialSpecularReflection
- Overrides:
setMaterialSpecularReflection
in classWireframeable
-
setMaterialEmission
- Overrides:
setMaterialEmission
in classWireframeable
-
setMaterialShininess
public void setMaterialShininess(float shininess) - Overrides:
setMaterialShininess
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.
-