Class AbstractDisplayLayer3D
- java.lang.Object
-
- repast.simphony.visualization.visualization3D.AbstractDisplayLayer3D
-
- All Implemented Interfaces:
IDisplayLayer<VisualItem3D>
,IDisplayLayer3D
- Direct Known Subclasses:
DisplayLayer3D
,NetworkDisplayLayer3D
public abstract class AbstractDisplayLayer3D extends Object implements IDisplayLayer3D
- Author:
- Nick Collier
-
-
Field Summary
Fields Modifier and Type Field Description protected VisualItem3DAdderRemover
adder
protected Set<Object>
objsToAdd
protected Set<Object>
objsToRemove
protected org.jogamp.java3d.BranchGroup
parentGroup
protected Style3D
style
protected Map<Object,VisualItem3D>
visualItemMap
-
Constructor Summary
Constructors Constructor Description AbstractDisplayLayer3D(Style3D style, org.jogamp.java3d.Group topGroup)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
addObject(Object obj)
Adds the specified object to the layer.void
applyUpdates()
Apply the updates to the scene graph.protected abstract void
createItemsForAddedObjects(Layout layout, boolean doLayout)
protected abstract Label
createLabel()
protected abstract void
doUpdate(Layout layout, boolean layoutPerformed)
Object
findObjsForItem(org.jogamp.java3d.Shape3D shape)
Given a Shape3D, return the object that the shape is the visualization of.VisualItem3D
getVisualItem(Object obj)
Gets the visual representation of this object.protected void
removeItemsForRemovedObjects()
void
removeObject(Object obj)
Removes the specified objecdt from the layer.void
setStyle(Style3D style)
void
update(LayoutUpdater updater)
Updates the layout, styles etc.
-
-
-
Field Detail
-
style
protected Style3D style
-
parentGroup
protected org.jogamp.java3d.BranchGroup parentGroup
-
adder
protected VisualItem3DAdderRemover adder
-
visualItemMap
protected final Map<Object,VisualItem3D> visualItemMap
-
-
Constructor Detail
-
AbstractDisplayLayer3D
public AbstractDisplayLayer3D(Style3D style, org.jogamp.java3d.Group topGroup)
-
-
Method Detail
-
addObject
public void addObject(Object obj)
Description copied from interface:IDisplayLayer
Adds the specified object to the layer.- Specified by:
addObject
in interfaceIDisplayLayer<VisualItem3D>
- Parameters:
obj
- the object to add
-
removeObject
public void removeObject(Object obj)
Description copied from interface:IDisplayLayer
Removes the specified objecdt from the layer.- Specified by:
removeObject
in interfaceIDisplayLayer<VisualItem3D>
- Parameters:
obj
- the object to remove
-
createItemsForAddedObjects
protected abstract void createItemsForAddedObjects(Layout layout, boolean doLayout)
-
removeItemsForRemovedObjects
protected void removeItemsForRemovedObjects()
-
getVisualItem
public VisualItem3D getVisualItem(Object obj)
Description copied from interface:IDisplayLayer
Gets the visual representation of this object.- Specified by:
getVisualItem
in interfaceIDisplayLayer<VisualItem3D>
- Parameters:
obj
- the object whose visual representation we want to get- Returns:
- the visual representation of this object.
-
findObjsForItem
public Object findObjsForItem(org.jogamp.java3d.Shape3D shape)
Given a Shape3D, return the object that the shape is the visualization of.- Specified by:
findObjsForItem
in interfaceIDisplayLayer3D
- Parameters:
shape
- the shape whose associated object we want to find- Returns:
- the object that the specified shape represents
-
doUpdate
protected abstract void doUpdate(Layout layout, boolean layoutPerformed)
-
createLabel
protected abstract Label createLabel()
-
update
public void update(LayoutUpdater updater)
Description copied from interface:IDisplayLayer
Updates the layout, styles etc. of the displayed objects.- Specified by:
update
in interfaceIDisplayLayer<VisualItem3D>
- Parameters:
updater
- used to update the layout and position information
-
setStyle
public void setStyle(Style3D style)
-
applyUpdates
public void applyUpdates()
Apply the updates to the scene graph. This should be called by the 3D behavior in display3D.- Specified by:
applyUpdates
in interfaceIDisplayLayer<VisualItem3D>
-
-