Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## sim.portrayal3d
Interface Portrayal3D

All Superinterfaces:
  Portrayal, java.io.Serializable

All Known Implementing Classes:
  Axes, BoxPortrayal3D, CircledPortrayal3D, ConePortrayal3D, ContinuousPortrayal3D, CubePortrayal3D, CylinderPortrayal3D, FieldPortrayal3D, ImagePortrayal3D, LabelledPortrayal3D, LightPortrayal3D, ObjectGridPortrayal3D, PrimitivePortrayal3D, Shape3DPortrayal3D, SharedGroupPortrayal3D, SimplePortrayal3D, SparseFieldPortrayal3D, SparseGrid2DPortrayal3D, SparseGridPortrayal3D, SpherePortrayal3D, TransformedPortrayal3D, ValueGrid2DPortrayal3D, ValueGridPortrayal3D, ValuePortrayal3D, WireFrameBoxPortrayal3D

    public interface Portrayal3D

extends Portrayal

The top-level definition of Portrayals which portray underlying models using, er, Java3D models. There's a semantic overload here: "models" in the simulation versus Java3D scenegraph "models". We'll assume the second whenever we use the term.

A Portrayal3D has two basic functions. getModel(object) provides a Java3D model which draws the representation of an object and can be selected if appropriate. This is the Java3D equivalent to the draw(...) and hitObjects(...) methods in the 2D portrayal code. polygonAttributes() returns the polygon attributes of the Portrayal, enabling certain portrayals to have their vertex forms manipulated by the user via a GUI. This is primarily used for ValueGridPortrayal2D3Ds.

Portrayal3Ds provide their models in the following way: the top level of the object will be a TransformGroup whose Transform3D the Portrayal3D will not fool around with. Instead this TransformGroup is owned by the parent portrayal (say, a Field Portrayal) enabling it to move, rotate, and scale Portrayal3D with relative ease.

Method Summary
`javax.media.j3d.TransformGroup` | `getModel(java.lang.Object object, javax.media.j3d.TransformGroup prev)` Provides a TransformGroup which defines the node(s) to place in the scenegraph.
`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).

Methods inherited from interface sim.portrayal.Portrayal
`getInspector, getName, getStatus, setSelected`

Method Detail

### getModel

    javax.media.j3d.TransformGroup getModel(java.lang.Object object,
                                            javax.media.j3d.TransformGroup prev)

  Provides a TransformGroup which defines the node(s) to place in the scenegraph. This is the Portrayal3D equivalent of Portrayal2D's draw(object, graphics, drawinfo) method.

  You should hang your model off of the TransformGroup provided. You should not transform that TransformGroup in any way -- it is used elsewhere. Instead if you wish to transform your model (rotate it etc.) you should add your own additional TransformGroup as necessary.

  The provided TransformGroup can be null; in this case you need to create and return the outer TransformGroup for the object. If the provided TransformGroup is non-null, you should modify it and return the same.

  SimplePortrayals should assume the following contract: at the point that getModel(...) is called, the parentPortrayal will have already been set if it exists, else it will be null.

### polygonAttributes

    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). This is an optional function: you are free to return null

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD