org.jzy3d.plot3d.rendering.view
Class View

java.lang.Object
  extended by org.jzy3d.plot3d.rendering.view.View
Direct Known Subclasses:
ChartView

public class View
extends java.lang.Object

A View holds a Scene, a LightSet, an ICanvas to render into. It is the responsability to layout a set of concrete AbstractViewports such as the rendering the scene or an ImageViewport for displaying an image in the same window. On can control the Camera with a and get notifyed by a IViewPointChangedListener that the view point has changed. The control is relative to the center of the Scene and is defined using polar coordinates. The View supports post rendering through the addition of Renderer2ds whose implementation can define Java2d calls to render on top on OpenGL. Last, the View offers the ability to get an AxeBox for embedding the Scene and getting values along axes.

Author:
Martin Pernollet

Field Summary
static Coord3d DEFAULT_VIEW
           
static float STRETCH_RATIO
           
 
Constructor Summary
View(Scene scene, ICanvas canvas, Quality quality)
          Create a view attached to a Scene, with its own Camera and Axe.
 
Method Summary
 void addRenderer2d(Renderer2d renderer)
           
 void addTooltip(ITooltipRenderer tooltip)
           
 void addTooltips(java.util.List<ITooltipRenderer> tooltip)
           
 boolean addViewOnTopEventListener(IViewIsVerticalEventListener listener)
           
 boolean addViewPointChangedListener(IViewPointChangedListener listener)
           
 void clearTooltips()
           
static View current()
           
 void dispose()
           
 IAxe getAxe()
           
 Color getBackgroundColor()
           
 java.awt.image.BufferedImage getBackgroundImage()
           
 BoundingBox3d getBounds()
          Get the AxeBox's BoundingBox3d
 Camera getCamera()
           
 CameraMode getCameraMode()
          Get the projection of this view, either CameraMode.ORTHOGONAL or CameraMode.PERSPECTIVE.
 javax.media.opengl.GL getCurrentGL()
          GL
 Coord3d getLastViewScaling()
           
 void getMaximized()
           
 Scale getScale()
           
 java.awt.Rectangle getSceneViewportRectangle()
           
 boolean getSquared()
           
 java.util.List<ITooltipRenderer> getTooltips()
           
 ViewPositionMode getViewMode()
          Return the ViewPositionMode applied to this view.
 Coord3d getViewPoint()
          Get the viewpoint.
 boolean isAxeBoxDisplayed()
           
 void lookToBox(BoundingBox3d box)
          Set the surrounding AxeBox dimensions and the Camera target, and the colorbar range.
 void project()
           
 void removeRenderer2d(Renderer2d renderer)
           
 boolean removeViewOnTopEventListener(IViewIsVerticalEventListener listener)
           
 boolean removeViewPointChangedListener(IViewPointChangedListener listener)
           
 void rotate(Coord2d move)
          GENERAL DISPLAY CONTROLS
 void setAxe(AxeBox ax)
          CONTROLS ANNOTATIONS & GENERAL RENDERING
 void setAxeBoxDisplayed(boolean axeBoxDisplayed)
           
 void setBackgroundColor(Color color)
           
 void setBackgroundImage(java.awt.image.BufferedImage i)
          Set a buffered image, or null to desactivate background image
 void setBoundManual(BoundingBox3d bounds)
          Set a manual bounding box and switch the bounding mode to manual.
 void setBoundMode(ViewBoundMode mode)
          Select between an automatic bounding (that allows fitting the entire scene graph), or a custom bounding.
 void setCameraMode(CameraMode mode)
          Set the projection of this view, either Camera.ORTHOGONAL or Camera.PERSPECTIVE.
 void setMaximized(boolean status)
           
 void setScale(Scale scale)
           
 void setScale(Scale scale, boolean notify)
           
 void setSquared(boolean status)
           
 void setTooltip(ITooltipRenderer tooltip)
           
 void setTooltips(java.util.List<ITooltipRenderer> tooltip)
           
 void setViewPoint(Coord3d polar)
           
 void setViewPoint(Coord3d polar, boolean updateView)
          Set the viewpoint using polar coordinates relative to the target (i.e. the center of the scene).
 void setViewPositionMode(ViewPositionMode mode)
          Set the ViewPositionMode applied to this view.
 void shift(float factor)
           
 void shoot()
          Current view selection into the mother Scene, and call to target canvas rendering.
 void updateBounds()
          Set the bounds of the view according to the current mode, and orders a shoot().
 void zoom(float factor)
          Factor > 1 zoom out.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

STRETCH_RATIO

