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 toanmidargument value that is invalid, latter case to destroyed macro)
Reference
- Use the KP op_anim_macro_create() to create an empty macro
- Use the KP op_anim_macro_close() to indicate the completion of a macro definition
- Use the KP op_anim_igp_macro_draw() to invoke a macro within a viewer