Table of Contents

_________________________________________________________________

## NAME

v_open - create and manipulate a view object.

## SYNOPSIS

v_open [viewName]

## DESCRIPTION

The v_open command creates a new view object (given by the viewName argument). The v_open command returns its viewName argument. At the time this command is invoked, there must not exist a view object named viewName.

## METHODS

The v_open command creates a new Tcl command whose name is viewName. This command may be used to invoke various operations on the view object. It has the following general form:

viewName option ?arg arg ...?

Option and the args determine the exact behavior of the command. The following commands are possible for view objects:

viewName aet azimuth elevation [twist]
  Set the view orientation by rotating the eye position about the center of the viewing cube. The eye position is determined by the supplied azimuth and elevation angles (degrees). The azimuth angle is measured in the XY plane with the positive X direction corresponding to an azimuth of zero degrees. Positive azimuth angles are measured counterclockwise about the positive Z axis. Elevation angles are measured from the XY plane with +90 degrees corresponding to the positive Z direction and -90 corresponding to the negative Z direction. If an optional twist angle is included, the view will be rotated about the viewing direction by the specified twist angle. If no arguments are provided, the current view orientation is returned.

viewName base2local
  Return the base units (i.e. mm) to local units conversion factor.

viewName center [x y z]
  Position the center of the viewing cube at the specified model coordinates. This is accomplished by moving the eye position while not changing the viewing direction. The coordinates are expected in millimeters. If no arguments are provided, the current center coordinates are returned.

viewName close
  Close/destroy the view object

viewName eye x y z
  Position the eye point at x, y, and z (specified in mm).

viewName eye_pos

viewName invSize
  Return the inverse view size.

viewName local2base
  Return the local units to base units (i.e. mm) conversion factor.

viewName lookat
  Adjust the current view such that the eye is looking in the direction of the given coordinates, but does not move the eye point nor change the viewsize. This is similar to just rotating the viewers head to look at the specified point, putting that point in the center of the mged display.

viewName model2view
  Return a matrix that can be used to transform model coordinates to view coordinates.

viewName observer [subcommand]
  This command is used to maintain a list of observers. Observers are objects who have registered an interest in this view object and are notified when the view changes.

  viewName observer attach obs [command]
    Add the specified observer, obs, to the list of observers. If command is specified then it is executed each time the view changes. Otherwise, the observer is expected to have an update method which is called with the name of this view object as an argument.

  viewName observer detach obs
    Remove the specified observer, obs, from the list of observers.

  viewName observer show
    Return the list of observers for this view object.

viewName orientation
  Set the view direction from the quaternion specified on the command line.

viewName perspective [angle]
  Set/get the perspective angle.

viewName pmat
  Return the perspective matrix.

viewName pmodel2view
  Return a matrix that can be used to transform model coordinates to view coordinates with perspective.

viewName pov
  Set the point of view (experimental).

viewName rmat [matrix]
  Set/get the rotation matrix.

viewName rot x y z
  Rotate the view by x, y, z degrees.

viewName size [s]
  Set/get the size of the viewing cube.

viewName slew x y
  Move the view center to (x, y). The parameters x, y are integer values relative to the screen. For example, the center of the screen is (0, 0), the upper left corner is (-1, 1) and the lower right is (1, -1).

viewName tra x y z
  Move the view center by the distances indicated by x, y, and z (local units).

viewName units
  Set/get the local units.

viewName view2model
  Return a matrix that can be used to transform view coordinates to model coordinates.

viewName zoom sf
  Change the size of the viewing cube by a factor of sf.

## EXAMPLE

The following sequence creates a view object and changes it's parameters.

cwish> v_open v
v
cwish> v aet "35 25 0"
cwish> v size 500
cwish> v center "100 0 0"

## ACKNOWLEDGEMENTS:

Mark L. Ulferts <mulferts@austin.dsccc.com>

            Basic layout for documenting classes.

## AUTHOR

Robert G. Parker

Table of Contents

- NAME
- SYNOPSIS
- DESCRIPTION
- METHODS
- EXAMPLE
- ACKNOWLEDGEMENTS
- AUTHOR