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
AComposite
gathers severalDrawable
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 (seeDecomposition
), meaning a sceneGraph
can take all items independently to sort them for optimized translucency rendering.- Author:
- Martin Pernollet
-
-
Field Summary
Fields Modifier and Type Field Description protected Color
color
protected List<Drawable>
components
protected boolean
detailedToString
protected ColorMapper
mapper
protected Transform
transform
-
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 void
add(List<? extends Drawable> drawables)
Append a list of Drawables to this composite.void
add(Drawable drawable)
Add a Drawable to this composite.void
applyGeometryTransform(Transform transform)
void
clear()
Clear the list of Drawables from this composite.void
draw(IPainter painter)
Delegate rendering iteratively to all Drawable of this composite.Drawable
get(int p)
Get a Drawable stored by this composite.BoundingBox3d
getBounds()
Creates and return a BoundingBox3d that embed all available Drawable bounds.Color
getColor()
Get the color.ColorMapper
getColorMapper()
Get the colormapper.List<Drawable>
getDrawables()
Transform
getTransform()
Return the transform that was affected to this composite.boolean
isDetailedToString()
void
remove(Drawable drawable)
Remove a Drawable from this composite.void
setColor(Color color)
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
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
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.String
toString()
Print out information concerning all Drawable of this composite.String
toString(int depth)
void
updateBounds()
-
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:
draw
in interfaceIGLRenderer
- Specified by:
draw
in 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:
setTransform
in classDrawable
-
setTransformBefore
public void setTransformBefore(Transform transform)
- Overrides:
setTransformBefore
in classDrawable
-
setSpaceTransformer
public void setSpaceTransformer(SpaceTransformer spaceTransformer)
- Overrides:
setSpaceTransformer
in classDrawable
-
getTransform
public Transform getTransform()
Return the transform that was affected to this composite.- Overrides:
getTransform
in classDrawable
- Returns:
- transform
-
getBounds
public BoundingBox3d getBounds()
Creates and return a BoundingBox3d that embed all available Drawable bounds.
-
updateBounds
public void updateBounds()
- Specified by:
updateBounds
in classDrawable
-
applyGeometryTransform
public void applyGeometryTransform(Transform transform)
- Specified by:
applyGeometryTransform
in classDrawable
-
setWireframeColor
public void setWireframeColor(Color color)
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:
composite
-polygonOffsetFillEnable
- status
-
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
-
setColorMapper
public void setColorMapper(ColorMapper mapper)
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
public ColorMapper getColorMapper()
Description copied from interface:IMultiColorable
Get the colormapper.- Specified by:
getColorMapper
in interfaceIMultiColorable
-
setColor
public void setColor(Color color)
Description copied from interface:ISingleColorable
Set the color.- Specified by:
setColor
in interfaceISingleColorable
- Parameters:
color
- the color
-
getColor
public Color getColor()
Description copied from interface:ISingleColorable
Get the color.- Specified by:
getColor
in 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.
-
-