Class Display3D
- java.lang.Object
-
- repast.simphony.visualization.AbstractDisplay
-
- repast.simphony.visualization.visualization3D.AbstractDisplay3D
-
- repast.simphony.visualization.visualization3D.Display3D
-
- All Implemented Interfaces:
WindowListener
,EventListener
,Renderer
,ProjectionListener
,IDisplay
public class Display3D extends AbstractDisplay3D
3D Display class based on J3D. Uses a behavior to update the display.- Author:
- Nick Collier
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface repast.simphony.visualization.IDisplay
IDisplay.LayoutFrequency
-
-
Field Summary
Fields Modifier and Type Field Description protected Color
backgroundColor
protected org.jogamp.java3d.exp.swing.JCanvas3D
canvas
protected EdgeStyle3D
defaultEdgeStyle
protected Style3D
defaultStyle
protected boolean
firstRender
protected org.jogamp.java3d.utils.pickfast.PickCanvas
pick
protected org.jogamp.java3d.TransformGroup
projectionTransGroup
protected org.jogamp.java3d.BranchGroup
sceneRoot
protected org.jogamp.java3d.TransformGroup
topRotTransGroup
static int
TRANSFORMS_APPLIED
protected org.jogamp.java3d.utils.universe.SimpleUniverse
universe
protected boolean
updatedLastRender
protected repast.simphony.visualization.visualization3D.Display3D.MainBehavior
updater
protected org.jogamp.java3d.TransformGroup
valueLayerTransGroup
-
Fields inherited from class repast.simphony.visualization.visualization3D.AbstractDisplay3D
decoratorMap, displayMap, iconified, initData, layout, networkMap, panel, valueLayer, valueLayerStyle
-
Fields inherited from class repast.simphony.visualization.AbstractDisplay
dlSupport, FRAME_UPDATE_INTERVAL, INFO_CURSOR, lastRenderTS, probeSupport
-
-
Constructor Summary
Constructors Constructor Description Display3D(DisplayData<?> data, Layout layout)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
closed()
Notifies this IDisplay that its associated gui widget has been closed.protected AbstractDisplayLayer3D
createDisplayLayer(Style3D style)
AbstractDisplayLayer3D
createEdgeLayer(EdgeStyle3D style, Network network)
DisplayEditorLifecycle
createEditor(JPanel panel)
Creates an DisplayEditor appropriate for editing this display.ValueDisplayLayer3D
createValueLayerDisplayLayer(ValueLayerStyle3D style)
void
deIconified()
Notifies this IDisplay that its associated gui widget has been deIconified.void
destroy()
Destroys the display, allowing it to free any resources it may have acquired.org.jogamp.java3d.exp.swing.JCanvas3D
getCanvas()
Layout
getLayout()
Gets the layout the display usesJPanel
getPanel()
Gets a panel that contains the actual gui for visualization.org.jogamp.java3d.BranchGroup
getSceneRoot()
VisualItem3D
getVisualObject(Object obj)
void
iconified()
Notifies this IDisplay that its associated gui widget has been iconified.void
init()
Initializes the display.void
probe(org.jogamp.java3d.Shape3D shape, org.jogamp.vecmath.Point3d intersectPoint)
Given the shape3D, probe the object that it represents.void
render()
Render the display.void
resetHomeView()
Resets the view to the original zoom and camera positionvoid
setBackgroundColor(Color backgroundColor)
void
setPause(boolean pause)
Pause the rendering.void
toggleInfoProbe()
void
windowDeiconified(WindowEvent e)
-
Methods inherited from class repast.simphony.visualization.visualization3D.AbstractDisplay3D
addObject, createPanel, findLayer, getInitData, getRegisteredAgents, moveObject, registerDecorator, registerNetworkStyle, registerStyle, registerValueLayerStyle, removeObject, setLayout, setLayoutFrequency, update, windowActivated, windowClosed, windowClosing, windowDeactivated, windowIconified, windowOpened
-
Methods inherited from class repast.simphony.visualization.AbstractDisplay
addDisplayListener, addProbeListener, createInfoCursor, getProbeSupport, projectionEventOccurred, registerToolBar, setProbeSupport
-
-
-
-
Field Detail
-
TRANSFORMS_APPLIED
public static final int TRANSFORMS_APPLIED
- See Also:
- Constant Field Values
-
defaultStyle
protected Style3D defaultStyle
-
defaultEdgeStyle
protected EdgeStyle3D defaultEdgeStyle
-
firstRender
protected boolean firstRender
-
backgroundColor
protected Color backgroundColor
-
pick
protected org.jogamp.java3d.utils.pickfast.PickCanvas pick
-
canvas
protected org.jogamp.java3d.exp.swing.JCanvas3D canvas
-
sceneRoot
protected org.jogamp.java3d.BranchGroup sceneRoot
-
universe
protected org.jogamp.java3d.utils.universe.SimpleUniverse universe
-
updater
protected repast.simphony.visualization.visualization3D.Display3D.MainBehavior updater
-
topRotTransGroup
protected org.jogamp.java3d.TransformGroup topRotTransGroup
-
projectionTransGroup
protected org.jogamp.java3d.TransformGroup projectionTransGroup
-
valueLayerTransGroup
protected org.jogamp.java3d.TransformGroup valueLayerTransGroup
-
updatedLastRender
protected boolean updatedLastRender
-
-
Constructor Detail
-
Display3D
public Display3D(DisplayData<?> data, Layout layout)
-
-
Method Detail
-
init
public void init()
Description copied from interface:IDisplay
Initializes the display. Called once before the display is made visible.- Specified by:
init
in interfaceIDisplay
- Overrides:
init
in classAbstractDisplay3D
-
getCanvas
public org.jogamp.java3d.exp.swing.JCanvas3D getCanvas()
- Specified by:
getCanvas
in classAbstractDisplay3D
-
getSceneRoot
public org.jogamp.java3d.BranchGroup getSceneRoot()
-
probe
public void probe(org.jogamp.java3d.Shape3D shape, org.jogamp.vecmath.Point3d intersectPoint)
Given the shape3D, probe the object that it represents.- Parameters:
shape
- the shape representing the object we want to probeintersectPoint
- the intersection point of the pick itself
-
getVisualObject
public VisualItem3D getVisualObject(Object obj)
-
createDisplayLayer
protected AbstractDisplayLayer3D createDisplayLayer(Style3D style)
- Specified by:
createDisplayLayer
in classAbstractDisplay3D
-
createEdgeLayer
public AbstractDisplayLayer3D createEdgeLayer(EdgeStyle3D style, Network network)
- Specified by:
createEdgeLayer
in classAbstractDisplay3D
-
createValueLayerDisplayLayer
public ValueDisplayLayer3D createValueLayerDisplayLayer(ValueLayerStyle3D style)
- Specified by:
createValueLayerDisplayLayer
in classAbstractDisplay3D
-
getPanel
public JPanel getPanel()
Description copied from interface:IDisplay
Gets a panel that contains the actual gui for visualization.- Returns:
- a panel that contains the actual gui for visualization.
-
render
public void render()
Description copied from interface:Renderer
Render the display. This rendering should take place asynchronously on the AWT thread.
-
setPause
public void setPause(boolean pause)
Description copied from interface:Renderer
Pause the rendering. The Renderer should update and render if pause is true, if possible. The rendering should take place asynchronously on the AWT thread.
-
closed
public void closed()
Notifies this IDisplay that its associated gui widget has been closed.
-
iconified
public void iconified()
Notifies this IDisplay that its associated gui widget has been iconified.
-
deIconified
public void deIconified()
Notifies this IDisplay that its associated gui widget has been deIconified.
-
destroy
public void destroy()
Description copied from class:AbstractDisplay
Destroys the display, allowing it to free any resources it may have acquired.- Specified by:
destroy
in interfaceIDisplay
- Overrides:
destroy
in classAbstractDisplay
-
windowDeiconified
public void windowDeiconified(WindowEvent e)
- Specified by:
windowDeiconified
in interfaceWindowListener
- Overrides:
windowDeiconified
in classAbstractDisplay3D
-
getLayout
public Layout getLayout()
Description copied from interface:IDisplay
Gets the layout the display uses- Returns:
- a layout object
-
createEditor
public DisplayEditorLifecycle createEditor(JPanel panel)
Creates an DisplayEditor appropriate for editing this display.- Parameters:
panel
-- Returns:
- an DisplayEditor appropriate for editing this display or null if this display cannot be edited.
-
resetHomeView
public void resetHomeView()
Resets the view to the original zoom and camera position
-
setBackgroundColor
public void setBackgroundColor(Color backgroundColor)
-
toggleInfoProbe
public void toggleInfoProbe()
-
-