Class GRShadedShape

  • All Implemented Interfaces:
    java.lang.Cloneable, Actor, Executable, FiringsRecordable, Initializable, TypedActor, Changeable, Debuggable, DebugListener, Derivable, Instantiable, ModelErrorHandler, MoMLExportable, Moveable, Nameable
    Direct Known Subclasses:
    Box3D, CircularSweep3D, Cone3D, Cylinder3D, Loader3D, PolyCylinder3D, Sphere3D, TextString3D, Torus3D

    public abstract class GRShadedShape
    extends GRActor3D
    An abstract base class for GR Actors that have material and color properties.

    The parameter diffuseColor determines the color of the object in the usual sense that it determines the color of light reflected off the object. The default is gray. The parameter emissiveColor specifies a color that is emitted by the object, and hence does not depend on illumination. It is black by default, which means that the object does not emit any light and will be invisible without illumination. The parameter specularColor determines the color of highlights that are reflected by the object if the object is set to be shiny.

    The parameter shininess determines the shininess of the object. It ranges from 1.0 (the default) to 128.0, meaning not shiny to very shiny. A shiny object reflects the specularColor, unless it is black, in which case shininess has no effect.

    The texture parameter can be used to specify an image file. The specified image will be mapped onto the shape.

    The parameter transparency determines the transparency of the object. It ranges from 0.0 (the default) to 1.0, meaning opaque to fully transparent (which makes the object invisible).

    The wireFrame parameter can be used to view only the lines that outline the polygons of the object and not the surface. The flat parameter can be set to make rendered polygons flat rather than rounded at the corners.

    The allowRuntimeChanges parameter, if true, specifies that changes to parameter values during the execution of the model take effect immediately. By default, this parameter is false, which means that changes to parameter values take effect only on the next run of the model. A value of false yields better performance, but less interactivity. Changing this to true will only have an effect on the next run of the model.

    Since:
    Ptolemy II 1.0
    Version:
    $Id$
    Author:
    C. Fong, Steve Neuendorffer, Edward A. Lee
    Pt.AcceptedRating:
    Green (liuxj)
    Pt.ProposedRating:
    Green (eal)
    • Field Detail

      • allowRuntimeChanges

        public Parameter allowRuntimeChanges
        If true, then changes to parameter values can be made during execution of the model. This is a boolean that defaults to false.
      • diffuseColor

        public ColorAttribute diffuseColor
        The diffuse color, which is the color of the object reflecting illumination. Note that the alpha value (the fourth element of the array), which would normally specify transparency, is ignored. The default color is grey.
      • emissiveColor

        public ColorAttribute emissiveColor
        The emissive color, which is a color that does not depend on ambient illumination. Note that the alpha value (the fourth element of the array), which would normally specify transparency, is ignored. The default color is black, which means that there is no emissive color (illumination is required).
      • sceneGraphOut

        public TypedIOPort sceneGraphOut
        The output port for connecting to other GR Actors in the scene graph. The type is SceneGraphToken.
      • shininess

        public DoubleRangeParameter shininess
        The shininess of the 3D shape. This parameter should contain a DoubleToken in the range 1.0 to 128.0, where 1.0 represents not shiny and 128.0 represents very shiny. This is a double with default 1.0.
      • specularColor

        public ColorAttribute specularColor
        The specular color, which is a color of a highlight reflecting ambient illumination. Note that the alpha value (the fourth element of the array), which would normally specify transparency, is ignored. The default color is white, which means that the illumination is reflected white.
      • texture

        public FileParameter texture
        Texture URL, which if non-empty, specifies an image file or URL. The image from the file is mapped onto the shape as a texture.
      • transparency

        public DoubleRangeParameter transparency
        The transparency, where 0.0 means opaque (the default) and 1.0 means fully transparent. The type is double.
      • wireFrame

        public Parameter wireFrame
        If true, render the shape using a wire frame. This is a boolean that defaults to false.
      • flat

        public Parameter flat
        If true, render the facets flat rather than rounded. This is a boolean that defaults to false.
      • _appearance

        protected javax.media.j3d.Appearance _appearance
        The appearance of this 3D object.
      • _changesAllowedNow

        protected boolean _changesAllowedNow
        Indicator that changes are currently allowed.
      • _coloringAttributes

        protected javax.media.j3d.ColoringAttributes _coloringAttributes
        The coloring attributes, or null if not created.
      • _material

        protected javax.media.j3d.Material _material
        The material of this 3D object.
      • _polygonAttributes

        protected javax.media.j3d.PolygonAttributes _polygonAttributes
        Polygon attributes.
      • _transparencyAttributes

        protected javax.media.j3d.TransparencyAttributes _transparencyAttributes
        The transparency attributes, or null if not created.