org.jzy3d.plot3d.rendering.scene
Class Graph
- java.lang.Object
-
- org.jzy3d.plot3d.rendering.scene.Graph
-
public class Graph extends java.lang.ObjectThe scene'sGraphbasically stores the scene content and facilitate objects control The graph may decompose allAbstractCompositeinto a list of theirAbstractDrawables primitives if constructor is called with parameters enabling sorting. The list of primitives is ordered using either the providedDefaultOrderingStrategyor an other specifiedAbstractOrderingStrategy. Sorting is usefull for handling transparency properly. TheGraphmaintains a reference to its motherScenein order to inform theViews when its content has change and that repainting is required. The add() method allows adding aAbstractDrawableto the scene Graph and updates all views' viewpoint in order to target the center of the scene.
-
-
Constructor Summary
Constructors Constructor and Description Graph(Scene scene)Graph(Scene scene, AbstractOrderingStrategy strategy)Graph(Scene scene, AbstractOrderingStrategy strategy, boolean sort)Graph(Scene scene, boolean sort)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidadd(AbstractDrawable drawable)voidadd(AbstractDrawable drawable, boolean updateViews)Add a Drawable to the graph and call all views' so that they update their bounds according to their mode (automatic or manual).voidadd(java.util.List<? extends AbstractDrawable> drawables)voidadd(java.util.List<? extends AbstractDrawable> drawables, boolean updateViews)voiddispose()voiddraw(com.jogamp.opengl.GL gl, com.jogamp.opengl.glu.GLU glu, Camera camera)Decompose allAbstractCompositeobjects, and sort the extracted monotype (i.e.voiddrawDecomposition(com.jogamp.opengl.GL gl, com.jogamp.opengl.glu.GLU glu, Camera camera)voiddrawSimple(com.jogamp.opengl.GL gl, com.jogamp.opengl.glu.GLU glu, Camera camera, java.util.List<AbstractDrawable> components)java.util.List<AbstractDrawable>getAll()java.util.List<IGLBindedResource>getAllGLBindedResources()BoundingBox3dgetBounds()Creates and return a BoundingBox3d that embed all Drawable bounds, among those that have a defined bounding box.java.util.List<AbstractDrawable>getDecomposition()Expand allAbstractCompositesinstance into a list of atomicAbstractDrawabletypes and return all the current Graph primitives decomposition.java.util.List<ILegend>getLegends()Return the list of availableAbstractDrawable'sAWTLegend.ScenegetScene()AbstractOrderingStrategygetStrategy()Get the@Drawableordering strategy.TransformgetTransform()Return the transform that was affected to this composite.voidglMatrixMode(com.jogamp.opengl.GL gl)inthasLegends()Return true if theGraphcontains at least oneAbstractDrawablethat hasAWTLegendthat must be displayed.booleanisSort()voidmountAllGLBindedResources(com.jogamp.opengl.GL gl)voidproject(com.jogamp.opengl.GL gl, com.jogamp.opengl.glu.GLU glu, Camera camera)Update all interactiveAbstractDrawableprojectionsbooleanremove(AbstractDrawable drawable)booleanremove(AbstractDrawable drawable, boolean updateViews)Delete a Drawable from the SceneGraph and update all views' viewpoint in order to target the center of the scene.voidsetSort(boolean sort)Set sort to false to desactivate decomposition of drawable.voidsetStrategy(AbstractOrderingStrategy strategy)Set the@Drawableordering strategy.voidsetTransform(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.StringtoString()Print out information concerning all Drawable of this composite.
-
-
-
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 graph and call all views' so that they update their bounds according to their mode (automatic or manual). Addition is to the graph is synchronized.- 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()
-
getAllGLBindedResources
public java.util.List<IGLBindedResource> getAllGLBindedResources()
-
mountAllGLBindedResources
public void mountAllGLBindedResources(com.jogamp.opengl.GL gl)
-
draw
public void draw(com.jogamp.opengl.GL gl, com.jogamp.opengl.glu.GLU glu, Camera camera)Decompose allAbstractCompositeobjects, and sort the extracted monotype (i.e. non-AbstractCompositeAbstractDrawables) in order to render them according to the default -or defined-AbstractOrderingStrategy.
-
glMatrixMode
public void glMatrixMode(com.jogamp.opengl.GL gl)
-
drawSimple
public void drawSimple(com.jogamp.opengl.GL gl, com.jogamp.opengl.glu.GLU glu, Camera camera, java.util.List<AbstractDrawable> components)
-
drawDecomposition
public void drawDecomposition(com.jogamp.opengl.GL gl, com.jogamp.opengl.glu.GLU glu, Camera camera)
-
getDecomposition
public java.util.List<AbstractDrawable> getDecomposition()
Expand allAbstractCompositesinstance into a list of atomicAbstractDrawabletypes and return all the current Graph primitives decomposition.
-
project
public void project(com.jogamp.opengl.GL gl, com.jogamp.opengl.glu.GLU glu, Camera camera)Update all interactiveAbstractDrawableprojections
-
getStrategy
public AbstractOrderingStrategy getStrategy()
Get the@Drawableordering strategy.
-
setStrategy
public void setStrategy(AbstractOrderingStrategy strategy)
Set the@Drawableordering 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.
-
getLegends
public java.util.List<ILegend> getLegends()
Return the list of availableAbstractDrawable'sAWTLegend.
-
hasLegends
public int hasLegends()
Return true if theGraphcontains at least oneAbstractDrawablethat hasAWTLegendthat must be displayed.
-
toString
public java.lang.String toString()
Print out information concerning all Drawable of this composite.- Overrides:
toStringin classjava.lang.Object
-
isSort
public boolean isSort()
-
setSort
public void setSort(boolean sort)
Set sort to false to desactivate decomposition of drawable. This bypass ranking polygons w.r.t. camera. This will produce visual cue if the scene is dynamic (changing the list of polygons or viewpoints).- Parameters:
sort-
-
getScene
public Scene getScene()
-
-
DMelt 3.0 © DataMelt by jWork.ORG