op_anim_mgp_setup_end()

Abstract

Adds a primitive to the specified macro. This primitive demarcates the end of the setup section of the macro.

Syntax

op_anim_mgp_setup_end (anmid)
Argument Type Description
anmid Anmid macro ID
[This value is a numeric identifier which references an open animation macro, created via the KP op_anim_macro_create().]

Return Type

void

no return value

Example

/* Create a macro which draws a line between two nodes. */
mid = op_anim_macro_create ("node dynconn");

/* Determine the positions of the nodes A & B; the position of A is */
/* stored in (M,N) and the position of B is stored in (O,P). */
op_anim_mme_nobj_pos (mid, OPC_ANIM_OBJTYPE_NODE, OPC_ANIM_REG_A_STR,
	OPC_ANIM_REG_M_INT, OPC_ANIM_REG_N_INT, OPC_ANIM_VERTEX_ICON_CTR);
op_anim_mme_nobj_pos (mid, OPC_ANIM_OBJTYPE_NODE, OPC_ANIM_REG_B_STR,
	OPC_ANIM_REG_O_INT, OPC_ANIM_REG_P_INT, OPC_ANIM_VERTEX_ICON_CTR);

/* Indicate end of register setup section. */
op_anim_mgp_setup_end (mid);

/* Draw the line between the nodes. */
op_anim_mgp_line_draw (mid, OPC_ANIM_COLOR_GREEN,
	OPC_ANIM_REG_M_INT, OPC_ANIM_REG_N_INT, OPC_ANIM_REG_O_INT, OPC_ANIM_REG_P_INT);

/* Execute the macro for source & destination nodes. */
op_anim_igp_macro_draw (vid, OPC_ANIM_RETAIN, mid,
	OPC_ANIM_REG_A_STR, src_nd_name,
	OPC_ANIM_REG_B_STR, dst_nd_name, OPC_EOL);

Details

The setup section of a macro typically determines the positions of model objects, and applies offsets to these positions to compute the positions of related graphical elements. Once the positions have been computed on the first invocation of a macro, there is no need to re-execute the setup section of a macro, unless some of the information that feeds into the computation changes (such as object positions). The setup section of a macro need not be re-executed when a viewer is redrawn. The graphics section of a macro is concerned exclusively with actually drawing the graphical elements at their pre-computed positions.

Purpose

Provides an mechanism for dividing macro operations into setup and graphics sections. This is optional, but it can enhance animation diagram redraw performance since a viewer redraw operation will not re-execute the setup section of a retained macro drawing. Only the graphics section of a macro is re-executed during viewer redraw.

Errors

  • Recoverable Error: Animation macro ID (<anmid>) is [out-of-range] [unrecognized]. (former case due to anmid argument value that is invalid, latter case to destroyed macro)

Reference

本站文档由 北京智网畅联科技有限公司 整理、翻译并提供 · 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