org.jzy3d.plot3d.primitives
Class AbstractComposite

java.lang.Object
  extended by org.jzy3d.plot3d.primitives.AbstractDrawable
      extended by org.jzy3d.plot3d.primitives.AbstractWireframeable
          extended by org.jzy3d.plot3d.primitives.AbstractComposite
All Implemented Interfaces:
IMultiColorable, ISingleColorable, IGLRenderer, ISortableDraw, IWireframeable
Direct Known Subclasses:
ContourLevel, Cylinder, EnlightableBar, FlatLine2d, HistogramBar, Shape, TexturedCube, TexturedCylinder

public abstract class AbstractComposite
extends AbstractWireframeable
implements ISingleColorable, IMultiColorable

A Composite gathers several Drawable and provides default methods for rendering them all in one call.

Author:
Martin Pernollet

Constructor Summary
AbstractComposite()
           
 
Method Summary
 void add(AbstractDrawable drawable)
          Add a Drawable to this composite.
 void add(java.util.List<? extends AbstractDrawable> drawables)
          Append a list of Drawables to this composite.
 boolean canBeSplitted()
          Indicates if this composite can be decomposed into atomic drawable objects by the scene graph.
 void clear()
          Clear the list of Drawables from this composite.
 void draw(javax.media.opengl.GL gl, javax.media.opengl.glu.GLU glu, Camera camera)
          Delegate rendering iteratively to all Drawable of this composite.
 AbstractDrawable 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.
 java.util.List<AbstractDrawable> getDrawables()
           
 Transform getTransform()
          Return the transform that was affected to this composite.
 boolean isDetailedToString()
           
 void remove(AbstractDrawable 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, the toString() 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 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 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.
 java.lang.String toString()
          Print out information concerning all Drawable of this composite.
 java.lang.String toString(int depth)
           
 
Methods inherited from class org.jzy3d.plot3d.primitives.AbstractWireframeable
getFaceDisplayed, getWireframeColor, getWireframeDisplayed, getWireframeWidth
 
Methods inherited from class org.jzy3d.plot3d.primitives.AbstractDrawable
addDrawableListener, dispose, getBarycentre, getDistance, getFace, getLongestDistance, getShortestDistance, hasFace, isDisplayed, isFace2dDisplayed, removeDrawableListener, setLegend, setLegendDisplayed
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AbstractComposite

public AbstractComposite()
Method Detail

canBeSplitted

public boolean canBeSplitted()
Indicates if this composite can be decomposed into atomic drawable objects by the scene graph.


add

public void add(java.util.List<? extends AbstractDrawable> 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(AbstractDrawable drawable)
Add a Drawable to this composite.


remove

public void remove(AbstractDrawable drawable)
Remove a Drawable from this composite.


get

public AbstractDrawable get(int p)
Get a Drawable stored by this composite.


getDrawables

public java.util.List<AbstractDrawable> getDrawables()

size

public int size()
Return the number of Drawable stored by this composite.


draw

public void draw(javax.media.opengl.GL gl,
                 javax.media.opengl.glu.GLU glu,
                 Camera camera)
Delegate rendering iteratively to all Drawable of this composite.

Specified by:
draw in interface IGLRenderer
Specified by:
draw in class AbstractDrawable
Parameters:
gl - GL context
glu - GLU context
camera - a reference to a shooting Camera.

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 class AbstractDrawable

getTransform

public Transform getTransform()
Return the transform that was affected to this composite.

Overrides:
getTransform in class AbstractDrawable
Returns:
transform

getBounds

public BoundingBox3d getBounds()
Creates and return a BoundingBox3d that embed all available Drawable bounds.

Overrides:
getBounds in class AbstractDrawable
Returns:
a bounding box

setWireframeColor

public void setWireframeColor(Color color)
Description copied from class: AbstractWireframeable
Set the wireframe color.

Specified by:
setWireframeColor in interface IWireframeable
Overrides:
setWireframeColor in class AbstractWireframeable

setWireframeDisplayed

public void setWireframeDisplayed(boolean status)
Description copied from class: AbstractWireframeable
Set the wireframe display status to on or off.

Specified by:
setWireframeDisplayed in interface IWireframeable
Overrides:
setWireframeDisplayed in class AbstractWireframeable

setWireframeWidth

public void setWireframeWidth(float width)
Description copied from class: AbstractWireframeable
Set the wireframe width.

Specified by:
setWireframeWidth in interface IWireframeable
Overrides:
setWireframeWidth in class AbstractWireframeable

setFaceDisplayed

public void setFaceDisplayed(boolean status)
Description copied from class: AbstractWireframeable
Set the face display status to on or off.

Specified by:
setFaceDisplayed in interface IWireframeable
Overrides:
setFaceDisplayed in class AbstractWireframeable

setDisplayed

public void setDisplayed(boolean status)
Description copied from class: AbstractDrawable
Set to true or false the displayed status of this object.

Overrides:
setDisplayed in class AbstractDrawable

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 interface IMultiColorable

getColorMapper

public ColorMapper getColorMapper()
Description copied from interface: IMultiColorable
Get the colormapper.

Specified by:
getColorMapper in interface IMultiColorable

setColor

public void setColor(Color color)
Description copied from interface: ISingleColorable
Set the color.

Specified by:
setColor in interface ISingleColorable
Parameters:
color - the color

getColor

public Color getColor()
Description copied from interface: ISingleColorable
Get the color.

Specified by:
getColor in interface ISingleColorable
Returns:
color the color.

toString

public java.lang.String toString()
Print out information concerning all Drawable of this composite.

Overrides:
toString in class AbstractDrawable

toString

public java.lang.String toString(int depth)
Overrides:
toString in class AbstractDrawable

isDetailedToString

public boolean isDetailedToString()

setDetailedToString

public void setDetailedToString(boolean detailedToString)
When to true, the toString() method will give the detail of each element of this composite object in a tree like layout.