public interface Portrayal3D extends Portrayal
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.
Modifier and Type | Method and Description |
---|---|
Display3D |
getCurrentDisplay()
Returns the current Display3D, or possibly null if it's not been set yet.
|
GUIState |
getCurrentGUIState()
Returns the current GUIState, or null if no GUIState has been set yet.
|
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).
|
void |
setCurrentDisplay(Display3D display)
Sets the current Display3D.
|
getInspector, getName, getStatus, setSelected
javax.media.j3d.TransformGroup getModel(java.lang.Object object, javax.media.j3d.TransformGroup prev)
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 field portrayal and display will have already been set if it exists, else it will be null.
javax.media.j3d.PolygonAttributes polygonAttributes()
void setCurrentDisplay(Display3D display)
Display3D getCurrentDisplay()
GUIState getCurrentGUIState()