sim.portrayal3d.grid
Class ValueGridPortrayal3D

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

public class ValueGridPortrayal3D
extends FieldPortrayal3D

See Also:
Serialized Form

Field Summary
 
Fields inherited from class sim.portrayal.FieldPortrayal
classPortrayals, field, immutableField, portrayalForAll, portrayalForNonNull, portrayalForNull, portrayalForRemainder, portrayals
 
Constructor Summary
ValueGridPortrayal3D()
           
ValueGridPortrayal3D(double s)
           
ValueGridPortrayal3D(java.lang.String valueName)
           
ValueGridPortrayal3D(java.lang.String valueName, double scale)
           
 
Method Summary
 LocationWrapper completedWrapper(LocationWrapper w, com.sun.j3d.utils.picking.PickIntersection pi, com.sun.j3d.utils.picking.PickResult pr)
          Given the provided PickIntersection and the PickResult it came from, fill in w the location of the picked object, and return it.
 javax.media.j3d.TransformGroup createModel()
          Returns a tree structure of the form InternalTransformGroup[model info].
 java.awt.Color getColorFor(java.lang.Object wrapper)
          Returns the color presently mapped to the value stored within the given wrapper.
 Portrayal getDefaultPortrayal()
          Should return a portrayal which can portray any object regardless of whether it's valid or not
 java.lang.Object getField()
          Returns the field.
 ColorMap getMap()
           
 double getScale()
           
 java.lang.String getValueName()
           
 double newValue(int x, int y, int z, double value)
          This method is called by the default inspector to filter new values set by the user.
 javax.media.j3d.PolygonAttributes polygonAttributes()
          Provides a PolygonAttributes which can be modified to change the underlying model's attributes (culling, vertex versus point versus fill).
 void setField(java.lang.Object field)
          Sets the field, and sets the dirtyField flag to true.
 void setMap(ColorMap m)
           
 void setScale(double val)
           
 void setValueName(java.lang.String name)
           
 void updateModel(javax.media.j3d.TransformGroup modelTG)
          Returns a tree structure of the form InternalTransformGroup[model info].
 
Methods inherited from class sim.portrayal3d.FieldPortrayal3D
getCurrentDisplay, getCurrentGUIState, getDefaultTransform, getModel, getTransform, resetTransform, rotateX, rotateY, rotateZ, scale, scale, setCurrentDisplay, setTransform, transform, translate
 
Methods inherited from class sim.portrayal.FieldPortrayal
getDefaultNullPortrayal, getInspector, getName, getPortrayalForAll, getPortrayalForNonNull, getPortrayalForNull, getPortrayalForObject, getPortrayalForRemainder, getStatus, isDirtyField, isImmutableField, reset, setDirtyField, 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
 

Constructor Detail

ValueGridPortrayal3D

public ValueGridPortrayal3D()

ValueGridPortrayal3D

public ValueGridPortrayal3D(java.lang.String valueName)

ValueGridPortrayal3D

public ValueGridPortrayal3D(double s)

ValueGridPortrayal3D

public ValueGridPortrayal3D(java.lang.String valueName,
                            double scale)
Method Detail

getMap

public ColorMap getMap()

setMap

public void setMap(ColorMap m)

getValueName

public java.lang.String getValueName()

setValueName

public void setValueName(java.lang.String name)

getScale

public double getScale()

setScale

public void setScale(double val)

getDefaultPortrayal

public Portrayal getDefaultPortrayal()
Description copied from class: FieldPortrayal
Should return a portrayal which can portray any object regardless of whether it's valid or not

Overrides:
getDefaultPortrayal in class FieldPortrayal3D

setField

public void setField(java.lang.Object field)
Description copied from class: FieldPortrayal
Sets the field, and sets the dirtyField flag to true. May throw an exception if the field is inappropriate. The default version just sets the field and sets the dirtyField flag.

Overrides:
setField in class FieldPortrayal

getField

public java.lang.Object getField()
Description copied from class: FieldPortrayal
Returns the field.

Overrides:
getField in class FieldPortrayal

polygonAttributes

public javax.media.j3d.PolygonAttributes polygonAttributes()
Description copied from interface: Portrayal3D
Provides a PolygonAttributes which can be modified to change the underlying model's attributes (culling, vertex versus point versus fill). This is an optional function: you are free to return null

Specified by:
polygonAttributes in interface Portrayal3D
Overrides:
polygonAttributes in class FieldPortrayal3D

newValue

public double newValue(int x,
                       int y,
                       int z,
                       double value)
This method is called by the default inspector to filter new values set by the user. You should return the "corrected" value if the given value is invalid. The default version of this method bases values on the values passed into the setLevels() and setColorTable() methods.


createModel

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

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

Specified by:
createModel in class FieldPortrayal3D

updateModel

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

...where InternalTransformGroup 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 FieldPortrayal3D

completedWrapper

public LocationWrapper completedWrapper(LocationWrapper w,
                                        com.sun.j3d.utils.picking.PickIntersection pi,
                                        com.sun.j3d.utils.picking.PickResult pr)
Description copied from class: FieldPortrayal3D
Given the provided PickIntersection and the PickResult it came from, fill in w the location of the picked object, and return it. Alternatively, return a new LocationWrapper with all information filled in. The PickResult is provided you in case the object is in a shared group and you need to identify what link had connected to it.

Specified by:
completedWrapper in class FieldPortrayal3D

getColorFor

public java.awt.Color getColorFor(java.lang.Object wrapper)
Returns the color presently mapped to the value stored within the given wrapper. The wrapper must have been generated by ValueGridPortrayal3D, else a cast error will be raised. Used solely by ValuePortrayal3D to determine the color of the object passed it. It's an Object rather than a LocationWrapper to save an unneccessary cast.