op_anim_viewer_open_std()
Abstract
Opens a viewer with the specified name at the specified standard location.
Syntax
op_anim_viewer_open_std (name, location)
| Argument | Type | Description |
|---|---|---|
name |
char* |
viewer name [Viewer names are used as “rendezvous points” for global animations (i.e., repeated viewer open operations reusing a viewer name will return the same viewer ID as the original viewer open operation); thus multiple processes or even remote modules can share the same viewer. Viewer names also appear in the banner of the viewer, serving as a window title.] |
location |
int |
viewer location [This is a numeric code that specifies a single standard viewer location (including associated position and size). The standard location symbolic constants are listed in the Details section |
Return Type
Anvid
numeric ID of the opened viewer
[This integer ID is used as a “handle” to refer to the new viewer in calls to other op_anim… KPs.]
Example
/* Open a viewer for network. */
net_vid = op_anim_viewer_open_std ("Network View", OPC_ANIM_LOCATION_W_HALF);
/* Load network model. */
op_anim_ime_nmod_draw (net_vid, OPC_ANIM_MODTYPE_NETWORK, "inet", "top",
OPC_ANIM_MOD_OPTION_NONE, OPC_ANIM_DEFPROPS);
/* Open a viewer for node. */
node_vid = op_anim_viewer_open_std ("Node View", OPC_ANIM_LOCATION_E_HALF);
/* Load node model. */
op_anim_ime_nmod_draw (node_vid, OPC_ANIM_MODTYPE_NODE, "inet_fddi_gwy", " ",
OPC_ANIM_MOD_OPTION_NONE, OPC_ANIM_DEFPROPS);
Details
Explicitly opening an animation viewer is one of several techniques available to obtain access to a viewer for animation request display (the other techniques rely on custom animation probes to automatically open their associated viewers). An invocation of this KP will open a viewer as specified by the function arguments, and will ignore the viewer attributes specified by any defined custom animation probes.
Execution of this KP is disabled by the standard masking conditions: an inactive animation flow, or a complete lack of custom animation probes. However, execution is not disabled by the lack of active custom animation probes, due to the importance of having a viewer available for animation KPs independent of when the probe becomes active.
The location argument indicates the position and size of the new window, and should be passed a symbolic constant with the format OPC_ANIM_LOCATION_<loc>, where possible values of <loc> are:
- FULL—full workspace
- N_HALF—north half of workspace
- S_HALF—south half of workspace
- E_HALF—east half of workspace
- W_HALF—west half of workspace
- NW_QTR—northwest quarter of workspace
- NE_QTR—northeast quarter of workspace
- SW_QTR—southwest quarter of workspace
- SE_QTR—southeast quarter of workspace
Purpose
Provides a mechanism to open a standard-sized window for displaying animations. Viewers are the “drawing surfaces” of animations, so there must be at least one viewer opened in each viewable animation. Standard viewer window locations are useful when several viewers must be displayed in a compound animation; the standard locations neatly “tile” the op_vuanim work area and avoid viewer overlaps.
Errors
- Program Abort: segmentation violation (due to a badly formed string for the
nameargument)
Reference
- Use the KP
op_anim_viewer_open()to open a viewer using custom location and size parameters - Use the KP
op_anim_lprobe_anvid()to obtain the ID of a viewer opened by a labeled animation probe - Use the
op_anim_igp…KPs to display graphical primitives in an opened viewer - Use the
op_anim_ime…KPs to display or modify model elements in an opened viewer - Use the KP
op_anim_viewer_close()to erase and deallocate an open viewer - Use the KP
op_anim_viewer_redraw()to cause a redraw of a viewer