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.
Composites have the nice property of being decomposable (see Decomposition),
meaning a scene
invalid @link
Graph
- Author:
- Martin Pernollet
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Colorprotected booleanprotected booleanprotected ColorMapperprotected TransformFields 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, wireframeWithLineLoopFields inherited from class org.jzy3d.plot3d.primitives.Drawable
bbox, boundingBoxColor, boundingBoxDisplayed, displayed, hasListeners, legend, legendDisplayed, listeners, spaceTransformer, transformBefore -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAppend a list of Drawables to this composite.voidAdd a Drawable to this composite.voidvoidapplyGeometryTransform(Transform transform) booleanThis indicate to a scene graph if the Composite consider it is worth being decomposed or not.voidclear()Clear the list of Drawables from this composite.voidDelegate 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.booleanReturn true if mount(...) has been called at least one timebooleanvoidMount resources to gl contextvoidRemove a Drawable from this composite.voidSet 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.voidsetDisplayed(boolean status) Set to true or false the displayed status of this object.voidsetFaceDisplayed(boolean status) Set the face display status to on or off.voidsetMaterialAmbiantReflection(Color materialAmbiantReflection) voidsetMaterialDiffuseReflection(Color materialDiffuseReflection) voidsetMaterialEmission(Color materialEmission) voidsetMaterialShininess(float shininess) voidsetMaterialSpecularReflection(Color materialSpecularReflection) voidsetPolygonOffsetFillEnable(boolean polygonOffsetFillEnable) voidsetPolygonWireframeDepthTrick(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).voidsetReflectLight(boolean reflectLight) If true, drawing this object will set ambient, diffuse, specular and shininess parameters.voidsetSpaceTransformer(SpaceTransformer spaceTransformer) voidsetTransform(Transform transform) Delegate transforming iteratively to all Drawable of this composite and stores the given transform for keeping the ability of retrieving it.voidsetTransformBefore(Transform transform) voidsetWireframeColor(Color color) Set the wireframe color.voidsetWireframeColorFromPolygonPoints(boolean status) 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.toString()Print out information concerning all Drawable of this composite.toString(int depth) voidMethods 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, setPolygonOffsetUnitMethods 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:IGLBindedResourceMount resources to gl context- Specified by:
mountin interfaceIGLBindedResource
-
hasMountedOnce
public boolean hasMountedOnce()Description copied from interface:IGLBindedResourceReturn true if mount(...) has been called at least one time- Specified by:
hasMountedOncein 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:
drawin interfaceIGLRenderer- Specified by:
drawin classDrawable
-
setTransform
Delegate transforming iteratively to all Drawable of this composite and stores the given transform for keeping the ability of retrieving it.- Overrides:
setTransformin classDrawable
-
setTransformBefore
- Overrides:
setTransformBeforein classDrawable
-
setSpaceTransformer
- Overrides:
setSpaceTransformerin classDrawable
-
getTransform
Return the transform that was affected to this composite.- Overrides:
getTransformin classDrawable- Returns:
- transform
-
getBounds
Creates and return a BoundingBox3d that embed all available Drawable bounds. -
updateBounds
public void updateBounds()- Specified by:
updateBoundsin classDrawable
-
applyGeometryTransform
- Specified by:
applyGeometryTransformin classDrawable
-
setWireframeColor
Description copied from class:WireframeableSet the wireframe color.- Overrides:
setWireframeColorin classWireframeable
-
setWireframeColorFromPolygonPoints
public void setWireframeColorFromPolygonPoints(boolean status) - Overrides:
setWireframeColorFromPolygonPointsin classWireframeable
-
setWireframeDisplayed
public void setWireframeDisplayed(boolean status) Description copied from class:WireframeableSet the wireframe display status to on or off.- Overrides:
setWireframeDisplayedin classWireframeable
-
setWireframeWidth
public void setWireframeWidth(float width) Description copied from class:WireframeableSet the wireframe width.- Overrides:
setWireframeWidthin classWireframeable
-
setFaceDisplayed
public void setFaceDisplayed(boolean status) Description copied from class:WireframeableSet the face display status to on or off.- Overrides:
setFaceDisplayedin classWireframeable
-
setDisplayed
public void setDisplayed(boolean status) Description copied from class:DrawableSet to true or false the displayed status of this object.- Overrides:
setDisplayedin classDrawable
-
setPolygonOffsetFillEnable
public void setPolygonOffsetFillEnable(boolean polygonOffsetFillEnable) - Overrides:
setPolygonOffsetFillEnablein classWireframeable- Parameters:
polygonOffsetFillEnable- statuscomposite-
-
setPolygonWireframeDepthTrick
public void setPolygonWireframeDepthTrick(boolean polygonOffsetFillEnable) Description copied from class:WireframeableMay 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:
setPolygonWireframeDepthTrickin classWireframeable
-
setReflectLight
public void setReflectLight(boolean reflectLight) Description copied from class:WireframeableIf 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:
setReflectLightin classWireframeable
-
setMaterialAmbiantReflection
- Overrides:
setMaterialAmbiantReflectionin classWireframeable
-
setMaterialDiffuseReflection
- Overrides:
setMaterialDiffuseReflectionin classWireframeable
-
setMaterialSpecularReflection
- Overrides:
setMaterialSpecularReflectionin classWireframeable
-
setMaterialEmission
- Overrides:
setMaterialEmissionin classWireframeable
-
setMaterialShininess
public void setMaterialShininess(float shininess) - Overrides:
setMaterialShininessin classWireframeable
-
setColorMapper
Description copied from interface:IMultiColorableSet the colormapper that will be used by the Drawable, instead of using precomputed colors.- Specified by:
setColorMapperin interfaceIMultiColorable
-
getColorMapper
Description copied from interface:IMultiColorableGet the colormapper.- Specified by:
getColorMapperin interfaceIMultiColorable
-
setColor
Description copied from interface:ISingleColorableSet the color.- Specified by:
setColorin interfaceISingleColorable- Parameters:
color- the color
-
getColor
Description copied from interface:ISingleColorableGet the color.- Specified by:
getColorin 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.
-