Package org.jzy3d.plot3d.rendering.scene
Class Graph
java.lang.Object
org.jzy3d.plot3d.rendering.scene.Graph
- Direct Known Subclasses:
MultithreadedGraph
The scene's
Graph
basically stores the scene content and facilitate objects control.
The graph may decompose all Composite
into a list of their Drawable
s primitives
if constructor is called with parameters enabling sorting.
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
View
s when its content has change and that repainting is required.
The add() method allows adding a Drawable
to the scene Graph and updates all views'
viewpoint in order to target the center of the scene.- Author:
- Martin Pernollet
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionprotected static final float
protected BoundingBox3d
protected boolean
protected List<Graph.GraphListener>
protected Scene
protected boolean
protected AbstractOrderingStrategy
protected Transform
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
void
void
void
Add a Drawable to the graph and call all views' so that they update their bounds according to their mode (automatic or manual).void
addGraphListener
(Graph.GraphListener graphListener) void
dispose()
void
Decompose allComposite
objects, and sort the extracted monotype (i.e.void
void
drawDecomposition
(IPainter painter) render all items of the graph after decomposing all composite item into primitive drawablesvoid
drawSimple
(IPainter painter, List<Drawable> components) render all items of the graphprotected void
getAll()
Creates and return a BoundingBox3d that embed all Drawable bounds, among those that have a defined bounding box.Expand allinvalid @link
AbstractComposites
Drawable
types and return all the current Graph primitives decomposition.getScene()
Get theinvalid @link
{@link @Drawable
Return the transform that was affected to this composite.int
boolean
isSort()
void
mountAllGLBindedResources
(IPainter painter) void
Update all interactiveDrawable
projectionsboolean
boolean
Delete a Drawable from the SceneGraph and update all views' viewpoint in order to target the center of the scene.void
setClipBox
(BoundingBox3d clipBox) void
setClipBox
(BoundingBox3d clipBox, boolean includeLimits, boolean updateView) Configure clipping plane according to the input bounding box.void
setSort
(boolean sort) Set sort to false to desactivate decomposition of drawable.void
setStrategy
(AbstractOrderingStrategy strategy) Set theinvalid @link
{@link @Drawable
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.toString()
Print out information concerning all Drawable of this composite.protected void
protected void
-
Field Details
-
components
-
scene
-
transform
-
strategy
-
sort
protected boolean sort -
graphListener
-
clipBox
-
clipIncludesLimits
protected boolean clipIncludesLimits -
CLIP_MARGIN_RATIO
protected static final float CLIP_MARGIN_RATIO- See Also:
-
-
Constructor Details
-
Graph
-
Graph
-
Graph
-
Graph
-
Graph
protected Graph()
-
-
Method Details
-
dispose
public void dispose() -
add
Add a Drawable to the graph and call all views' so that they update their bounds according to their mode (automatic or manual). Addition 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
-
add
-
add
-
remove
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
-
getAll
-
getAllGLBindedResources
-
mountAllGLBindedResources
-
fireMountAll
protected void fireMountAll() -
getGraphListener
-
addGraphListener
-
draw
Decompose allComposite
objects, and sort the extracted monotype (i.e. non-Composite
Drawable
s) in order to render them according to the default -or defined-AbstractOrderingStrategy
. -
draw
-
drawSimple
render all items of the graph -
drawDecomposition
render all items of the graph after decomposing all composite item into primitive drawables -
getDecomposition
Expand allinvalid @link
AbstractComposites
Drawable
types and return all the current Graph primitives decomposition. -
project
Update all interactiveDrawable
projections -
getStrategy
Get theinvalid @link
{@link @Drawable
-
setStrategy
Set theinvalid @link
{@link @Drawable
-
setTransform
Delegate transforming iteratively to all Drawable of this graph and stores the given transform for keeping the ability of retrieving it. -
getTransform
Return the transform that was affected to this composite. -
getBounds
Creates and return a BoundingBox3d that embed all Drawable bounds, among those that have a defined bounding box. -
getClipBox
-
setClipBox
-
setClipBox
Configure clipping plane according to the input bounding box. Update view according to settings -
getLegends
-
hasLegends
public int hasLegends() -
toString
Print out information concerning all Drawable of this composite. -
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
-
viewsUpdateBounds
protected void viewsUpdateBounds() -
viewsShoot
protected void viewsShoot()
-