Package 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 Object
AViewholds 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 anAxisBoxfor embedding theSceneand getting values along axes.- Author:
- Martin Pernollet
-
-
Field Summary
Fields Modifier and Type Field Description protected Sceneannotationsprotected IAxisaxisprotected booleanaxisDisplayedprotected ColorbackgroundColorprotected ViewBoundModeboundmodeprotected Cameracamstatic floatCAMERA_RENDERING_SPHERE_RADIUS_FACTOR_VIEW_ON_TOPprotected CameraModecameraModeprotected floatcameraRenderingSphereRadiusFactorprotected floatcameraRenderingSphereRadiusFactorOnTopprotected ICanvascanvasprotected Coord3dcenterprotected Chartchartprotected booleandimensionDirtyprotected booleandisplayAxisWholeBoundsdisplay a magenta parallelepiped around the "whole bounds" of the axis (box + labels) for debugging purpose.static floatDISTANCE_DEFAULTprotected floatfactorViewPointDistanceApplies a factor to the default camera distance which is set to the radius of the scene bounds.protected booleanfirstprotected HiDPIhidpiprotected BoundingBox3dinitBoundsprotected static org.apache.log4j.LoggerLOGGERprotected booleanmaintainAllObjectsInViewforce to have all object maintained in screen, meaning axebox won't always keep the same size.protected IPainterpainterstatic floatPI_div2protected Coord2dpixelScaleprotected Qualityqualityprotected Coord3dscalingprotected Scenesceneprotected booleanslaveA slave view won't clear its color and depth buffer before renderingprotected SpaceTransformerspaceTransformerprotected booleansquaredprotected BoundingBox3dviewboundsprotected booleanviewDirtycan be set to true by the Renderer3d so that the View knows it is rendering due to a canvas size changeprotected List<IViewEventListener>viewEventListenersprotected List<IViewLifecycleEventListener>viewLifecycleListenersprotected ViewPositionModeviewmodeprotected IViewOverlayviewOverlayprotected Coord3dviewpointstatic Coord3dVIEWPOINT_AXIS_CORNER_TOUCH_BORDERA viewpoint where two corners of the axis box touch top and bottom lines of the canvas.static Coord3dVIEWPOINT_DEFAULTA nice viewpoint to start the chartprotected List<IViewPointChangedListener>viewPointChangedListenersprotected booleanwasOnTopAtLastRendering
-
Constructor Summary
Constructors Constructor Description View(IChartFactory factory, Scene scene, ICanvas canvas, Quality quality)Create a view attached to a Scene, with its own Camera and Axe.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description booleanaddViewEventListener(IViewEventListener listener)booleanaddViewLifecycleChangedListener(IViewLifecycleEventListener listener)booleanaddViewPointChangedListener(IViewPointChangedListener listener)voidclear()Clear the color and depth buffer.protected Coord3dcomputeCameraEye(Coord3d target)protected Coord3dcomputeCameraEye(Coord3d target, ViewPositionMode viewmode, Coord3d viewpoint)protected Coord3dcomputeCameraEyeFree(Coord3d viewpoint, Coord3d target)protected Coord3dcomputeCameraEyeProfile(Coord3d viewpoint, Coord3d target)protected Coord3dcomputeCameraEyeTop(Coord3d viewpoint, Coord3d target)voidcomputeCameraRenderingSphereRadius(Camera cam, ViewportConfiguration viewport, BoundingBox3d bounds)protected Coord3dcomputeCameraTarget()protected Coord3dcomputeCameraTarget(Coord3d center, Coord3d scaling)protected Coord3dcomputeCameraUp(Coord3d viewpoint)BoundingBox3dcomputeScaledViewBounds()Coord3dcomputeSceneScaling()Coord3dcomputeSceneScaling(Scene scene, boolean squared, ViewBoundMode boundmode, BoundingBox3d manualViewBounds, SpaceTransformer spaceTransformer)floatcomputeViewpointDistance(BoundingBox3d bounds, float sceneRadiusScaled, float factorViewPointDistance)protected voidconfigureHiDPIListener(ICanvas canvas)Upon pixel scale change, either at startup or during execution of the program, the listener will reconfigure the default font according to current HiDPI settings.protected voidcorrectCameraPositionForIncludingTextLabels(IPainter painter, ViewportConfiguration viewport)voiddispose()protected voidfireViewFirstRenderStarts()protected voidfireViewLifecycleHasInit(ViewLifecycleEvent e)protected voidfireViewLifecycleWillRender(ViewLifecycleEvent e)protected voidfireViewOnTopEvent(boolean isOnTop)protected voidfireViewPointChangedEvent(ViewPointChangedEvent e)GraphgetAnnotations()IAxisgetAxis()ColorgetBackgroundColor()BoundingBox3dgetBounds()Get theAxisBox'sBoundingBox3dViewBoundModegetBoundsMode()CameragetCamera()CameraModegetCameraMode()Get the projection of this view, either CameraMode.ORTHOGONAL or CameraMode.PERSPECTIVE.floatgetCameraRenderingSphereRadiusFactor()floatgetCameraRenderingSphereRadiusFactorOnTop()ICanvasgetCanvas()Coord3dgetCenter()Return the central point of the view scene, that is the last bounding box center set bylookToBox(org.jzy3d.maths.BoundingBox3d)ChartgetChart()HiDPIgetHiDPI()Return HiDPI status as ACTUALLY possible by the ICanvas on the current screen and computer, regardless of the {@link Quality#setHiDPIEnabled(true)}.BoundingBox3dgetInitBounds()Coord3dgetLastViewScaling()Return the last used view scaling that was set according to thesetSquared(boolean)status.IPaintergetPainter()Coord2dgetPixelScale()Return a copy of the currently known pixel scale as notified by the canvas.ScalegetScale()ScenegetScene()protected BoundingBox3dgetSceneGraphBounds()protected BoundingBox3dgetSceneGraphBounds(Scene scene)RectanglegetSceneViewportRectangle()SpaceTransformergetSpaceTransformer()booleangetSquared()ISquarifiergetSquarifier()ViewPositionModegetViewMode()Return theViewPositionModeapplied to this view.Coord3dgetViewPoint()Get the viewpoint.voidinit()The initialization function: specifies general GL settings that impact the rendering quality and performance (computation speed).protected voidinitBounds(Scene scene, BoundingBox3d manualViewBounds, BoundingBox3d initBounds)voidinitInstance(IChartFactory factory, Scene scene, ICanvas canvas, Quality quality)Initialize a view object.voidinitLights()voidinitLights(Scene scene)voidinitQuality()voidinitResources()booleanisAxisDisplayed()booleanisDisplayAxisWholeBounds()booleanisMaintainAllObjectsInView()booleanisSlave()voidlookToBox(BoundingBox3d box)voidmarkDimensionDirty()Might be invoked by aIScreenCanvasto indicate that dimension changed and that elements should be reprocessed at next rendering, e.g. 2d projections.voidproject()Perform the 2d projection of allSelectableobjects of the scene.Coord3dprojectMouse(int x, int y)Perform the 3d projection of a 2d coordinate.booleanremoveViewLifecycleChangedListener(IViewLifecycleEventListener listener)booleanremoveViewOnTopEventListener(IViewEventListener listener)booleanremoveViewPointChangedListener(IViewPointChangedListener listener)voidrender()voidrenderAnnotations(Camera camera)protected voidrenderAxeBox()protected voidrenderAxeBox(IAxis axe, Scene scene, Camera camera, Coord3d scaling, boolean axeBoxDisplayed)voidrenderBackground(float left, float right)To be implemented (see AWTView)voidrenderBackground(ViewportConfiguration backgroundViewPort)To be implemented (see AWTView)voidrenderOverlay()voidrenderOverlay(ViewportConfiguration viewportConfiguration)voidrenderScene()voidrenderScene(float left, float right)voidrenderScene(ViewportConfiguration viewport)voidrenderSceneGraph()voidrenderSceneGraph(boolean light)voidrenderSceneGraph(boolean light, Camera camera, Scene scene, Coord3d scaling)voidrotate(Coord2d move)GENERAL DISPLAY CONTROLSvoidrotate(Coord2d move, boolean updateView)voidsetAxis(IAxis axis)voidsetAxisDisplayed(boolean axisDisplayed)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.voidsetCameraRenderingSphereRadiusFactor(float cameraRenderingSphereRadiusFactor)This allows zooming the 3d scene by editing the camera rendering sphere.voidsetCameraRenderingSphereRadiusFactorOnTop(float cameraRenderingSphereRadiusFactorOnTop)This allows stretching the camera rendering sphere when the camera is on top of the scene (meaning we are drawing in 2D).voidsetChart(Chart chart)voidsetDisplayAxisWholeBounds(boolean displayAxisWholeBounds)voidsetInitBounds(BoundingBox3d initBounds)voidsetMaintainAllObjectsInView(boolean maintainAllObjectsInView)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)voidsetSquarifier(ISquarifier squarifier)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. the center of the scene).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.protected Coord3dsquarify()protected Coord3dsquarify(Scene scene, ViewBoundMode boundmode, BoundingBox3d manualViewBounds, SpaceTransformer spaceTransformer)Return a 3d scaling factor that allows scaling the scene into a square box, according to the current ViewBoundMode.protected Coord3dsquarifyComputeBoundsRanges(BoundingBox3d bounds)protected BoundingBox3dsquarifyGetSceneGraphBounds(Scene scene)protected voidtriggerCameraUpEvents(Coord3d viewpoint)voidupdateBounds()Set the bounds of the view according to the currentViewBoundMode, and orders a {@link Camera.shoot()}.voidupdateBoundsForceUpdate(boolean refresh)Update the bounds according to the scene graph whatever is the currentViewBoundMode, and orders a {@link Camera.shoot()}voidupdateCamera(ViewportConfiguration viewport, BoundingBox3d boundsScaled)voidupdateCamera(ViewportConfiguration viewport, BoundingBox3d bounds, float sceneRadiusScaled)voidupdateCamera(ViewportConfiguration viewport, BoundingBox3d bounds, float sceneRadiusScaled, ViewPositionMode viewmode, Coord3d viewpoint, Camera cam, CameraMode cameraMode, float factorViewPointDistance, Coord3d center, Coord3d scaling)voidupdateCameraWithoutShooting(ViewportConfiguration viewport, BoundingBox3d bounds, float sceneRadiusScaled, ViewPositionMode viewmode, Coord3d viewpoint, Camera cam, float factorViewPointDistance, Coord3d center, Coord3d scaling)Update the camera configuration without triggering theCamera.shoot(IPainter, CameraMode)method.voidupdateQuality()Deprecated.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
-
LOGGER
protected static org.apache.log4j.Logger LOGGER
-
cameraMode
protected CameraMode cameraMode
-
viewmode
protected ViewPositionMode viewmode
-
boundmode
protected ViewBoundMode boundmode
-
backgroundColor
protected Color backgroundColor
-
axisDisplayed
protected boolean axisDisplayed
-
squared
protected boolean squared
-
cameraRenderingSphereRadiusFactor
protected float cameraRenderingSphereRadiusFactor
-
cameraRenderingSphereRadiusFactorOnTop
protected float cameraRenderingSphereRadiusFactorOnTop
-
maintainAllObjectsInView
protected boolean maintainAllObjectsInView
force to have all object maintained in screen, meaning axebox won't always keep the same size.
-
displayAxisWholeBounds
protected boolean displayAxisWholeBounds
display a magenta parallelepiped around the "whole bounds" of the axis (box + labels) for debugging purpose.
-
cam
protected Camera cam
-
axis
protected IAxis axis
-
quality
protected Quality quality
-
scene
protected Scene scene
-
canvas
protected ICanvas canvas
-
painter
protected IPainter painter
-
annotations
protected Scene annotations
-
viewpoint
protected Coord3d viewpoint
-
center
protected Coord3d center
-
scaling
protected Coord3d scaling
-
viewbounds
protected BoundingBox3d viewbounds
-
chart
protected Chart chart
-
viewPointChangedListeners
protected List<IViewPointChangedListener> viewPointChangedListeners
-
viewEventListeners
protected List<IViewEventListener> viewEventListeners
-
viewLifecycleListeners
protected List<IViewLifecycleEventListener> viewLifecycleListeners
-
wasOnTopAtLastRendering
protected boolean wasOnTopAtLastRendering
-
first
protected boolean first
-
hidpi
protected HiDPI hidpi
-
pixelScale
protected Coord2d pixelScale
-
PI_div2
public static final float PI_div2
- See Also:
- Constant Field Values
-
DISTANCE_DEFAULT
public static final float DISTANCE_DEFAULT
- See Also:
- Constant Field Values
-
VIEWPOINT_DEFAULT
public static final Coord3d VIEWPOINT_DEFAULT
A nice viewpoint to start the chart
-
VIEWPOINT_AXIS_CORNER_TOUCH_BORDER
public static final Coord3d VIEWPOINT_AXIS_CORNER_TOUCH_BORDER
A viewpoint where two corners of the axis box touch top and bottom lines of the canvas.
-
dimensionDirty
protected boolean dimensionDirty
-
viewDirty
protected boolean viewDirty
can be set to true by the Renderer3d so that the View knows it is rendering due to a canvas size change
-
initBounds
protected BoundingBox3d initBounds
-
factorViewPointDistance
protected float factorViewPointDistance
Applies a factor to the default camera distance which is set to the radius of the scene bounds. Changing this value also change the camera clipping planes.
-
slave
protected boolean slave
A slave view won't clear its color and depth buffer before rendering
-
spaceTransformer
protected SpaceTransformer spaceTransformer
-
viewOverlay
protected IViewOverlay viewOverlay
-
CAMERA_RENDERING_SPHERE_RADIUS_FACTOR_VIEW_ON_TOP
public static float CAMERA_RENDERING_SPHERE_RADIUS_FACTOR_VIEW_ON_TOP
-
-
Constructor Detail
-
View
public View(IChartFactory 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
-
initInstance
public void initInstance(IChartFactory factory, Scene scene, ICanvas canvas, Quality quality)
Initialize a view object. Invoked by constructor Method name is made clear to avoid confusion withinit()which initialize open GL context.- Parameters:
factory-scene-canvas-quality-
-
configureHiDPIListener
protected void configureHiDPIListener(ICanvas canvas)
Upon pixel scale change, either at startup or during execution of the program, the listener will reconfigure the default font according to current HiDPI settings. This will reconfigure anything that draws based onAxisLayout.getFont(), hence:- the font of the axis text renderer
- the font of the colorbar
-
getPixelScale
public Coord2d getPixelScale()
Return a copy of the currently known pixel scale as notified by the canvas. If the View received no pixel scale change event, the pixel scale will be 0.
-
getHiDPI
public HiDPI getHiDPI()
Return HiDPI status as ACTUALLY possible by the ICanvas on the current screen and computer, regardless of the {@link Quality#setHiDPIEnabled(true)}. Will always returnHiDPI.OFFis chart is set to {@link Quality#setHiDPIEnabled(false)} as this forces the canvas to NOT make use of HiDPI.- Returns:
-
getPainter
public IPainter getPainter()
-
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()
Perform the 2d projection of allSelectableobjects of the scene. The result of the projection can be retrieved on the objects's instances.
-
projectMouse
public Coord3d projectMouse(int x, int y)
Perform the 3d projection of a 2d coordinate.
-
markDimensionDirty
public void markDimensionDirty()
Might be invoked by aIScreenCanvasto indicate that dimension changed and that elements should be reprocessed at next rendering, e.g. 2d projections.
-
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.
-
setScale
public void setScale(Scale scale, boolean notify)
Z scale.
-
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)
-
getCenter
public Coord3d getCenter()
Return the central point of the view scene, that is the last bounding box center set bylookToBox(org.jzy3d.maths.BoundingBox3d)
-
getBounds
public BoundingBox3d getBounds()
Get theAxisBox'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.
-
getViewPoint
public Coord3d getViewPoint()
Get the viewpoint. The Z dimension is the one defined byupdateCamera(), which depends on the view scaling.
-
getLastViewScaling
public Coord3d getLastViewScaling()
Return the last used view scaling that was set according to thesetSquared(boolean)status.
-
setAxis
public void setAxis(IAxis axis)
-
getAxis
public IAxis getAxis()
-
getSquared
public boolean getSquared()
-
setSquared
public void setSquared(boolean status)
-
isAxisDisplayed
public boolean isAxisDisplayed()
-
setAxisDisplayed
public void setAxisDisplayed(boolean axisDisplayed)
-
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)
-
getCameraRenderingSphereRadiusFactor
public float getCameraRenderingSphereRadiusFactor()
- See Also:
setter
-
setCameraRenderingSphereRadiusFactor
public void setCameraRenderingSphereRadiusFactor(float cameraRenderingSphereRadiusFactor)
This allows zooming the 3d scene by editing the camera rendering sphere.- A value of 1 allows having an AxisBox with corners touching the top/bottom part of the canvas.
- A value greater than 1 makes the rendering sphere bigger, hence the AxisBox appears smaller.
-
getCameraRenderingSphereRadiusFactorOnTop
public float getCameraRenderingSphereRadiusFactorOnTop()
- See Also:
setter
-
setCameraRenderingSphereRadiusFactorOnTop
public void setCameraRenderingSphereRadiusFactorOnTop(float cameraRenderingSphereRadiusFactorOnTop)
This allows stretching the camera rendering sphere when the camera is on top of the scene (meaning we are drawing in 2D).
-
isMaintainAllObjectsInView
public boolean isMaintainAllObjectsInView()
-
setMaintainAllObjectsInView
public void setMaintainAllObjectsInView(boolean maintainAllObjectsInView)
-
isDisplayAxisWholeBounds
public boolean isDisplayAxisWholeBounds()
-
setDisplayAxisWholeBounds
public void setDisplayAxisWholeBounds(boolean displayAxisWholeBounds)
-
getScene
public Scene getScene()
-
getSceneViewportRectangle
public Rectangle getSceneViewportRectangle()
-
getCanvas
public ICanvas getCanvas()
-
getAnnotations
public Graph getAnnotations()
-
addViewEventListener
public boolean addViewEventListener(IViewEventListener listener)
-
removeViewOnTopEventListener
public boolean removeViewOnTopEventListener(IViewEventListener listener)
-
fireViewOnTopEvent
protected void fireViewOnTopEvent(boolean isOnTop)
-
fireViewFirstRenderStarts
protected void fireViewFirstRenderStarts()
-
addViewPointChangedListener
public boolean addViewPointChangedListener(IViewPointChangedListener listener)
-
removeViewPointChangedListener
public boolean removeViewPointChangedListener(IViewPointChangedListener listener)
-
fireViewPointChangedEvent
protected void fireViewPointChangedEvent(ViewPointChangedEvent e)
-
addViewLifecycleChangedListener
public boolean addViewLifecycleChangedListener(IViewLifecycleEventListener listener)
-
removeViewLifecycleChangedListener
public boolean removeViewLifecycleChangedListener(IViewLifecycleEventListener listener)
-
fireViewLifecycleHasInit
protected void fireViewLifecycleHasInit(ViewLifecycleEvent e)
-
fireViewLifecycleWillRender
protected void fireViewLifecycleWillRender(ViewLifecycleEvent e)
-
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 a {@link Camera.shoot()}.
-
getSceneGraphBounds
protected BoundingBox3d getSceneGraphBounds()
-
getSceneGraphBounds
protected BoundingBox3d getSceneGraphBounds(Scene scene)
-
updateBoundsForceUpdate
public void updateBoundsForceUpdate(boolean refresh)
Update the bounds according to the scene graph whatever is the currentViewBoundMode, and orders a {@link Camera.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.
-
init
public void init()
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.
-
initBounds
protected void initBounds(Scene scene, BoundingBox3d manualViewBounds, BoundingBox3d initBounds)
-
getInitBounds
public BoundingBox3d getInitBounds()
-
setInitBounds
public void setInitBounds(BoundingBox3d initBounds)
-
initQuality
public void initQuality()
-
initLights
public void initLights()
-
initLights
public void initLights(Scene scene)
-
initResources
public void initResources()
-
clear
public void clear()
Clear the color and depth buffer.
-
render
public void render()
-
renderBackground
public void renderBackground(float left, float right)To be implemented (see AWTView)
-
renderBackground
public void renderBackground(ViewportConfiguration backgroundViewPort)
To be implemented (see AWTView)
-
renderScene
public void renderScene()
-
renderScene
public void renderScene(float left, float right)
-
renderScene
public void renderScene(ViewportConfiguration viewport)
-
updateQuality
@Deprecated public void updateQuality()
Deprecated.Not called anymore as alpha and blending setting are not supposed to change during lifetime of a chart. If this should change, then the entireinitQuality()method should be invoked
-
squarify
protected Coord3d squarify()
-
squarify
protected Coord3d squarify(Scene scene, ViewBoundMode boundmode, BoundingBox3d manualViewBounds, SpaceTransformer spaceTransformer)
Return a 3d scaling factor that allows scaling the scene into a square box, according to the current ViewBoundMode. If the scene bounds are Infinite, NaN or zero, for a given dimension, the scaler will be set to 1 on the given dimension.- Returns:
- a scaling factor for each dimension.
-
squarifyGetSceneGraphBounds
protected BoundingBox3d squarifyGetSceneGraphBounds(Scene scene)
-
squarifyComputeBoundsRanges
protected Coord3d squarifyComputeBoundsRanges(BoundingBox3d bounds)
-
computeScaledViewBounds
public BoundingBox3d computeScaledViewBounds()
-
computeSceneScaling
public Coord3d computeSceneScaling()
-
computeSceneScaling
public Coord3d computeSceneScaling(Scene scene, boolean squared, ViewBoundMode boundmode, BoundingBox3d manualViewBounds, SpaceTransformer spaceTransformer)
-
updateCamera
public void updateCamera(ViewportConfiguration viewport, BoundingBox3d boundsScaled)
-
updateCamera
public void updateCamera(ViewportConfiguration viewport, BoundingBox3d bounds, float sceneRadiusScaled)
-
updateCamera
public void updateCamera(ViewportConfiguration viewport, BoundingBox3d bounds, float sceneRadiusScaled, ViewPositionMode viewmode, Coord3d viewpoint, Camera cam, CameraMode cameraMode, float factorViewPointDistance, Coord3d center, Coord3d scaling)
-
updateCameraWithoutShooting
public void updateCameraWithoutShooting(ViewportConfiguration viewport, BoundingBox3d bounds, float sceneRadiusScaled, ViewPositionMode viewmode, Coord3d viewpoint, Camera cam, float factorViewPointDistance, Coord3d center, Coord3d scaling)
Update the camera configuration without triggering theCamera.shoot(IPainter, CameraMode)method. This is useful in rare case where one need to manually invoke only a subset of OpenGL methods that are invoked by shoot method.
-
computeViewpointDistance
public float computeViewpointDistance(BoundingBox3d bounds, float sceneRadiusScaled, float factorViewPointDistance)
-
computeCameraTarget
protected Coord3d computeCameraTarget()
-
computeCameraEye
protected Coord3d computeCameraEye(Coord3d target, ViewPositionMode viewmode, Coord3d viewpoint)
-
computeCameraEyeProfile
protected Coord3d computeCameraEyeProfile(Coord3d viewpoint, Coord3d target)
-
triggerCameraUpEvents
protected void triggerCameraUpEvents(Coord3d viewpoint)
-
computeCameraRenderingSphereRadius
public void computeCameraRenderingSphereRadius(Camera cam, ViewportConfiguration viewport, BoundingBox3d bounds)
-
correctCameraPositionForIncludingTextLabels
protected void correctCameraPositionForIncludingTextLabels(IPainter painter, ViewportConfiguration viewport)
-
renderAxeBox
protected void renderAxeBox()
-
renderAxeBox
protected void renderAxeBox(IAxis axe, Scene scene, Camera camera, Coord3d scaling, boolean axeBoxDisplayed)
-
renderSceneGraph
public void renderSceneGraph()
-
renderSceneGraph
public void renderSceneGraph(boolean light)
-
renderSceneGraph
public void renderSceneGraph(boolean light, Camera camera, Scene scene, Coord3d scaling)
-
renderOverlay
public void renderOverlay()
-
renderOverlay
public void renderOverlay(ViewportConfiguration viewportConfiguration)
-
renderAnnotations
public void renderAnnotations(Camera camera)
-
getSpaceTransformer
public SpaceTransformer getSpaceTransformer()
-
setSpaceTransformer
public void setSpaceTransformer(SpaceTransformer transformer)
-
setSquarifier
public void setSquarifier(ISquarifier squarifier)
-
getSquarifier
public ISquarifier getSquarifier()
-
-