Package sim.portrayal3d.simple
Class ValuePortrayal3D
java.lang.Object
sim.portrayal3d.SimplePortrayal3D
sim.portrayal3d.simple.PrimitivePortrayal3D
sim.portrayal3d.simple.Shape3DPortrayal3D
sim.portrayal3d.simple.ValuePortrayal3D
- All Implemented Interfaces:
Portrayal,Portrayal3D
ValuePortrayal3D defines a cube or square whose color and transparency can be changed,
and is really intended solely for use in ValueGridPortrayal3D. Note that although
ValuePortrayal3D is a subclass of Shape3DPortrayal3D, it does not include a Transform3D
and so cannot be scaled or rotated. This is mostly for speed reasons.
ValuePortrayal3D has settable polygon attributes: so you can have it display with faces, as a wireframe, or as corner dots (just change the desired value in the options panel of the Display3D when running).
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classstatic class -
Field Summary
FieldsFields inherited from class sim.portrayal3d.simple.PrimitivePortrayal3D
groupFields inherited from class sim.portrayal3d.SimplePortrayal3D
DEFAULT_APPEARANCE -
Constructor Summary
ConstructorsConstructorDescriptionCreates a ValuePortrayal3D with a cube shape.ValuePortrayal3D(int shape) Creates a ValuePortrayal3D with a cube (SHAPE_CUBE) or square (SHAPE_SQUARE) shape. -
Method Summary
Modifier and TypeMethodDescriptiongetInspector(LocationWrapper wrapper, GUIState state) Provide an inspector for an object.javax.media.j3d.TransformGroupWe suggest that if you wish to override this to change the appearance or scale or transform of the underlying model, do the changes first and THEN call super.getModel(obj, j3dModel).getName(LocationWrapper wrapper) Returns a static, one-line name for the given object that is useful for a human to distinguish it from other objects.protected javax.media.j3d.Shape3DgetShape(javax.media.j3d.TransformGroup j3dModel, int shapeNumber) Returns the shape by the given index.javax.media.j3d.PolygonAttributesProvides a PolygonAttributes which can be modified to change the underlying model's attributes (culling, vertex versus point versus fill).booleansetTransform(javax.media.j3d.TransformGroup j3dModel, javax.media.j3d.Transform3D transform) Returns false and does not set the transform (there's nothing to set).Methods inherited from class sim.portrayal3d.simple.Shape3DPortrayal3D
numShapesMethods inherited from class sim.portrayal3d.simple.PrimitivePortrayal3D
getAppearance, setAppearance, setPickable, setScale, setShape3DFlagsMethods inherited from class sim.portrayal3d.SimplePortrayal3D
appearanceForColor, appearanceForColors, appearanceForImage, clearPickableFlags, getCurrentDisplay, getCurrentFieldPortrayal, getCurrentGUIState, getStatus, isSelected, setAppearanceFlags, setCurrentDisplay, setCurrentFieldPortrayal, setPickableFlags, setPickableFlags, setSelected
-
Field Details
-
SHAPE_CUBE
public static final int SHAPE_CUBE- See Also:
-
SHAPE_SQUARE
public static final int SHAPE_SQUARE- See Also:
-
-
Constructor Details
-
ValuePortrayal3D
public ValuePortrayal3D()Creates a ValuePortrayal3D with a cube shape. -
ValuePortrayal3D
public ValuePortrayal3D(int shape) Creates a ValuePortrayal3D with a cube (SHAPE_CUBE) or square (SHAPE_SQUARE) shape.
-
-
Method Details
-
setTransform
public boolean setTransform(javax.media.j3d.TransformGroup j3dModel, javax.media.j3d.Transform3D transform) Returns false and does not set the transform (there's nothing to set).- Overrides:
setTransformin classPrimitivePortrayal3D
-
getShape
protected javax.media.j3d.Shape3D getShape(javax.media.j3d.TransformGroup j3dModel, int shapeNumber) Description copied from class:PrimitivePortrayal3DReturns the shape by the given index. Cylinder has three shapes (BODY=0, TOP=1, BOTTOM=2), while Cone has two shapes (BODY=0, CAP=1) and Sphere has a single shape (BODY=0). Useful for use in for-loops in combination with numShapes().- Overrides:
getShapein classShape3DPortrayal3D
-
polygonAttributes
public javax.media.j3d.PolygonAttributes polygonAttributes()Description copied from interface:Portrayal3DProvides 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:
polygonAttributesin interfacePortrayal3D- Overrides:
polygonAttributesin classSimplePortrayal3D
-
getModel
Description copied from class:PrimitivePortrayal3DWe suggest that if you wish to override this to change the appearance or scale or transform of the underlying model, do the changes first and THEN call super.getModel(obj, j3dModel). Be sure to also set the appearance/scale/transform of the model the first time (that is, when j3dModel is null) as well as when something interesting changes necessitating an update.- Specified by:
getModelin interfacePortrayal3D- Overrides:
getModelin classPrimitivePortrayal3D
-
getInspector
Description copied from interface:PortrayalProvide an inspector for an object.- Specified by:
getInspectorin interfacePortrayal- Overrides:
getInspectorin classSimplePortrayal3D
-
getName
Description copied from interface:PortrayalReturns a static, one-line name for the given object that is useful for a human to distinguish it from other objects. A simple default would be just to return "" + object.- Specified by:
getNamein interfacePortrayal- Overrides:
getNamein classSimplePortrayal3D
-