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.simple
Class CircledPortrayal3D

    java.lang.Object
      sim.portrayal3d.SimplePortrayal3D
          sim.portrayal3d.simple.CircledPortrayal3D

All Implemented Interfaces:
  Portrayal, Portrayal3D, java.io.Serializable

public class CircledPortrayal3D
extends SimplePortrayal3D

A wrapper for other Portrayal3Ds which also draws a big translucent sphere around them -- useful for distinguishing one object from other similar-looking objects. When you create this CirclePortrayal3D, you will pass in an underlying Portrayal3D which is supposed to draw the actual object; CirclePortrayal3D will then add on the sphere. If the object will draw itself (it's its own Portrayal3D), you can signify this by passing in null for the underlying Portrayal3D.

There are certain guidelines you can specify for when the sphere is to be drawn. At construction time you can state that the sphere should only be drawn when the object is selected. Additionally if you call the setCircleShowing(...) function, you can turn off or on sphere drawing entirely for this CirclePortrayal3D.

You may specify a color or appearance for the sphere (the default is 25%-opaque flat white). If you specify a color with some degree of alpha, the sphere will be drawn to that degree of transparency. You can also specify a scale -- equivalent to the diameter of the sphere. The default scale (2.0f) draws the sphere in the (-1,-1,-1) to (1,1,1) box.

Why's it not called a "SpheredPortrayal3D?" One, because there's no such word as "sphered", you big goof. More importantly, we thought it'd be useful to stay consistent with CircledPortrayal2D.

See Also:
  Serialized Form

Field Summary
`javax.media.j3d.Appearance` | `appearance`
`protected SimplePortrayal3D` | `child`
`static javax.media.j3d.Appearance` | `DEFAULT_CIRCLED_APPEARANCE`
`float` | `scale`

Fields inherited from class sim.portrayal3d.SimplePortrayal3D
`DEFAULT_APPEARANCE, parentPortrayal`

Constructor Summary
`CircledPortrayal3D(SimplePortrayal3D child)`
`CircledPortrayal3D(SimplePortrayal3D child, javax.media.j3d.Appearance appearance, float scale, boolean onlyCircleWhenSelected)`
`CircledPortrayal3D(SimplePortrayal3D child, java.awt.Color color)`
`CircledPortrayal3D(SimplePortrayal3D child, java.awt.Color color, float scale, boolean onlyCircleWhenSelected)`
`CircledPortrayal3D(SimplePortrayal3D child, float scale)`
`CircledPortrayal3D(SimplePortrayal3D child, float scale, boolean onlyCircleWhenSelected)`

Method Summary
`SimplePortrayal3D` | `getChild(java.lang.Object object)`
`Inspector` | `getInspector(LocationWrapper wrapper, GUIState state)` Provide an inspector for an object.
`javax.media.j3d.TransformGroup` | `getModel(java.lang.Object obj, javax.media.j3d.TransformGroup j3dModel)` Provides a TransformGroup which defines the node(s) to place in the scenegraph.
`java.lang.String` | `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.
`boolean` | `getOnlyCircleWhenSelected()`
`boolean` | `isCircleShowing()`
`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` | `setCircleShowing(boolean val)`
`void` | `setOnlyCircleWhenSelected(boolean val)`
`void` | `setParentPortrayal(FieldPortrayal3D p)` Sets the parent portrayal (a FieldPortrayal3D).
`boolean` | `setSelected(LocationWrapper wrapper, boolean selected)` Change the portrayal state to reflect the fact that you've been selected or not selected.
`void` | `updateSwitch(javax.media.j3d.Switch jswitch)`

Methods inherited from class sim.portrayal3d.SimplePortrayal3D
`appearanceForColor, appearanceForImage, clearPickableFlags, getStatus, setPickableFlags, setPickableFlags`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### DEFAULT_CIRCLED_APPEARANCE

    public static final javax.media.j3d.Appearance DEFAULT_CIRCLED_APPEARANCE

### scale

    public float scale

### appearance

    public javax.media.j3d.Appearance appearance

### child

    protected SimplePortrayal3D child

Constructor Detail

### CircledPortrayal3D

    public CircledPortrayal3D(SimplePortrayal3D child)

### CircledPortrayal3D

    public CircledPortrayal3D(SimplePortrayal3D child,
                              float scale)

### CircledPortrayal3D

    public CircledPortrayal3D(SimplePortrayal3D child,
                              float scale,
                              boolean onlyCircleWhenSelected)

### CircledPortrayal3D

    public CircledPortrayal3D(SimplePortrayal3D child,
                              java.awt.Color color)

### CircledPortrayal3D

    public CircledPortrayal3D(SimplePortrayal3D child,
                              java.awt.Color color,
                              float scale,
                              boolean onlyCircleWhenSelected)

### CircledPortrayal3D

    public CircledPortrayal3D(SimplePortrayal3D child,
                              javax.media.j3d.Appearance appearance,
                              float scale,
                              boolean onlyCircleWhenSelected)

Method Detail

### 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 `SimplePortrayal3D`

### getInspector

    public Inspector getInspector(LocationWrapper wrapper,
                                  GUIState state)

  Description copied from interface: `Portrayal`
  Provide an inspector for an object.

  Specified by:
    `getInspector` in interface `Portrayal`
  Overrides:
    `getInspector` in class `SimplePortrayal3D`

### getName

    public java.lang.String getName(LocationWrapper wrapper)

  Description copied from interface: `Portrayal`
  Returns 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:
    `getName` in interface `Portrayal`
  Overrides:
    `getName` in class `SimplePortrayal3D`

### setParentPortrayal

    public void setParentPortrayal(FieldPortrayal3D p)

  Description copied from class: `SimplePortrayal3D`
  Sets the parent portrayal (a FieldPortrayal3D).

  Overrides:
    `setParentPortrayal` in class `SimplePortrayal3D`

### setSelected

    public boolean setSelected(LocationWrapper wrapper,
                               boolean selected)

  Description copied from interface: `Portrayal`
  Change the portrayal state to reflect the fact that you've been selected or not selected. Always return true, except if you've received a setSelected(true) and in fact do not wish to be selectable, in which case return false in that sole situation.

  Specified by:
    `setSelected` in interface `Portrayal`
  Overrides:
    `setSelected` in class `SimplePortrayal3D`

### getChild

    public SimplePortrayal3D getChild(java.lang.Object object)

### setOnlyCircleWhenSelected

    public void setOnlyCircleWhenSelected(boolean val)

### getOnlyCircleWhenSelected

    public boolean getOnlyCircleWhenSelected()

### isCircleShowing

    public boolean isCircleShowing()

### setCircleShowing

    public void setCircleShowing(boolean val)

### updateSwitch

    public void updateSwitch(javax.media.j3d.Switch jswitch)

### getModel

    public javax.media.j3d.TransformGroup getModel(java.lang.Object obj,
                                                   javax.media.j3d.TransformGroup j3dModel)

  Description copied from interface: `Portrayal3D`
  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.

  Specified by:
    `getModel` in interface `Portrayal3D`
  Overrides:
    `getModel` in class `SimplePortrayal3D`

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