public abstract class GRShadedShape extends GRActor3D
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) |
Entity.ContainedObjectsIterator
Modifier and Type | Field and Description |
---|---|
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.
|
_viewScreen
_allowAttributeChanges, _isSceneGraphInitialized
_typesValid
_actorFiringListeners, _initializables, _notifyingActorFiring, _stopRequested
_changeListeners, _changeLock, _changeRequests, _debugging, _debugListeners, _deferChangeRequests, _elementName, _isPersistent, _verbose, _workspace, ATTRIBUTES, CLASSNAME, COMPLETE, CONTENTS, DEEP, FULLNAME, LINKS
COMPLETED, NOT_READY, STOP_ITERATING
Constructor and Description |
---|
GRShadedShape(CompositeEntity container,
java.lang.String name)
Construct an actor with the given container and name.
|
Modifier and Type | Method and Description |
---|---|
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.
|
_addChild, _getNodeObject
_containedTypeConstraints, _customTypeConstraints, _defaultTypeConstraints, _fireAt, _fireAt, attributeTypeChanged, clone, isBackwardTypeInferenceEnabled, newPort, typeConstraintList, typeConstraints
_actorFiring, _actorFiring, _declareDelayDependency, addActorFiringListener, addInitializable, connectionsChanged, createReceivers, declareDelayDependency, getCausalityInterface, getDirector, getExecutiveDirector, getManager, inputPortList, isFireFunctional, isStrict, iterate, newReceiver, outputPortList, postfire, pruneDependencies, recordFiring, removeActorFiringListener, removeDependency, removeInitializable, setContainer, stop, stopFire, terminate
_adjustDeferrals, _checkContainer, _getContainedObject, _propagateExistence, getContainer, instantiate, isAtomic, isOpaque, moveDown, moveToFirst, moveToIndex, moveToLast, moveUp, propagateExistence, setName
_addPort, _description, _exportMoMLContents, _removePort, _validateSettables, connectedPortList, connectedPorts, containedObjectsIterator, getAttribute, getPort, getPorts, linkedRelationList, linkedRelations, portList, removeAllPorts, setClassDefinition, uniqueName
_setParent, exportMoML, getChildren, getElementName, getParent, getPrototypeList, isClassDefinition, isWithinClassDefinition
_addAttribute, _adjustOverride, _attachText, _cloneFixAttributeFields, _containedDecorators, _copyChangeRequestList, _debug, _debug, _debug, _debug, _debug, _executeChangeRequests, _getIndentPrefix, _isMoMLSuppressed, _markContentsDerived, _notifyHierarchyListenersAfterChange, _notifyHierarchyListenersBeforeChange, _propagateValue, _removeAttribute, _splitName, _stripNumericSuffix, addChangeListener, addDebugListener, addHierarchyListener, attributeDeleted, attributeList, attributeList, decorators, deepContains, depthInHierarchy, description, description, event, executeChangeRequests, exportMoML, exportMoML, exportMoML, exportMoML, exportMoMLPlain, getAttribute, getAttributes, getChangeListeners, getClassName, getDecoratorAttribute, getDecoratorAttributes, getDerivedLevel, getDerivedList, getDisplayName, getFullName, getModelErrorHandler, getName, getName, getSource, handleModelError, isDeferringChangeRequests, isOverridden, isPersistent, lazyContainedObjectsIterator, message, notifyOfNameChange, propagateValue, propagateValues, removeAttribute, removeChangeListener, removeDebugListener, removeHierarchyListener, requestChange, setClassName, setDeferringChangeRequests, setDerivedLevel, setDisplayName, setModelErrorHandler, setPersistent, setSource, sortContainedObjects, toplevel, toString, validateSettables, workspace
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
createReceivers, getCausalityInterface, getDirector, getExecutiveDirector, getManager, inputPortList, newReceiver, outputPortList
isFireFunctional, isStrict, iterate, postfire, stop, stopFire, terminate
addInitializable, removeInitializable
description, getContainer, getDisplayName, getFullName, getName, getName, setName
getDerivedLevel, getDerivedList, propagateValue
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
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.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 TypedAtomicActor
workspace
- The workspace for the new object.java.lang.CloneNotSupportedException
- If a derived class contains
an attribute that 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<TypedIOPort>
IllegalActionException
- Not thrown in this base classpublic void preinitialize() throws IllegalActionException
preinitialize
in interface Initializable
preinitialize
in class AtomicActor<TypedIOPort>
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.