org.jzy3d.plot3d.rendering.view
Class View
- java.lang.Object
-
- org.jzy3d.plot3d.rendering.view.View
-
- Direct Known Subclasses:
- ChartView, SelectableView
public class View extends java.lang.ObjectAViewholds aScene, aLightSet, anICanvasto render into. It is the responsability to layout a set of concreteAbstractViewportManagers such as the rendering the scene or anAWTImageViewportfor displaying an image in the same window. On can control theCamerawith a and get notifyed by aIViewPointChangedListenerthat the view point has changed. The control is relative to the center of theSceneand is defined using polar coordinates. TheViewsupports post rendering through the addition ofRenderer2ds whose implementation can define Java2d calls to render on top on OpenGL2. Last, theViewoffers the ability to get anAxeBoxfor embedding theSceneand getting values along axes.
-
-
Field Summary
Fields Modifier and Type Field and Description static Coord3dDEFAULT_VIEWstatic floatSTRETCH_RATIO
-
Constructor Summary
Constructors Constructor and Description View(IChartComponentFactory factory, Scene scene, ICanvas canvas, Quality quality)Create a view attached to a Scene, with its own Camera and Axe.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description booleanaddViewLifecycleChangedListener(IViewLifecycleEventListener listener)booleanaddViewOnTopEventListener(IViewIsVerticalEventListener listener)booleanaddViewPointChangedListener(IViewPointChangedListener listener)voidclear(com.jogamp.opengl.GL gl)Clear the color and depth buffer.voidclearColorAndDepth(com.jogamp.opengl.GL gl)Coord3dcomputeCameraEye(Coord3d target)static Coord3dcomputeCameraEyeFree(Coord3d viewpoint, Coord3d target)static Coord3dcomputeCameraEyeProfile(Coord3d viewpoint, Coord3d target)static Coord3dcomputeCameraEyeTop(Coord3d viewpoint, Coord3d target)voidcomputeCameraRenderingSphereRadius(com.jogamp.opengl.GL gl, com.jogamp.opengl.glu.GLU glu, ViewportConfiguration viewport, BoundingBox3d bounds)Coord3dcomputeCameraTarget()Coord3dcomputeCameraUp()Coord3dcomputeCameraUpAndTriggerEvents()BoundingBox3dcomputeScaledViewBounds()Coord3dcomputeSceneScaling()static Viewcurrent()voiddispose()GraphgetAnnotations()IAxegetAxe()ColorgetBackgroundColor()BoundingBox3dgetBounds()Get theAxeBox'sBoundingBox3dViewBoundModegetBoundsMode()CameragetCamera()CameraModegetCameraMode()Get the projection of this view, either CameraMode.ORTHOGONAL or CameraMode.PERSPECTIVE.ICanvasgetCanvas()Coord3dgetCenter()Return the central point of the view scene, that is the last bounding box center set bylookToBox(BoundingBox3d box)ChartgetChart()com.jogamp.opengl.GLContextgetCurrentContext()com.jogamp.opengl.GLgetCurrentGL()BoundingBox3dgetInitBounds()Coord3dgetLastViewScaling()Return the last used view scaling that was set according to thesetSquared(boolean v)status.ScalegetScale()ScenegetScene()RectanglegetSceneViewportRectangle()SpaceTransformergetSpaceTransformer()booleangetSquared()ViewPositionModegetViewMode()Return theViewPositionModeapplied to this view.Coord3dgetViewPoint()Get the viewpoint.voidglModelView(com.jogamp.opengl.GL gl)voidinit(com.jogamp.opengl.GL gl)The initialization function: specifies general GL settings that impact the rendering quality and performance (computation speed).voidinitLights(com.jogamp.opengl.GL gl)voidinitQuality(com.jogamp.opengl.GL gl)voidinitResources(com.jogamp.opengl.GL gl)booleanisAxeBoxDisplayed()booleanisSlave()voidlookToBox(BoundingBox3d box)Set the surrounding AxeBox dimensions and the Camera target, and the colorbar range.voidproject()Coord3dprojectMouse(int x, int y)booleanremoveViewLifecycleChangedListener(IViewLifecycleEventListener listener)booleanremoveViewOnTopEventListener(IViewIsVerticalEventListener listener)booleanremoveViewPointChangedListener(IViewPointChangedListener listener)voidrender(com.jogamp.opengl.GL gl, com.jogamp.opengl.glu.GLU glu)voidrenderAnnotations(com.jogamp.opengl.GL gl, com.jogamp.opengl.glu.GLU glu)voidrenderAxeBox(com.jogamp.opengl.GL gl, com.jogamp.opengl.glu.GLU glu)voidrenderBackground(com.jogamp.opengl.GL gl, com.jogamp.opengl.glu.GLU glu2, float f, float g)To be implemented (see AWTView)voidrenderBackground(com.jogamp.opengl.GL gl, com.jogamp.opengl.glu.GLU glu2, ViewportConfiguration backgroundViewPort)To be implemented (see AWTView)voidrenderOverlay(com.jogamp.opengl.GL gl)voidrenderOverlay(com.jogamp.opengl.GL gl, ViewportConfiguration viewportConfiguration)voidrenderScene(com.jogamp.opengl.GL gl, com.jogamp.opengl.glu.GLU glu)voidrenderScene(com.jogamp.opengl.GL gl, com.jogamp.opengl.glu.GLU glu, float left, float right)voidrenderScene(com.jogamp.opengl.GL gl, com.jogamp.opengl.glu.GLU glu, ViewportConfiguration viewport)voidrenderSceneGraph(com.jogamp.opengl.GL gl, com.jogamp.opengl.glu.GLU glu)voidrenderSceneGraph(com.jogamp.opengl.GL gl, com.jogamp.opengl.glu.GLU glu, boolean light)voidrotate(Coord2d move)GENERAL DISPLAY CONTROLSvoidrotate(Coord2d move, boolean updateView)voidsetAxe(IAxe ax)voidsetAxeBoxDisplayed(boolean axeBoxDisplayed)voidsetBackgroundColor(Color color)voidsetBoundManual(BoundingBox3d bounds)Set a manual bounding box and switch the bounding mode to {ViewBoundMode.MANUAL}, meaning that any call toupdateBounds()will update view bounds to the current bounds.voidsetBoundMode(ViewBoundMode mode)Select between an automatic bounding (that allows fitting the entire scene graph), or a custom bounding.voidsetCameraMode(CameraMode mode)Set the projection of this view, either Camera.ORTHOGONAL or Camera.PERSPECTIVE.voidsetChart(Chart chart)voidsetInitBounds(BoundingBox3d initBounds)voidsetMaximized(boolean status)voidsetScale(Scale scale)Z scale.voidsetScale(Scale scale, boolean notify)Z scale.voidsetScaleX(Scale scale)voidsetScaleX(Scale scale, boolean notify)voidsetScaleY(Scale scale)voidsetScaleY(Scale scale, boolean notify)voidsetScaleZ(Scale scale)voidsetScaleZ(Scale scale, boolean notify)voidsetSlave(boolean slave)voidsetSpaceTransformer(SpaceTransformer transformer)voidsetSquared(boolean status)voidsetViewPoint(Coord3d polar)Set the viewpoint and query a view update.voidsetViewPoint(Coord3d polar, boolean updateView)Set the viewpoint using polar coordinates relative to the target (i.e.voidsetViewPositionMode(ViewPositionMode mode)Set theViewPositionModeapplied to this view.voidshift(float factor)voidshift(float factor, boolean updateView)voidshoot()Current view selection into the mother Scene, and call to target canvas rendering.voidupdateBounds()Set the bounds of the view according to the currentViewBoundMode, and orders aCamera.shoot().voidupdateBoundsForceUpdate(boolean refresh)Update the bounds according to the scene graph whatever is the currentViewBoundMode, and orders aCamera.shoot()voidupdateCamera(com.jogamp.opengl.GL gl, com.jogamp.opengl.glu.GLU glu, ViewportConfiguration viewport, BoundingBox3d boundsScaled)voidupdateCamera(com.jogamp.opengl.GL gl, com.jogamp.opengl.glu.GLU glu, ViewportConfiguration viewport, BoundingBox3d bounds, float sceneRadiusScaled)voidupdateQuality(com.jogamp.opengl.GL gl)voidzoom(float factor)voidzoom(float factor, boolean updateView)voidzoomX(float factor)voidzoomX(float factor, boolean updateView)voidzoomY(float factor)voidzoomY(float factor, boolean updateView)voidzoomZ(float factor)voidzoomZ(float factor, boolean updateView)
-
-
-
Field Detail
-
STRETCH_RATIO
public static float STRETCH_RATIO
-
DEFAULT_VIEW
public static final Coord3d DEFAULT_VIEW
-
-
Constructor Detail
-
View
public View(IChartComponentFactory factory, 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 atView.DEFAULT_VIEW. TheQualityallows setting the rendering capabilities that are set one time by the init() method.
-
-
Method Detail
-
getChart
public Chart getChart()
-
setChart
public void setChart(Chart chart)
-
isSlave
public boolean isSlave()
-
setSlave
public void setSlave(boolean slave)
-
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()
-
projectMouse
public Coord3d projectMouse(int x, int y)
-
rotate
public void rotate(Coord2d move)
GENERAL DISPLAY CONTROLS
-
rotate
public void rotate(Coord2d move, boolean updateView)
-
shift
public void shift(float factor)
-
shift
public void shift(float factor, boolean updateView)
-
zoom
public void zoom(float factor)
-
zoom
public void zoom(float factor, boolean updateView)
-
zoomX
public void zoomX(float factor)
-
zoomX
public void zoomX(float factor, boolean updateView)
-
zoomY
public void zoomY(float factor)
-
zoomY
public void zoomY(float factor, boolean updateView)
-
zoomZ
public void zoomZ(float factor)
-
zoomZ
public void zoomZ(float factor, boolean updateView)
-
setScale
public void setScale(Scale scale)
Z scale.- See Also:
setScaleX, setScaleY, setScaleZ
-
setScale
public void setScale(Scale scale, boolean notify)
Z scale.- See Also:
setScaleX, setScaleY, setScaleZ
-
setScaleX
public void setScaleX(Scale scale)
-
setScaleX
public void setScaleX(Scale scale, boolean notify)
-
setScaleY
public void setScaleY(Scale scale)
-
setScaleY
public void setScaleY(Scale scale, boolean notify)
-
setScaleZ
public void setScaleZ(Scale scale)
-
setScaleZ
public void setScaleZ(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.
-
getCenter
public Coord3d getCenter()
Return the central point of the view scene, that is the last bounding box center set bylookToBox(BoundingBox3d box)
-
getBounds
public BoundingBox3d getBounds()
Get theAxeBox'sBoundingBox3d
-
getBoundsMode
public ViewBoundMode getBoundsMode()
-
setViewPositionMode
public void setViewPositionMode(ViewPositionMode mode)
Set theViewPositionModeapplied to this view.
-
getViewMode
public ViewPositionMode getViewMode()
Return theViewPositionModeapplied 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). Only X and Y dimensions are required, as the distance to center will be computed automatically byupdateCamera().
-
setViewPoint
public void setViewPoint(Coord3d polar)
Set the viewpoint and query a view update.- See Also:
setViewPoint(Coord3d polar, boolean updateView)}
-
getViewPoint
public Coord3d getViewPoint()
Get the viewpoint. The Z dimension is the one defined byupdateCamera(), which depends on the view scaling.- See Also:
setViewPoint(Coord3d polar, boolean updateView)}
-
getLastViewScaling
public Coord3d getLastViewScaling()
Return the last used view scaling that was set according to thesetSquared(boolean v)status.
-
setAxe
public void setAxe(IAxe ax)
-
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()
-
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.
-
setMaximized
public void setMaximized(boolean status)
-
getScene
public Scene getScene()
-
getSceneViewportRectangle
public Rectangle getSceneViewportRectangle()
-
getCanvas
public ICanvas getCanvas()
-
getAnnotations
public Graph getAnnotations()
-
addViewOnTopEventListener
public boolean addViewOnTopEventListener(IViewIsVerticalEventListener listener)
-
removeViewOnTopEventListener
public boolean removeViewOnTopEventListener(IViewIsVerticalEventListener listener)
-
addViewPointChangedListener
public boolean addViewPointChangedListener(IViewPointChangedListener listener)
-
removeViewPointChangedListener
public boolean removeViewPointChangedListener(IViewPointChangedListener listener)
-
addViewLifecycleChangedListener
public boolean addViewLifecycleChangedListener(IViewLifecycleEventListener listener)
-
removeViewLifecycleChangedListener
public boolean removeViewLifecycleChangedListener(IViewLifecycleEventListener 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 currentViewBoundMode, and orders aCamera.shoot().
-
updateBoundsForceUpdate
public void updateBoundsForceUpdate(boolean refresh)
Update the bounds according to the scene graph whatever is the currentViewBoundMode, and orders aCamera.shoot()
-
setBoundManual
public void setBoundManual(BoundingBox3d bounds)
Set a manual bounding box and switch the bounding mode to {ViewBoundMode.MANUAL}, meaning that any call toupdateBounds()will update view bounds to the current bounds.
-
getCurrentGL
public com.jogamp.opengl.GL getCurrentGL()
-
getCurrentContext
public com.jogamp.opengl.GLContext getCurrentContext()
-
init
public void init(com.jogamp.opengl.GL gl)
The initialization function:- specifies general GL settings that impact the rendering quality and performance (computation speed).
- enable light management
- load all required texture resources
- fix the current view bounds to the whole scene graph bounds
Qualitygiven in the constructor parameters.
-
getInitBounds
public BoundingBox3d getInitBounds()
-
setInitBounds
public void setInitBounds(BoundingBox3d initBounds)
-
initQuality
public void initQuality(com.jogamp.opengl.GL gl)
-
initLights
public void initLights(com.jogamp.opengl.GL gl)
-
initResources
public void initResources(com.jogamp.opengl.GL gl)
-
clear
public void clear(com.jogamp.opengl.GL gl)
Clear the color and depth buffer.
-
clearColorAndDepth
public void clearColorAndDepth(com.jogamp.opengl.GL gl)
-
render
public void render(com.jogamp.opengl.GL gl, com.jogamp.opengl.glu.GLU glu)
-
renderBackground
public void renderBackground(com.jogamp.opengl.GL gl, com.jogamp.opengl.glu.GLU glu2, float f, float g)To be implemented (see AWTView)
-
renderBackground
public void renderBackground(com.jogamp.opengl.GL gl, com.jogamp.opengl.glu.GLU glu2, ViewportConfiguration backgroundViewPort)To be implemented (see AWTView)
-
renderScene
public void renderScene(com.jogamp.opengl.GL gl, com.jogamp.opengl.glu.GLU glu)
-
renderScene
public void renderScene(com.jogamp.opengl.GL gl, com.jogamp.opengl.glu.GLU glu, float left, float right)
-
renderScene
public void renderScene(com.jogamp.opengl.GL gl, com.jogamp.opengl.glu.GLU glu, ViewportConfiguration viewport)
-
updateQuality
public void updateQuality(com.jogamp.opengl.GL gl)
-
computeScaledViewBounds
public BoundingBox3d computeScaledViewBounds()
-
computeSceneScaling
public Coord3d computeSceneScaling()
-
updateCamera
public void updateCamera(com.jogamp.opengl.GL gl, com.jogamp.opengl.glu.GLU glu, ViewportConfiguration viewport, BoundingBox3d boundsScaled)
-
updateCamera
public void updateCamera(com.jogamp.opengl.GL gl, com.jogamp.opengl.glu.GLU glu, ViewportConfiguration viewport, BoundingBox3d bounds, float sceneRadiusScaled)
-
computeCameraTarget
public Coord3d computeCameraTarget()
-
computeCameraEyeProfile
public static Coord3d computeCameraEyeProfile(Coord3d viewpoint, Coord3d target)
-
computeCameraUpAndTriggerEvents
public Coord3d computeCameraUpAndTriggerEvents()
-
computeCameraUp
public Coord3d computeCameraUp()
-
computeCameraRenderingSphereRadius
public void computeCameraRenderingSphereRadius(com.jogamp.opengl.GL gl, com.jogamp.opengl.glu.GLU glu, ViewportConfiguration viewport, BoundingBox3d bounds)
-
renderAxeBox
public void renderAxeBox(com.jogamp.opengl.GL gl, com.jogamp.opengl.glu.GLU glu)
-
glModelView
public void glModelView(com.jogamp.opengl.GL gl)
-
renderSceneGraph
public void renderSceneGraph(com.jogamp.opengl.GL gl, com.jogamp.opengl.glu.GLU glu)
-
renderSceneGraph
public void renderSceneGraph(com.jogamp.opengl.GL gl, com.jogamp.opengl.glu.GLU glu, boolean light)
-
renderOverlay
public void renderOverlay(com.jogamp.opengl.GL gl)
-
renderOverlay
public void renderOverlay(com.jogamp.opengl.GL gl, ViewportConfiguration viewportConfiguration)
-
renderAnnotations
public void renderAnnotations(com.jogamp.opengl.GL gl, com.jogamp.opengl.glu.GLU glu)
-
current
public static View current()
-
getSpaceTransformer
public SpaceTransformer getSpaceTransformer()
-
setSpaceTransformer
public void setSpaceTransformer(SpaceTransformer transformer)
-
-
DMelt 3.0 © DataMelt by jWork.ORG