org.jzy3d.plot3d.rendering.scene
Class Graph

java.lang.Object
  extended by org.jzy3d.plot3d.rendering.scene.Graph

public class Graph
extends java.lang.Object

The scene's Graph basically allows decomposing the list of object into a list of AbstractDrawables primitive (i.e. objects that are not AbstractComposite. The list of primitives is ordered using either the provided DefaultOrderingStrategy or an other specified AbstractOrderingStrategy. Sorting is usefull for handling transparency properly. The Graph maintains a reference to its mother Scene in order to inform the Views when its content has change and that repainting is required. The add() method allows adding a AbstractDrawable to the scene Graph and updates all views' viewpoint in order to target the center of the scene.

Author:
Martin Pernollet

Constructor Summary
Graph(Scene scene)
           
Graph(Scene scene, AbstractOrderingStrategy strategy)
           
Graph(Scene scene, AbstractOrderingStrategy strategy, boolean sort)
           
Graph(Scene scene, boolean sort)
           
 
Method Summary
 void add(AbstractDrawable drawable)
           
 void add(AbstractDrawable drawable, boolean updateViews)
          Add a Drawable to the SceneGraph and call all views' so that they update their bounds according to their mode (automatic or manual).
 void add(java.util.List<? extends AbstractDrawable> drawables)
           
 void add(java.util.List<? extends AbstractDrawable> drawables, boolean updateViews)
           
 void dispose()
           
 void draw(javax.media.opengl.GL gl, javax.media.opengl.glu.GLU glu, Camera camera)
          Decompose all AbstractComposite objects, and sort the extracted monotype (i.e. non-AbstractComposite AbstractDrawables) in order to render them according to the default -or defined- AbstractOrderingStrategy.
 java.util.List<AbstractDrawable> getAll()
           
 BoundingBox3d getBounds()
          Creates and return a BoundingBox3d that embed all Drawable bounds, among those that have a defined bounding box.
 java.util.List<Legend> getMetaData()
          Return the list of available AbstractDrawable's Legend.
 AbstractOrderingStrategy getStrategy()
          Get the @Drawable ordering strategy.
 Transform getTransform()
          Return the transform that was affected to this composite.
 int hasMetaData()
          Return true if the Graph contains at least one AbstractDrawable that has Legend that must be displayed.
 void init(javax.media.opengl.GL gl)
          Initialize all objects of the scene graph that require an initialization.
 void project(javax.media.opengl.GL gl, javax.media.opengl.glu.GLU glu, Camera camera)
          Update all interactive AbstractDrawable projections
 boolean remove(AbstractDrawable drawable)
           
 boolean remove(AbstractDrawable drawable, boolean updateViews)
          Delete a Drawable from the SceneGraph and update all views' viewpoint in order to target the center of the scene.
 void select(javax.media.opengl.GL gl, javax.media.opengl.glu.GLU glu, int x, int y)
           
 void setStrategy(AbstractOrderingStrategy strategy)
          Set the @Drawable ordering strategy.
 void setTransform(Transform transform)
          Delegate transforming iteratively to all Drawable of this graph and stores the given transform for keeping the ability of retrieving it.
 java.lang.String toString()
          Print out information concerning all Drawable of this composite.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Graph

public Graph(Scene scene)

Graph

public Graph(Scene scene,
             boolean sort)

Graph

public Graph(Scene scene,
             AbstractOrderingStrategy strategy)

Graph

public Graph(Scene scene,
             AbstractOrderingStrategy strategy,
             boolean sort)
Method Detail

dispose

public void dispose()

add

public void add(AbstractDrawable drawable,
                boolean updateViews)
Add a Drawable to the SceneGraph and call all views' so that they update their bounds according to their mode (automatic or manual).

Parameters:
drawable: - The drawable that must be added to the scene graph.
update: - should be true if you wish to have all the views updated with old bounds including drawable bounds

add

public void add(AbstractDrawable drawable)

add

public void add(java.util.List<? extends AbstractDrawable> drawables,
                boolean updateViews)

add

public void add(java.util.List<? extends AbstractDrawable> drawables)

remove

public boolean remove(AbstractDrawable drawable,
                      boolean updateViews)
Delete a Drawable from the SceneGraph and update all views' viewpoint in order to target the center of the scene.

Parameters:
drawable - The drawable that must be deleted from the scene graph.

remove

public boolean remove(AbstractDrawable drawable)

getAll

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

init

public void init(javax.media.opengl.GL gl)
Initialize all objects of the scene graph that require an initialization.


draw

public void draw(javax.media.opengl.GL gl,
                 javax.media.opengl.glu.GLU glu,
                 Camera camera)
Decompose all AbstractComposite objects, and sort the extracted monotype (i.e. non-AbstractComposite AbstractDrawables) in order to render them according to the default -or defined- AbstractOrderingStrategy.


select

public void select(javax.media.opengl.GL gl,
                   javax.media.opengl.glu.GLU glu,
                   int x,
                   int y)

project

public void project(javax.media.opengl.GL gl,
                    javax.media.opengl.glu.GLU glu,
                    Camera camera)
Update all interactive AbstractDrawable projections


getStrategy

public AbstractOrderingStrategy getStrategy()
Get the @Drawable ordering strategy.


setStrategy

public void setStrategy(AbstractOrderingStrategy strategy)
Set the @Drawable ordering strategy.


setTransform

public void setTransform(Transform transform)
Delegate transforming iteratively to all Drawable of this graph and stores the given transform for keeping the ability of retrieving it.


getTransform

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


getBounds

public BoundingBox3d getBounds()
Creates and return a BoundingBox3d that embed all Drawable bounds, among those that have a defined bounding box.


getMetaData

public java.util.List<Legend> getMetaData()
Return the list of available AbstractDrawable's Legend.


hasMetaData

public int hasMetaData()
Return true if the Graph contains at least one AbstractDrawable that has Legend that must be displayed.


toString

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

Overrides:
toString in class java.lang.Object