Package sim.portrayal3d.grid
Class ValueGridPortrayal3D
java.lang.Object
sim.portrayal.FieldPortrayal
sim.portrayal3d.FieldPortrayal3D
sim.portrayal3d.grid.ValueGridPortrayal3D
- All Implemented Interfaces:
Portrayal
,Portrayal3D
-
Field Summary
Fields inherited from class sim.portrayal.FieldPortrayal
classPortrayals, field, immutableField, portrayalForAll, portrayalForNonNull, portrayalForNull, portrayalForRemainder, portrayals
-
Constructor Summary
ConstructorDescriptionValueGridPortrayal3D
(double s) ValueGridPortrayal3D
(String valueName) ValueGridPortrayal3D
(String valueName, double scale) -
Method Summary
Modifier and TypeMethodDescriptioncompletedWrapper
(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
Returns a tree structure of the form InternalTransformGroup[model info].getColorFor
(Object wrapper) Returns the color presently mapped to the value stored within the given wrapper.Should return a portrayal which can portray any object regardless of whether it's valid or notgetField()
Returns the field.getMap()
double
getScale()
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
Provides a PolygonAttributes which can be modified to change the underlying model's attributes (culling, vertex versus point versus fill).void
Sets the field, and sets the dirtyField flag to true.void
void
setScale
(double val) void
setValueName
(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, getObjectLocation, getTransform, resetTransform, rotateX, rotateY, rotateZ, scale, scale, setCurrentDisplay, setObjectLocation, setTransform, transform, translate
Methods inherited from class sim.portrayal.FieldPortrayal
getAlternatePortrayalOrdering, getDefaultNullPortrayal, getInspector, getName, getPortrayalForAll, getPortrayalForNonNull, getPortrayalForNull, getPortrayalForObject, getPortrayalForRemainder, getStatus, isDirtyField, isImmutableField, reset, setAlternatePortrayalOrdering, 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 Details
-
ValueGridPortrayal3D
public ValueGridPortrayal3D() -
ValueGridPortrayal3D
-
ValueGridPortrayal3D
public ValueGridPortrayal3D(double s) -
ValueGridPortrayal3D
-
-
Method Details
-
getMap
-
setMap
-
getValueName
-
setValueName
-
getScale
public double getScale() -
setScale
public void setScale(double val) -
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 classFieldPortrayal3D
-
setField
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 classFieldPortrayal
-
getField
Description copied from class:FieldPortrayal
Returns the field.- Overrides:
getField
in classFieldPortrayal
-
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 interfacePortrayal3D
- Overrides:
polygonAttributes
in classFieldPortrayal3D
-
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 classFieldPortrayal3D
-
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 classFieldPortrayal3D
-
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 classFieldPortrayal3D
-
getColorFor
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.
-