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,IGLRenderer,ISortableDraw
- Direct Known Subclasses:
BarycenterAnnotation,ContourLevel,CubeComposite,Cylinder,EnlightableBar,FlatLine2d,HistogramBar,LineStripInterpolated,ParallelepipedComposite,Shape,TesselatedPolygon,TexturedCube,TexturedCylinder
public abstract class Composite extends Wireframeable implements ISingleColorable, IMultiColorable
ACompositegathers severalDrawableand 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 (seeDecomposition), meaning a sceneGraphcan take all items independently to sort them for optimized translucency rendering.- Author:
- Martin Pernollet
-
-
Field Summary
Fields Modifier and Type Field Description protected Colorcolorprotected List<Drawable>componentsprotected booleandetailedToStringprotected ColorMappermapperprotected Transformtransform-
Fields inherited from class org.jzy3d.plot3d.primitives.Wireframeable
faceDisplayed, polygonOffsetFactor, polygonOffsetFillEnable, polygonOffsetUnit, polygonWireframeDepthTrick, wireframeColor, wireframeColorFromPolygonPoints, wireframeDisplayed, wireframeWidth
-
Fields inherited from class org.jzy3d.plot3d.primitives.Drawable
bbox, boundingBoxColor, boundingBoxDisplayed, displayed, hasListeners, legend, legendDisplayed, listeners, spaceTransformer, transformBefore
-
-
Constructor Summary
Constructors Constructor Description Composite()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(List<? extends Drawable> drawables)Append a list of Drawables to this composite.voidadd(Drawable drawable)Add a Drawable to this composite.voidapplyGeometryTransform(Transform transform)voidclear()Clear the list of Drawables from this composite.voiddraw(IPainter painter)Delegate rendering iteratively to all Drawable of this composite.Drawableget(int p)Get a Drawable stored by this composite.BoundingBox3dgetBounds()Creates and return a BoundingBox3d that embed all available Drawable bounds.ColorgetColor()Get the color.ColorMappergetColorMapper()Get the colormapper.List<Drawable>getDrawables()TransformgetTransform()Return the transform that was affected to this composite.booleanisDetailedToString()voidremove(Drawable 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.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.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).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.StringtoString()Print out information concerning all Drawable of this composite.StringtoString(int depth)voidupdateBounds()-
Methods inherited from class org.jzy3d.plot3d.primitives.Wireframeable
applyDepthRangeForOverlying, applyDepthRangeForUnderlying, getFaceDisplayed, getPolygonOffsetFactor, getPolygonOffsetUnit, getWireframeColor, getWireframeDisplayed, getWireframeWidth, isPolygonOffsetFillEnable, isPolygonWireframeDepthTrick, isWireframeColorFromPolygonPoints, polygonOffseFillEnable, polygonOffsetFillDisable, polygonOffsetLineDisable, polygonOffsetLineEnable, setPolygonOffsetFactor, setPolygonOffsetUnit
-
Methods inherited from class org.jzy3d.plot3d.primitives.Drawable
addDrawableListener, dispose, doDrawBoundsIfDisplayed, doTransform, fireDrawableChanged, fireDrawableChanged, getBarycentre, getBoundingBoxColor, getDistance, getLegend, getLongestDistance, getShortestDistance, getSpaceTransformer, getTransformBefore, hasLegend, isBoundingBoxDisplayed, isDisplayed, isLegendDisplayed, negative, removeDrawableListener, setBoundingBoxColor, setBoundingBoxDisplayed, setLegend, setLegendDisplayed
-
-
-
-
Field Detail
-
transform
protected Transform transform
-
mapper
protected ColorMapper mapper
-
color
protected Color color
-
detailedToString
protected boolean detailedToString
-
-
Method Detail
-
add
public void add(List<? extends Drawable> 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(Drawable drawable)
Add a Drawable to this composite.
-
remove
public void remove(Drawable drawable)
Remove a Drawable from this composite.
-
get
public Drawable get(int p)
Get a Drawable stored by this composite.
-
size
public int size()
Return the number of Drawable stored by this composite.
-
draw
public void draw(IPainter painter)
Delegate rendering iteratively to all Drawable of this composite.- Specified by:
drawin interfaceIGLRenderer- Specified by:
drawin classDrawable
-
setTransform
public 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.- Overrides:
setTransformin classDrawable
-
setTransformBefore
public void setTransformBefore(Transform transform)
- Overrides:
setTransformBeforein classDrawable
-
setSpaceTransformer
public void setSpaceTransformer(SpaceTransformer spaceTransformer)
- Overrides:
setSpaceTransformerin classDrawable
-
getTransform
public Transform getTransform()
Return the transform that was affected to this composite.- Overrides:
getTransformin classDrawable- Returns:
- transform
-
getBounds
public BoundingBox3d getBounds()
Creates and return a BoundingBox3d that embed all available Drawable bounds.
-
updateBounds
public void updateBounds()
- Specified by:
updateBoundsin classDrawable
-
applyGeometryTransform
public void applyGeometryTransform(Transform transform)
- Specified by:
applyGeometryTransformin classDrawable
-
setWireframeColor
public void setWireframeColor(Color color)
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:
composite-polygonOffsetFillEnable- status
-
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
-
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 String toString()
Print out information concerning all Drawable of this composite.
-
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.
-
-