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 the anvid argument)

Reference

  • Use the KPs op_anim_viewer_open() or op_anim_viewer_open_std() to create an animation viewer and obtain its ID, or the KP op_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

本站文档由 北京智网畅联科技有限公司 整理、翻译并提供 · Documentation compiled and provided by Beijing ZNetLink Technology Co., Ltd.

交流群 · QQ Group:OPNET/智网妙算网络仿真交流群(群号 486383494)

原文档 © 2017 Riverbed Technology · 本站为公益翻译,由 AI 辅助完成,请仔细甄别

Original documentation © 2017 Riverbed Technology. Community translation, AI-assisted. Contact: jiazequn@znetlink.com