op_anim_viewer_redraw()
Abstract
Refreshes the specified viewer’s window and all its retained drawings.
Syntax
op_anim_viewer_redraw (anvid)
| Argument | Type | Description |
|---|---|---|
anvid |
Anvid |
viewer ID [This value is a numeric identifier which references the viewer to be redrawn.] |
Return Type
void
no return value
Example
/* Determine current simulation time. */
current_time = op_sim_time ();
/* Remove out-of-date drawings without erasing them; the upcoming */
/* redraw will actually erase them. */
for (i = 0, do_redraw = 0; i < num_drawings; i++)
{
if (drawing_data [i].timeout < current_time)
{
op_anim_igp_drawing_erase (vid, drawing_data [i].did,
OPC_ANIM_ERASE_MODE_NONE);
do_redraw = 1;
}
}
if (do_redraw)
{
/* Redraw viewer to restore known state. */
op_anim_viewer_redraw (vid);
}
Details
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 clean up any graphical “garbage” (unwanted by-products of animation) that may have accumulated on the screen. This includes any drawings that are not retained; only retained drawings will be redisplayed. In the middle of an animation flow, this KP guarantees that later graphical operations are being performed starting from a clean graphical state.
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 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 - Use the
op_anim_igp…KPs to display graphical primitives in a viewer - Use the
op_anim_ime…KPs to display or modify model elements in a viewer