|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectptolemy.kernel.util.NamedObj
ptolemy.kernel.InstantiableNamedObj
ptolemy.kernel.Entity
ptolemy.kernel.ComponentEntity
ptolemy.actor.AtomicActor
ptolemy.actor.TypedAtomicActor
ptolemy.domains.gr.kernel.GRActor
ptolemy.domains.gr.kernel.GRActor3D
ptolemy.domains.gr.lib.GRShadedShape
public abstract class GRShadedShape
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.
Green (liuxj) |
Green (eal) |
Nested Class Summary |
---|
Nested classes/interfaces inherited from class ptolemy.kernel.Entity |
---|
Entity.ContainedObjectsIterator |
Field Summary | |
---|---|
protected javax.media.j3d.Appearance |
_appearance
The appearance of this 3D object. |
protected boolean |
_changesAllowedNow
Indicator that changes are currently allowed. |
protected javax.media.j3d.ColoringAttributes |
_coloringAttributes
The coloring attributes, or null if not created. |
protected javax.media.j3d.Material |
_material
The material of this 3D object. |
protected javax.media.j3d.PolygonAttributes |
_polygonAttributes
Polygon attributes. |
protected javax.media.j3d.TransparencyAttributes |
_transparencyAttributes
The transparency attributes, or null if not created. |
Parameter |
allowRuntimeChanges
If true, then changes to parameter values can be made during execution of the model. |
ColorAttribute |
diffuseColor
The diffuse color, which is the color of the object reflecting illumination. |
ColorAttribute |
emissiveColor
The emissive color, which is a color that does not depend on ambient illumination. |
Parameter |
flat
If true, render the facets flat rather than rounded. |
TypedIOPort |
sceneGraphOut
The output port for connecting to other GR Actors in the scene graph. |
DoubleRangeParameter |
shininess
The shininess of the 3D shape. |
ColorAttribute |
specularColor
The specular color, which is a color of a highlight reflecting ambient illumination. |
FileParameter |
texture
Texture URL, which if non-empty, specifies an image file or URL. |
DoubleRangeParameter |
transparency
The transparency, where 0.0 means opaque (the default) and 1.0 means fully transparent. |
Parameter |
wireFrame
If true, render the shape using a wire frame. |
Fields inherited from class ptolemy.domains.gr.kernel.GRActor3D |
---|
_viewScreen |
Fields inherited from class ptolemy.domains.gr.kernel.GRActor |
---|
_allowAttributeChanges, _isSceneGraphInitialized |
Fields inherited from class ptolemy.actor.AtomicActor |
---|
_actorFiringListeners, _initializables, _notifyingActorFiring, _stopRequested |
Fields inherited from class ptolemy.kernel.util.NamedObj |
---|
_changeListeners, _changeLock, _changeRequests, _debugging, _debugListeners, _elementName, _isPersistent, _verbose, _workspace, ATTRIBUTES, CLASSNAME, COMPLETE, CONTENTS, DEEP, FULLNAME, LINKS |
Fields inherited from interface ptolemy.actor.Executable |
---|
COMPLETED, NOT_READY, STOP_ITERATING |
Constructor Summary | |
---|---|
GRShadedShape(CompositeEntity container,
java.lang.String name)
Construct an actor with the given container and name. |
Method Summary | |
---|---|
protected void |
_createAppearance()
Create the material appearance of the shaded 3D actor. |
protected void |
_createModel()
Set the color and appearance of this 3D object. |
protected void |
_makeSceneGraphConnection()
Send the scene graph token on the output. |
protected void |
_setViewScreen(GRActor actor)
Override the base class to set the texture, if one is specified, now that the view screen is known. |
void |
attributeChanged(Attribute attribute)
Adjust the appearance when an attribute changes if such an update is supported by the allowRuntimeChanges parameter. |
java.lang.Object |
clone(Workspace workspace)
Override the base class to null out private variables. |
void |
initialize()
Create the Java3D geometry and appearance for this GR actor. |
boolean |
prefire()
Return false if the scene graph is already initialized. |
void |
preinitialize()
Override the base class to ensure that material and appearance objects are created anew. |
void |
wrapup()
Override the base class to set to null the references to appearance and material. |
Methods inherited from class ptolemy.domains.gr.kernel.GRActor3D |
---|
_addChild, _getNodeObject |
Methods inherited from class ptolemy.domains.gr.kernel.GRActor |
---|
fire |
Methods inherited from class ptolemy.actor.TypedAtomicActor |
---|
_addPort, _fireAt, _fireAt, attributeTypeChanged, clone, newPort, typeConstraintList, typeConstraints |
Methods inherited from class ptolemy.kernel.ComponentEntity |
---|
_adjustDeferrals, _checkContainer, _getContainedObject, _propagateExistence, getContainer, instantiate, isAtomic, isOpaque, moveDown, moveToFirst, moveToIndex, moveToLast, moveUp, propagateExistence, setName |
Methods inherited from class ptolemy.kernel.Entity |
---|
_description, _exportMoMLContents, _removePort, _validateSettables, connectedPortList, connectedPorts, containedObjectsIterator, getAttribute, getPort, getPorts, linkedRelationList, linkedRelations, portList, removeAllPorts, setClassDefinition, uniqueName |
Methods inherited from class ptolemy.kernel.InstantiableNamedObj |
---|
_setParent, exportMoML, getChildren, getElementName, getParent, getPrototypeList, isClassDefinition, isWithinClassDefinition |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface ptolemy.actor.Actor |
---|
createReceivers, getCausalityInterface, getDirector, getExecutiveDirector, getManager, inputPortList, newReceiver, outputPortList |
Methods inherited from interface ptolemy.actor.Executable |
---|
isFireFunctional, isStrict, iterate, postfire, stop, stopFire, terminate |
Methods inherited from interface ptolemy.actor.Initializable |
---|
addInitializable, removeInitializable |
Methods inherited from interface ptolemy.kernel.util.Nameable |
---|
description, getContainer, getDisplayName, getFullName, getName, getName, setName |
Methods inherited from interface ptolemy.kernel.util.Derivable |
---|
getDerivedLevel, getDerivedList, propagateValue |
Field Detail |
---|
public Parameter allowRuntimeChanges
public ColorAttribute diffuseColor
public ColorAttribute emissiveColor
public TypedIOPort sceneGraphOut
public DoubleRangeParameter shininess
public ColorAttribute specularColor
public FileParameter texture
public DoubleRangeParameter transparency
public Parameter wireFrame
public Parameter flat
protected javax.media.j3d.Appearance _appearance
protected boolean _changesAllowedNow
protected javax.media.j3d.ColoringAttributes _coloringAttributes
protected javax.media.j3d.Material _material
protected javax.media.j3d.PolygonAttributes _polygonAttributes
protected javax.media.j3d.TransparencyAttributes _transparencyAttributes
Constructor Detail |
---|
public GRShadedShape(CompositeEntity container, java.lang.String name) throws IllegalActionException, NameDuplicationException
container
- The container.name
- The name of this actor.
IllegalActionException
- If the actor cannot be contained
by the proposed container.
NameDuplicationException
- If the container already has an
actor with this name.Method Detail |
---|
public void attributeChanged(Attribute attribute) throws IllegalActionException
attributeChanged
in class NamedObj
attribute
- The attribute that changed.
IllegalActionException
- If the change is not acceptable
to this container (not thrown in this base class).public java.lang.Object clone(Workspace workspace) throws java.lang.CloneNotSupportedException
clone
in class AtomicActor
workspace
- The workspace for the cloned object.
java.lang.CloneNotSupportedException
- If cloned ports cannot have
as their container the cloned entity (this should not occur), or
if one of the attributes cannot be cloned.NamedObj.exportMoML(Writer, int, String)
,
NamedObj.setDeferringChangeRequests(boolean)
public void initialize() throws IllegalActionException
initialize
in interface Initializable
initialize
in class GRActor
IllegalActionException
- If the current director
is not a GRDirector.public boolean prefire() throws IllegalActionException
prefire
in interface Executable
prefire
in class AtomicActor
IllegalActionException
- Not thrown in this base classpublic void preinitialize() throws IllegalActionException
preinitialize
in interface Initializable
preinitialize
in class AtomicActor
IllegalActionException
- If the current director
is not a GRDirector.public void wrapup() throws IllegalActionException
wrapup
in interface Initializable
wrapup
in class GRActor
IllegalActionException
- If the current director
is not a GRDirector.protected void _createAppearance() throws IllegalActionException
IllegalActionException
- If a parameter cannot be evaluated.protected void _createModel() throws IllegalActionException
IllegalActionException
- If a parameter cannot be evaluated.protected void _makeSceneGraphConnection() throws IllegalActionException
_makeSceneGraphConnection
in class GRActor
IllegalActionException
- Always thrown for this base class.protected void _setViewScreen(GRActor actor) throws IllegalActionException
_setViewScreen
in class GRActor3D
actor
- The view screen actor.
IllegalActionException
- If the given actor is not a
ViewScreen3D or if an invalid texture is specified.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |