op_anim_viewer_close()
Abstract
Closes the specified viewer by removing its window and deallocating all of its retained drawings and other memory.
Syntax
op_anim_viewer_close (anvid)
| Argument | Type | Description |
|---|---|---|
anvid |
Anvid |
viewer ID [This value is a numeric identifier which references the viewer to be closed.] |
Return Type
void
no return value
Example
/* Determine interrupt type. */
itype = op_intrpt_type ();
/* Check for node failure interrupt. */
if (itype == OPC_INTRPT_FAIL)
{
/* Node is dead; close associated animation viewer and macros. */
op_anim_viewer_close (local_vid);
op_anim_macro_destroy (local_move_mid);
op_anim_macro_destroy (local_comm_mid);
}
Details
Once a viewer has been closed by this KP during a simulation, no further Anim package KPs should be called which reference the closed viewer’s ID (anvid).
In addition to the sources of viewer IDs listed in the Reference section, the symbolic constant OPC_ANIM_ANVID_PBSPEC can be used as a substitute viewer ID, indicating that the real viewer ID should be obtained from an active unlabeled custom animation probe.
Purpose
Provides a mechanism to remove a viewer window in the middle of an animation. This can be useful if a viewer is not displaying any information that is interesting after a certain time, and will otherwise just occupy valuable screen space that could be used for other viewers.
Errors
- Diagnostic Error: Animation viewer ID (
<anvid>) is out-of-range. (due to an invalid value for theanvidargument)
Reference
- Use the KPs
op_anim_viewer_open()orop_anim_viewer_open_std()to originally create an animation viewer and obtain its ID, or the KPop_anim_lprobe_anvid()to obtain the ID of a viewer opened by a labeled custom animation probe