sim.portrayal3d.grid
Class SparseGrid2DPortrayal3D

java.lang.Object
  extended by sim.portrayal.FieldPortrayal
      extended by sim.portrayal3d.FieldPortrayal3D
          extended by sim.portrayal3d.SparseFieldPortrayal3D
              extended by sim.portrayal3d.grid.SparseGridPortrayal3D
                  extended by sim.portrayal3d.grid.SparseGrid2DPortrayal3D
All Implemented Interfaces:
java.io.Serializable, Portrayal, Portrayal3D

public class SparseGrid2DPortrayal3D
extends SparseGridPortrayal3D

Displays objects in a SparseGrid2D along the XY grid in a special way. When multiple objects are at the same location, SparseGrid2DPortrayal3D will stack them up in a column towards the positive Z axis. The centers of stacked objects are separated by a value zScale, which by default is 1.0.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class sim.portrayal.FieldPortrayal
FieldPortrayal.CustomInspector
 
Field Summary
 double zScale
           
 
Fields inherited from class sim.portrayal3d.FieldPortrayal3D
defaultPortrayal
 
Fields inherited from class sim.portrayal.FieldPortrayal
classPortrayals, dirtyField, field, immutableField, portrayalForAll, portrayalForNonNull, portrayalForNull, portrayalForRemainder, portrayals
 
Constructor Summary
SparseGrid2DPortrayal3D()
          Creates a SparseGrid2DPortrayal3D with scale = 1.0
SparseGrid2DPortrayal3D(double zScale)
          Creates a SparseGrid2DPortrayal3D with the provided scale
 
Method Summary
 javax.media.j3d.TransformGroup createModel()
          Returns a tree structure of the form InternalTransform[model info].
 void setField(java.lang.Object field)
          Sets the field.
 void updateModel(javax.media.j3d.TransformGroup globalTG)
          Returns a tree structure of the form InternalTransform[model info].
 
Methods inherited from class sim.portrayal3d.grid.SparseGridPortrayal3D
completedWrapper, getLocationOfObjectAsVector3d
 
Methods inherited from class sim.portrayal3d.SparseFieldPortrayal3D
wrapModelForNewObject
 
Methods inherited from class sim.portrayal3d.FieldPortrayal3D
getDefaultPortrayal, getDefaultTransform, getModel, getTransform, polygonAttributes, resetTransform, rotateX, rotateY, rotateZ, scale, scale, setTransform, transform, translate
 
Methods inherited from class sim.portrayal.FieldPortrayal
getDefaultNullPortrayal, getField, getInspector, getName, getPortrayalForAll, getPortrayalForNonNull, getPortrayalForNull, getPortrayalForObject, getPortrayalForRemainder, getStatus, isImmutableField, setImmutableField, setPortrayalForAll, setPortrayalForClass, setPortrayalForNonNull, setPortrayalForNull, setPortrayalForObject, setPortrayalForRemainder, setSelected, setSelected
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface sim.portrayal.Portrayal
getInspector, getName, getStatus, setSelected
 

Field Detail

zScale

public double zScale
Constructor Detail

SparseGrid2DPortrayal3D

public SparseGrid2DPortrayal3D(double zScale)
Creates a SparseGrid2DPortrayal3D with the provided scale


SparseGrid2DPortrayal3D

public SparseGrid2DPortrayal3D()
Creates a SparseGrid2DPortrayal3D with scale = 1.0

Method Detail

setField

public void setField(java.lang.Object field)
Description copied from class: FieldPortrayal
Sets the field. Also sets dirtyField = true. May throw an exception if the field is inappropriate.

Overrides:
setField in class SparseGridPortrayal3D

createModel

public javax.media.j3d.TransformGroup createModel()
Description copied from class: FieldPortrayal3D
Returns a tree structure of the form InternalTransform[model info].

...where InternalTransform is an identity transformgroup whose transform will be modified elsewhere (create it but don't play with it).

Overrides:
createModel in class SparseFieldPortrayal3D

updateModel

public void updateModel(javax.media.j3d.TransformGroup globalTG)
Description copied from class: FieldPortrayal3D
Returns a tree structure of the form InternalTransform[model info].

...where InternalTransform is an identity transformgroup whose transform will be modified elsewhere (don't play with it). By default, this function does nothing. Override it to update the model when it's called.

Overrides:
updateModel in class SparseFieldPortrayal3D