op_anim_ime_nobj_update()
Abstract
Updates a model object displayed in a viewer with a list of animation attribute assignments.
Syntax
op_anim_ime_nobj_update (anvid, obj_type, obj_name, [ obj_attr_id, obj_attr_val, ]… OPC_EOL)
| Argument | Type | Description |
|---|---|---|
anvid |
Anvid |
viewer ID [This value is a numeric identifier which references a viewer. The object update will be performed in the viewer’s window.] |
obj_type |
int |
object type code [This value is a numeric code which identifies the type of object being updated. Symbolic constants for the supported object types appear under “Animation Object Type Symbolic Constants“ on page 8.] |
obj_name |
char* |
object name |
obj_attr_id |
int |
object attribute ID [This value is a numeric code which identifies an object animation attribute to update; symbolic constants for the supported attributes appear in the Details section.] |
obj_attr_val |
void* |
value for assignment to object attribute |
Return Type
void
no return value
Example
/* Open a full-size animation viewer. */
vid = op_anim_viewer_open_std ("Network Display", OPC_ANIM_LOCATION_FULL);
/* Load and draw a network model into viewer. */
op_anim_ime_nmod_draw (vid, OPC_ANIM_MODTYPE_NETWORK, "anet", "top",
OPC_ANIM_MOD_OPTION_NONE, OPC_ANIM_DEFPROPS);
/* Determine the name of the "animation" node. */
mod_objid = op_id_self ();
node_objid = op_topo_parent (mod_objid);
op_ima_obj_attr_get (node_objid, "name", node_name);
/* Change the icon of the "animation" node so that it is not seen. */
op_anim_ime_nobj_update (vid, OPC_ANIM_OBJTYPE_NODE, node_name,
OPC_ANIM_OBJ_ATTR_ICON, "blank", OPC_EOL);
Details
The arguments to this KP include a list of zero or more object animation attribute assignments. Each attribute assignment is represented by a pair of adjacent arguments (obj_attr_id and obj_attr_val); the list is terminated by the symbolic constant OPC_EOL (“End-Of-List”). Supported attributes are:
| Constant | Description | Data Type |
|---|---|---|
OPC_ANIM_OBJ_ATTR_COLOR |
object color (for path objects) | integer |
OPC_ANIM_OBJ_ATTR_ICON |
object icon (for icon-based objects) | string |
OPC_ANIM_OBJ_ATTR_XPOS |
object x coordinate (nodes & subnets only) | double |
OPC_ANIM_OBJ_ATTR_YPOS |
object y coordinate (nodes & subnets only) | double |
OPC_ANIM_OBJ_ATTR_VECTOR_ANGLE |
object vector line | double |
The object color attribute expects the same color flags that are passed to graphical property arguments (i.e., symbolic constants of the form OPC_ANIM_COLOR_<x>, as listed in Table 26 “Animation Graphical Property Symbolic Constants—Colors“ on page 4). In general, only path objects reflect color attribute updates, and only icon-based objects reflect the icon, xpos, and ypos attribute updates. The object icon attribute expects an icon name string; the specified icon must be accessible by the op_vuanim program to avoid animation viewing errors. The object xpos and ypos attributes expect floating-point object position coordinates in the model diagram units (for instance, these might be in units of kilometers for a node). Node and process model units correspond to screen pixels, except for model diagram scaling compensation. 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 for dynamically updating some graphical aspects of a model element. For example, the icon of a queue can be dynamically cycled through several options in response to the queue’s packet level.
Errors
- Program Abort: segmentation violation (due to incorrect data types for the
obj_attr_idorobj_attr_valarguments, or to a badly formed string for theobj_nameargument) - Recoverable Error: Animation object attribute ID (
<obj_attr_id>) is out-of-range. Unable to continue animation flow. (due to an out-of-range object attribute ID) - Recoverable Error: Anim. object type (
<obj_type>) doesn’t support attribute ID (<obj_attr_id>). Unable to continue animation flow. (due to an attribute ID not supported by object) - Standard diagnostic errors for the
anvidandobj_typearguments being out-of-range.
Reference
- Use the KP op_anim_ime_nmod_draw() to load and display a model within an animation viewer (this is required before model objects can be updated using op_anim_ime_nobj_update())
- Use the KP op_anim_mme_nobj_pos() to determine the position of a model object within a macro, for use in displaying graphical figures in the proximity of the object
- 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