public static float STRETCH_RATIO

DEFAULT_VIEW

public static final Coord3d DEFAULT_VIEW
Constructor Detail

View

public View(Scene scene,
            ICanvas canvas,
            Quality quality)
Create a view attached to a Scene, with its own Camera and Axe. The initial view point is set at View.DEFAULT_VIEW.

The Quality allows setting the rendering capabilities that are set one time by the init() method.

Method Detail

dispose

public void dispose()

shoot

public void shoot()
Current view selection into the mother Scene, and call to target canvas rendering.


project

public void project()

rotate

public void rotate(Coord2d move)
GENERAL DISPLAY CONTROLS


shift

public void shift(float factor)

zoom

public void zoom(float factor)
Factor > 1 zoom out.


setScale

public void setScale(Scale scale)

setScale

public void setScale(Scale scale,
                     boolean notify)

getScale

public Scale getScale()

lookToBox

public void lookToBox(BoundingBox3d box)
Set the surrounding AxeBox dimensions and the Camera target, and the colorbar range.


getBounds

public BoundingBox3d getBounds()
Get the AxeBox's BoundingBox3d


setViewPositionMode

public void setViewPositionMode(ViewPositionMode mode)
Set the ViewPositionMode applied to this view.


getViewMode

public ViewPositionMode getViewMode()
Return the ViewPositionMode applied to this view.


setViewPoint

public void setViewPoint(Coord3d polar,
                         boolean updateView)
Set the viewpoint using polar coordinates relative to the target (i.e. the center of the scene).


setViewPoint

public void setViewPoint(Coord3d polar)

getViewPoint

public Coord3d getViewPoint()
Get the viewpoint.


getLastViewScaling

public Coord3d getLastViewScaling()

setAxe

public void setAxe(AxeBox ax)
CONTROLS ANNOTATIONS & GENERAL RENDERING


getAxe

public IAxe getAxe()

getSquared

public boolean getSquared()

setSquared

public void setSquared(boolean status)

isAxeBoxDisplayed

public boolean isAxeBoxDisplayed()

setAxeBoxDisplayed

public void setAxeBoxDisplayed(boolean axeBoxDisplayed)

setBackgroundColor

public void setBackgroundColor(Color color)

getBackgroundColor

public Color getBackgroundColor()

setBackgroundImage

public void setBackgroundImage(java.awt.image.BufferedImage i)
Set a buffered image, or null to desactivate background image


getBackgroundImage

public java.awt.image.BufferedImage getBackgroundImage()

getCamera

public Camera getCamera()

setCameraMode

public void setCameraMode(CameraMode mode)
Set the projection of this view, either Camera.ORTHOGONAL or Camera.PERSPECTIVE.


getCameraMode

public CameraMode getCameraMode()
Get the projection of this view, either CameraMode.ORTHOGONAL or CameraMode.PERSPECTIVE.


getMaximized

public void getMaximized()

setMaximized

public void setMaximized(boolean status)

getSceneViewportRectangle

public java.awt.Rectangle getSceneViewportRectangle()

clearTooltips

public void clearTooltips()

setTooltip

public void setTooltip(ITooltipRenderer tooltip)

addTooltip

public void addTooltip(ITooltipRenderer tooltip)

setTooltips

public void setTooltips(java.util.List<ITooltipRenderer> tooltip)

addTooltips

public void addTooltips(java.util.List<ITooltipRenderer> tooltip)

getTooltips

public java.util.List<ITooltipRenderer> getTooltips()

addRenderer2d

public void addRenderer2d(Renderer2d renderer)

removeRenderer2d

public void removeRenderer2d(Renderer2d renderer)

addViewOnTopEventListener

public boolean addViewOnTopEventListener(IViewIsVerticalEventListener listener)

removeViewOnTopEventListener

public boolean removeViewOnTopEventListener(IViewIsVerticalEventListener listener)

addViewPointChangedListener

public boolean addViewPointChangedListener(IViewPointChangedListener listener)

removeViewPointChangedListener

public boolean removeViewPointChangedListener(IViewPointChangedListener listener)

setBoundMode

public void setBoundMode(ViewBoundMode mode)
Select between an automatic bounding (that allows fitting the entire scene graph), or a custom bounding.


updateBounds

public void updateBounds()
Set the bounds of the view according to the current mode, and orders a shoot().


setBoundManual

public void setBoundManual(BoundingBox3d bounds)
Set a manual bounding box and switch the bounding mode to manual.


getCurrentGL

public javax.media.opengl.GL getCurrentGL()
GL


current

public static View current()