|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jzy3d.plot3d.rendering.view.View
public class View
A View
holds a Scene
, a LightSet
, an ICanvas
to render into. It is the responsability to layout a set of concrete
AbstractViewportManager
s such as the rendering the scene
or an AWTImageViewport
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
Renderer2d
s whose implementation can define Java2d calls to render on
top on OpenGL2.
Last, the View
offers the ability to get an AxeBox
for
embedding the Scene
and getting values along axes.
Field Summary | |
---|---|
protected Scene |
annotations
|
protected IAxe |
axe
|
protected boolean |
axeBoxDisplayed
|
protected Color |
bgColor
|
protected ViewBoundMode |
boundmode
|
protected Camera |
cam
|
protected CameraMode |
cameraMode
|
protected ICanvas |
canvas
|
protected Coord3d |
center
|
protected Chart |
chart
A view may optionnaly know its parent chart. |
protected static View |
current
|
static Coord3d |
DEFAULT_VIEW
|
protected boolean |
dimensionDirty
|
protected boolean |
DISPLAY_AXE_WHOLE_BOUNDS
|
protected float |
factorViewPointDistance
Applies a factor to the default camera distance which is set to the radius of the scene bounds. |
protected javax.media.opengl.glu.GLU |
glu
|
protected BoundingBox3d |
initBounds
|
protected boolean |
MAINTAIN_ALL_OBJECTS_IN_VIEW
|
protected com.jogamp.opengl.util.awt.Overlay |
overlay
|
protected static float |
PI_div2
|
protected Quality |
quality
|
protected Coord3d |
scaling
|
protected Scene |
scene
|
protected boolean |
slave
A slave view won't clear its color and depth buffer before rendering |
protected boolean |
squared
|
static float |
STRETCH_RATIO
|
protected BoundingBox3d |
viewbounds
|
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 |
protected List<IViewLifecycleEventListener> |
viewLifecycleListeners
|
protected ViewPositionMode |
viewmode
|
protected List<IViewIsVerticalEventListener> |
viewOnTopListeners
|
protected Coord3d |
viewpoint
|
protected List<IViewPointChangedListener> |
viewPointChangedListeners
|
protected boolean |
wasOnTopAtLastRendering
|
Constructor Summary | |
---|---|
View(IChartComponentFactory factory,
Scene scene,
ICanvas canvas,
Quality quality)
Create a view attached to a Scene, with its own Camera and Axe. |
Method Summary | |
---|---|
boolean |
addViewLifecycleChangedListener(IViewLifecycleEventListener listener)
|
boolean |
addViewOnTopEventListener(IViewIsVerticalEventListener listener)
|
boolean |
addViewPointChangedListener(IViewPointChangedListener listener)
|
void |
clear(javax.media.opengl.GL gl)
Clear the color and depth buffer. |
void |
clearColorAndDepth(javax.media.opengl.GL gl)
|
BoundingBox3d |
computeScaling()
|
Coord3d |
computeSceneScaling()
|
protected void |
correctCameraPositionForIncludingTextLabels(javax.media.opengl.GL gl,
javax.media.opengl.glu.GLU glu,
ViewportConfiguration viewport)
|
static View |
current()
|
void |
dispose()
|
protected void |
fireViewLifecycleHasInit(ViewLifecycleEvent e)
|
protected void |
fireViewLifecycleWillRender(ViewLifecycleEvent e)
|
protected void |
fireViewOnTopEvent(boolean isOnTop)
|
protected void |
fireViewPointChangedEvent(ViewPointChangedEvent e)
|
Graph |
getAnnotations()
|
IAxe |
getAxe()
|
Color |
getBackgroundColor()
|
BoundingBox3d |
getBounds()
Get the AxeBox 's BoundingBox3d |
ViewBoundMode |
getBoundsMode()
|
Camera |
getCamera()
|
CameraMode |
getCameraMode()
Get the projection of this view, either CameraMode.ORTHOGONAL or CameraMode.PERSPECTIVE. |
ICanvas |
getCanvas()
|
protected javax.media.opengl.GLAutoDrawable |
getCanvasAsGLAutoDrawable()
|
Coord3d |
getCenter()
Return the central point of the view scene, that is the last bounding box center set by lookToBox(BoundingBox3d box) |
Chart |
getChart()
|
javax.media.opengl.GLContext |
getCurrentContext()
|
javax.media.opengl.GL |
getCurrentGL()
|
BoundingBox3d |
getInitBounds()
|
Coord3d |
getLastViewScaling()
Return the last used view scaling that was set according to the setSquared(boolean v) status. |
Scale |
getScale()
|
Scene |
getScene()
|
Rectangle |
getSceneViewportRectangle()
|
boolean |
getSquared()
|
ViewPositionMode |
getViewMode()
Return the ViewPositionMode applied to this view. |
Coord3d |
getViewPoint()
Get the viewpoint. |
void |
init(javax.media.opengl.GL gl)
The initialization function: specifies general GL settings that impact the rendering quality and performance (computation speed). |
void |
initLights(javax.media.opengl.GL gl)
|
void |
initQuality(javax.media.opengl.GL gl)
|
void |
initResources(javax.media.opengl.GL gl)
|
boolean |
isAxeBoxDisplayed()
|
boolean |
isSlave()
|
void |
lookToBox(BoundingBox3d box)
Set the surrounding AxeBox dimensions and the Camera target, and the colorbar range. |
void |
project()
|
Coord3d |
projectMouse(int x,
int y)
|
boolean |
removeViewLifecycleChangedListener(IViewLifecycleEventListener listener)
|
boolean |
removeViewOnTopEventListener(IViewIsVerticalEventListener listener)
|
boolean |
removeViewPointChangedListener(IViewPointChangedListener listener)
|
void |
render(javax.media.opengl.GL gl,
javax.media.opengl.glu.GLU glu)
|
void |
renderAnnotations(javax.media.opengl.GL gl,
javax.media.opengl.glu.GLU glu)
|
void |
renderAxeBox(javax.media.opengl.GL gl,
javax.media.opengl.glu.GLU glu)
|
void |
renderBackground(javax.media.opengl.GL gl,
javax.media.opengl.glu.GLU glu2,
float f,
float g)
|
void |
renderBackground(javax.media.opengl.GL gl,
javax.media.opengl.glu.GLU glu2,
ViewportConfiguration backgroundViewPort)
|
void |
renderOverlay(javax.media.opengl.GL gl)
|
void |
renderOverlay(javax.media.opengl.GL gl,
ViewportConfiguration viewportConfiguration)
|
void |
renderScene(javax.media.opengl.GL gl,
javax.media.opengl.glu.GLU glu)
|
void |
renderScene(javax.media.opengl.GL gl,
javax.media.opengl.glu.GLU glu,
float left,
float right)
|
void |
renderScene(javax.media.opengl.GL gl,
javax.media.opengl.glu.GLU glu,
ViewportConfiguration viewport)
|
void |
renderSceneGraph(javax.media.opengl.GL gl,
javax.media.opengl.glu.GLU glu)
|
void |
renderSceneGraph(javax.media.opengl.GL gl,
javax.media.opengl.glu.GLU glu,
boolean light)
|
void |
rotate(Coord2d move)
GENERAL DISPLAY CONTROLS |
void |
rotate(Coord2d move,
boolean updateView)
|
void |
setAxe(IAxe ax)
|
void |
setAxeBoxDisplayed(boolean axeBoxDisplayed)
|
void |
setBackgroundColor(Color color)
|
void |
setBoundManual(BoundingBox3d bounds)
Set a manual bounding box and switch the bounding mode to {ViewBoundMode.MANUAL}, meaning that any call to updateBounds()
will update view bounds to the current bounds. |
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 |
setChart(Chart chart)
|
void |
setInitBounds(BoundingBox3d initBounds)
|
void |
setMaximized(boolean status)
|
void |
setScale(Scale scale)
|
void |
setScale(Scale scale,
boolean notify)
|
void |
setSlave(boolean slave)
|
void |
setSquared(boolean status)
|
void |
setViewPoint(Coord3d polar)
Set the viewpoint and query a view update. |
void |
setViewPoint(Coord3d polar,
boolean updateView)
Set the viewpoint using polar coordinates relative to the target (i.e. |
void |
setViewPositionMode(ViewPositionMode mode)
Set the ViewPositionMode applied to this view. |
void |
shift(float factor)
|
void |
shift(float factor,
boolean updateView)
|
void |
shoot()
Current view selection into the mother Scene, and call to target canvas rendering. |
protected Coord3d |
squarify()
Return a 3d scaling factor that allows scaling the scene into a square box, according to the current ViewBoundMode. |
void |
updateBounds()
Set the bounds of the view according to the current ViewBoundMode
, and orders a Camera.shoot() . |
void |
updateBoundsForceUpdate(boolean refresh)
Update the bounds according to the scene graph whatever is the current ViewBoundMode , and orders a Camera.shoot() |
void |
updateCamera(javax.media.opengl.GL gl,
javax.media.opengl.glu.GLU glu,
ViewportConfiguration viewport,
BoundingBox3d boundsScaled)
|
void |
updateCamera(javax.media.opengl.GL gl,
javax.media.opengl.glu.GLU glu,
ViewportConfiguration viewport,
BoundingBox3d boundsScaled,
float sceneRadiusScaled)
|
void |
updateQuality(javax.media.opengl.GL gl)
|
void |
zoom(float factor)
|
void |
zoom(float factor,
boolean updateView)
|
void |
zoomX(float factor)
|
void |
zoomX(float factor,
boolean updateView)
|
void |
zoomY(float factor)
|
void |
zoomY(float factor,
boolean updateView)
|
void |
zoomZ(float factor)
|
void |
zoomZ(float factor,
boolean updateView)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected Chart chart
protected javax.media.opengl.glu.GLU glu
public static float STRETCH_RATIO
protected boolean MAINTAIN_ALL_OBJECTS_IN_VIEW
protected boolean DISPLAY_AXE_WHOLE_BOUNDS
protected boolean axeBoxDisplayed
protected boolean squared
protected Camera cam
protected IAxe axe
protected Quality quality
protected com.jogamp.opengl.util.awt.Overlay overlay
protected Scene scene
protected ICanvas canvas
protected Scene annotations
protected Coord3d viewpoint
protected Coord3d center
protected Coord3d scaling
protected BoundingBox3d viewbounds
protected CameraMode cameraMode
protected ViewPositionMode viewmode
protected ViewBoundMode boundmode
protected Color bgColor
protected List<IViewPointChangedListener> viewPointChangedListeners
protected List<IViewIsVerticalEventListener> viewOnTopListeners
protected List<IViewLifecycleEventListener> viewLifecycleListeners
protected boolean wasOnTopAtLastRendering
protected static final float PI_div2
public static final Coord3d DEFAULT_VIEW
protected boolean dimensionDirty
protected boolean viewDirty
protected static View current
protected BoundingBox3d initBounds
protected float factorViewPointDistance
protected boolean slave
Constructor Detail |
---|
public View(IChartComponentFactory factory, Scene scene, ICanvas canvas, Quality quality)
View.DEFAULT_VIEW
.
The Quality
allows setting the rendering capabilities that are
set one time by the init() method.
Method Detail |
---|
public Chart getChart()
public void setChart(Chart chart)
public boolean isSlave()
public void setSlave(boolean slave)
public void dispose()
public void shoot()
public void project()
public Coord3d projectMouse(int x, int y)
public void rotate(Coord2d move)
public void rotate(Coord2d move, boolean updateView)
public void shift(float factor)
public void shift(float factor, boolean updateView)
public void zoom(float factor)
public void zoom(float factor, boolean updateView)
public void zoomX(float factor)
public void zoomX(float factor, boolean updateView)
public void zoomY(float factor)
public void zoomY(float factor, boolean updateView)
public void zoomZ(float factor)
public void zoomZ(float factor, boolean updateView)
public void setScale(Scale scale)
public void setScale(Scale scale, boolean notify)
public Scale getScale()
public void lookToBox(BoundingBox3d box)
public Coord3d getCenter()
lookToBox(BoundingBox3d box)
public BoundingBox3d getBounds()
AxeBox
's BoundingBox3d
public ViewBoundMode getBoundsMode()
public void setViewPositionMode(ViewPositionMode mode)
ViewPositionMode
applied to this view.
public ViewPositionMode getViewMode()
ViewPositionMode
applied to this view.
public void setViewPoint(Coord3d polar, boolean updateView)
updateCamera()
.
public void setViewPoint(Coord3d polar)
setViewPoint(Coord3d polar, boolean updateView)}
public Coord3d getViewPoint()
updateCamera()
, which depends on the view scaling.
setViewPoint(Coord3d polar, boolean updateView)}
public Coord3d getLastViewScaling()
setSquared(boolean v)
status.
public void setAxe(IAxe ax)
public IAxe getAxe()
public boolean getSquared()
public void setSquared(boolean status)
public boolean isAxeBoxDisplayed()
public void setAxeBoxDisplayed(boolean axeBoxDisplayed)
public void setBackgroundColor(Color color)
public Color getBackgroundColor()
public Camera getCamera()
public void setCameraMode(CameraMode mode)
public CameraMode getCameraMode()
public void setMaximized(boolean status)
public Scene getScene()
public Rectangle getSceneViewportRectangle()
public ICanvas getCanvas()
public Graph getAnnotations()
public boolean addViewOnTopEventListener(IViewIsVerticalEventListener listener)
public boolean removeViewOnTopEventListener(IViewIsVerticalEventListener listener)
protected void fireViewOnTopEvent(boolean isOnTop)
public boolean addViewPointChangedListener(IViewPointChangedListener listener)
public boolean removeViewPointChangedListener(IViewPointChangedListener listener)
protected void fireViewPointChangedEvent(ViewPointChangedEvent e)
public boolean addViewLifecycleChangedListener(IViewLifecycleEventListener listener)
public boolean removeViewLifecycleChangedListener(IViewLifecycleEventListener listener)
protected void fireViewLifecycleHasInit(ViewLifecycleEvent e)
protected void fireViewLifecycleWillRender(ViewLifecycleEvent e)
public void setBoundMode(ViewBoundMode mode)
public void updateBounds()
ViewBoundMode
, and orders a Camera.shoot()
.
public void updateBoundsForceUpdate(boolean refresh)
ViewBoundMode
, and orders a Camera.shoot()
public void setBoundManual(BoundingBox3d bounds)
updateBounds()
will update view bounds to the current bounds.
protected Coord3d squarify()
public javax.media.opengl.GL getCurrentGL()
public javax.media.opengl.GLContext getCurrentContext()
protected javax.media.opengl.GLAutoDrawable getCanvasAsGLAutoDrawable()
public void init(javax.media.opengl.GL gl)
Quality
given in the
constructor parameters.
public BoundingBox3d getInitBounds()
public void setInitBounds(BoundingBox3d initBounds)
public void initQuality(javax.media.opengl.GL gl)
public void initLights(javax.media.opengl.GL gl)
public void initResources(javax.media.opengl.GL gl)
public void clear(javax.media.opengl.GL gl)
public void clearColorAndDepth(javax.media.opengl.GL gl)
public void render(javax.media.opengl.GL gl, javax.media.opengl.glu.GLU glu)
public void renderBackground(javax.media.opengl.GL gl, javax.media.opengl.glu.GLU glu2, float f, float g)
public void renderBackground(javax.media.opengl.GL gl, javax.media.opengl.glu.GLU glu2, ViewportConfiguration backgroundViewPort)
public void renderScene(javax.media.opengl.GL gl, javax.media.opengl.glu.GLU glu)
public void renderScene(javax.media.opengl.GL gl, javax.media.opengl.glu.GLU glu, float left, float right)
public void renderScene(javax.media.opengl.GL gl, javax.media.opengl.glu.GLU glu, ViewportConfiguration viewport)
public void updateQuality(javax.media.opengl.GL gl)
public BoundingBox3d computeScaling()
public Coord3d computeSceneScaling()
public void updateCamera(javax.media.opengl.GL gl, javax.media.opengl.glu.GLU glu, ViewportConfiguration viewport, BoundingBox3d boundsScaled)
public void updateCamera(javax.media.opengl.GL gl, javax.media.opengl.glu.GLU glu, ViewportConfiguration viewport, BoundingBox3d boundsScaled, float sceneRadiusScaled)
public void renderAxeBox(javax.media.opengl.GL gl, javax.media.opengl.glu.GLU glu)
public void renderSceneGraph(javax.media.opengl.GL gl, javax.media.opengl.glu.GLU glu)
public void renderSceneGraph(javax.media.opengl.GL gl, javax.media.opengl.glu.GLU glu, boolean light)
public void renderOverlay(javax.media.opengl.GL gl)
public void renderOverlay(javax.media.opengl.GL gl, ViewportConfiguration viewportConfiguration)
public void renderAnnotations(javax.media.opengl.GL gl, javax.media.opengl.glu.GLU glu)
protected void correctCameraPositionForIncludingTextLabels(javax.media.opengl.GL gl, javax.media.opengl.glu.GLU glu, ViewportConfiguration viewport)
public static View current()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |