ptolemy.domains.gr.lib
Class MovableViewScreen3D

java.lang.Object
  extended by ptolemy.kernel.util.NamedObj
      extended by ptolemy.kernel.InstantiableNamedObj
          extended by ptolemy.kernel.Entity
              extended by ptolemy.kernel.ComponentEntity
                  extended by ptolemy.actor.AtomicActor
                      extended by ptolemy.actor.TypedAtomicActor
                          extended by ptolemy.domains.gr.kernel.GRActor
                              extended by ptolemy.domains.gr.kernel.GRActor3D
                                  extended by ptolemy.domains.gr.lib.ViewScreen3D
                                      extended by ptolemy.domains.gr.lib.MovableViewScreen3D
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, Actor, Executable, FiringsRecordable, Placeable, Initializable, TypedActor, ViewScreenInterface, Changeable, Debuggable, DebugListener, Derivable, Instantiable, ModelErrorHandler, MoMLExportable, Moveable, Nameable

public class MovableViewScreen3D
extends ViewScreen3D

A sink actor that renders the GR geometry into a display screen with movable viewpoint.

Since:
Ptolemy II 4.1
Version:
$Id: MovableViewScreen3D.java 57040 2010-01-27 20:52:32Z cxh $
Author:
Adam Cataldo
See Also:
Serialized Form
Accepted Rating:
Red (acataldo)
Proposed Rating:
Red (acataldo)

Nested Class Summary
 
Nested classes/interfaces inherited from class ptolemy.kernel.Entity
Entity.ContainedObjectsIterator
 
Field Summary
private  DoubleToken _angle
           
private  ArrayToken _axis
           
private  DoubleToken _initialAngle
           
private  ArrayToken _initialAxis
           
private  ArrayToken _initialPosition
           
private  ArrayToken _position
           
(package private)  PortParameter viewerPosition
          A double array representing the (x,y,z) position of the view frame relative to the virtual universe.
(package private)  PortParameter viewerRotationAngle
          A double value representing the angle, in radians, of rotation about the viewerRotationAxis.
(package private)  PortParameter viewerRotationAxis
          A double array representing an axis of rotation for the view frame.
 
Fields inherited from class ptolemy.domains.gr.lib.ViewScreen3D
_bounds, _branchRoot, _canvas, _container, _frame, _iterationSynchronized, _lastTransform, _mouseRotate, _root, _simpleUniverse, _userTransformation, backgroundColor, horizontalResolution, iterationSynchronized, rotatable, scalable, sceneGraphIn, showAxes, translatable, verticalResolution
 
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
MovableViewScreen3D(CompositeEntity container, java.lang.String name)
          Construct a ViewScreen in the given container with the given name.
 
Method Summary
 java.lang.Object clone(Workspace workspace)
          Clone the actor into the specified workspace.
 void fire()
          Call the ViewScreen fire() method, and translate and rotate the image if needed.
 void initialize()
          Call the ViewScreen initialize() method, and set the correct location of the viewer.
 boolean postfire()
          Update the input values of the state.
 void wrapup()
          Reset the state to the initial values.
 
Methods inherited from class ptolemy.domains.gr.lib.ViewScreen3D
_addChild, _createViewScreen, _getHorizontalPixels, _getNodeObject, _getVerticalPixels, _makeBackground, _makeNodeConnection, _makeSceneGraphConnection, _startRenderer, _stopRenderer, addChild, getBranchGroup, getCanvas, place
 
Methods inherited from class ptolemy.domains.gr.kernel.GRActor3D
_setViewScreen
 
Methods inherited from class ptolemy.actor.TypedAtomicActor
_addPort, _fireAt, _fireAt, attributeTypeChanged, clone, newPort, typeConstraintList, typeConstraints
 
Methods inherited from class ptolemy.actor.AtomicActor
_actorFiring, _actorFiring, addActorFiringListener, addInitializable, connectionsChanged, createReceivers, declareDelayDependency, getCausalityInterface, getDirector, getExecutiveDirector, getManager, inputPortList, isFireFunctional, isStrict, iterate, newReceiver, outputPortList, prefire, preinitialize, pruneDependencies, recordFiring, removeActorFiringListener, removeDependency, removeInitializable, setContainer, stop, stopFire, terminate
 
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 ptolemy.kernel.util.NamedObj
_addAttribute, _adjustOverride, _attachText, _cloneFixAttributeFields, _debug, _debug, _debug, _debug, _debug, _getIndentPrefix, _isMoMLSuppressed, _markContentsDerived, _propagateValue, _recordDecoratedAttributes, _removeAttribute, _splitName, _stripNumericSuffix, addChangeListener, addDebugListener, attributeChanged, attributeList, attributeList, 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, propagateValue, propagateValues, removeChangeListener, removeDebugListener, requestChange, setClassName, setDeferringChangeRequests, setDerivedLevel, setDisplayName, setModelErrorHandler, setPersistent, setSource, sortContainedObjects, toplevel, toString, validateSettables, workspace
 
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, prefire, stop, stopFire, terminate
 
Methods inherited from interface ptolemy.actor.Initializable
addInitializable, preinitialize, 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

viewerPosition

PortParameter viewerPosition
A double array representing the (x,y,z) position of the view frame relative to the virtual universe. By default, this value is (0,0,2.4).


viewerRotationAxis

PortParameter viewerRotationAxis
A double array representing an axis of rotation for the view frame. By default, when you look at the view screen, you are looking in the (0.0, 0.0, -1.0) direction of the virtual universe. Your right is the (1.0, 0.0, 0.0) direction, and up is the (0.0, 1.0, 0.0) direction. In this situtation, the frame describing the viewer has its positive z-axis going from the screen to you. It's positive x-axis points right, and it's positve y-axis points up. When the viewerRotationAxis and the viewerRotationAngle are provided, the ViewScreen frame is rotated counterclockwise around the viewerRotationAxis by the viewerRotationAngle.


viewerRotationAngle

PortParameter viewerRotationAngle
A double value representing the angle, in radians, of rotation about the viewerRotationAxis.


_position

private ArrayToken _position

_axis

private ArrayToken _axis

_angle

private DoubleToken _angle

_initialPosition

private ArrayToken _initialPosition

_initialAxis

private ArrayToken _initialAxis

_initialAngle

private DoubleToken _initialAngle
Constructor Detail

MovableViewScreen3D

public MovableViewScreen3D(CompositeEntity container,
                           java.lang.String name)
                    throws IllegalActionException,
                           NameDuplicationException
Construct a ViewScreen in the given container with the given name. If the container argument is null, a NullPointerException will be thrown. If the name argument is null, then the name is set to the empty string. Increment the version number of the workspace.

Parameters:
container - Container of the director.
name - Name of this ViewScreen.
Throws:
IllegalActionException - If this actor is not compatible with the specified container.
NameDuplicationException - If the container not a CompositeActor and the name collides with an entity in the container.
Method Detail

clone

public java.lang.Object clone(Workspace workspace)
                       throws java.lang.CloneNotSupportedException
Clone the actor into the specified workspace.

Overrides:
clone in class AtomicActor
Parameters:
workspace - The workspace for the new object.
Returns:
A new actor.
Throws:
java.lang.CloneNotSupportedException - If a derived class contains an attribute that cannot be cloned.
See Also:
NamedObj.exportMoML(Writer, int, String), NamedObj.setDeferringChangeRequests(boolean)

fire

public void fire()
          throws IllegalActionException
Call the ViewScreen fire() method, and translate and rotate the image if needed.

Specified by:
fire in interface Executable
Overrides:
fire in class ViewScreen3D
Throws:
IllegalActionException - If the input array has the wrong size.

initialize

public void initialize()
                throws IllegalActionException
Call the ViewScreen initialize() method, and set the correct location of the viewer.

Specified by:
initialize in interface Initializable
Overrides:
initialize in class ViewScreen3D
Throws:
IllegalActionException - If the input array has the wrong size.

postfire

public boolean postfire()
                 throws IllegalActionException
Update the input values of the state.

Specified by:
postfire in interface Executable
Overrides:
postfire in class ViewScreen3D
Returns:
Returns the value from its super class.
Throws:
IllegalActionException - Thrown if super class throws it.

wrapup

public void wrapup()
            throws IllegalActionException
Reset the state to the initial values.

Specified by:
wrapup in interface Initializable
Overrides:
wrapup in class ViewScreen3D
Throws:
IllegalActionException - Thrown if super class throws it.