Functions Introduced:
External objects are associated with their owners and the references that you specify. Currently, the callbacks mechanism
for external objects enables you to receive notification when the reference is deleted, modified, or suppressed. Your callback
function can respond in a manner appropriate for the action taken on the reference.
The
ProExtobjCallbacks object is a structure that specifies the callback functions for each action on the external object's owner or reference.
Each callback function is specified by a function pointer of type
ProExtobjCBAct. When you create an external object class, you should also fill in a
ProExtobjCallbacks object for that class. To set the callbacks for the class, call the
ProExtobjCallbacksSet() function.
|
• |
Currently, the only supported callbacks for external objects are for deletion, modification, and suppression. |
|
• |
You cannot use a callback for an external object that references a Creo Parametric feature (and not some geometry of it). |
The ProExtobjCallbacks data structure is defined as follows:
typedef struct
{
int enabled_cbs;
ProExtobjCBAct display_CB; /* not yet implemented */
ProExtobjCBAct select_CB; /* not yet implemented */
ProExtobjCBAct owner_modify_CB; /* not yet implemented */
ProExtobjCBAct owner_suppress_CB; /* not yet implemented */
ProExtobjCBAct owner_delete_CB; /* not yet implemented */
ProExtobjCBAct ref_modify_CB;
ProExtobjCBAct ref_suppress_CB;
ProExtobjCBAct ref_delete_CB;
} ProExtobjCallbacks;
The first field, enabled_cbs, is a flag that enables and disables the callback functions. Set each of the other fields in the structure to the name of
the callback function appropriate for each action. To enable or disable the callback functions for a particular action and
object class, call the function ProExtobjCBEnable().
As shown in the previous structure, the external objects callbacks are implemented only for cases where the reference is modified,
suppressed, or deleted. For this reason, you must exercise caution when enabling callbacks using ProExtobjCBEnable(). One of the inputs of the function is an action bitmask that specifies which callback actions are to be enabled. The action
bitmask is composed of members of the enumerated type ProExtobjAction. The values of the enumerated type are as follows:
typedef enum
{
PRO_EO_ALT_DISPLAY = (1 << 6),
/* alternate display --
not implemented */
PRO_EO_ALT_SELECT = (1 << 7),
/* alternate selection --
not implemented */
PRO_EO_ACT_OWN_MODIF = (1 << 9),
/* not implemented */
PRO_EO_ACT_OWN_SUPPR = (1 << 10),
/* not implemented */
PRO_EO_ACT_OWN_DELETE = (1 << 11),
/* not implemented */
PRO_EO_ACT_REF_MODIF = (1 << 13),
PRO_EO_ACT_REF_SUPPR = (1 << 14),
PRO_EO_ACT_REF_DELETE = (1 << 15)
} ProExtobjAction;
The action bitmask must not contain any callback actions that are not supported. Given the comments in the ProExtobjCallbacks structure, the only allowed callback actions are PRO_EO_ACT_REF_MODIF, PRO_EO_ACT_REF_SUPPR, and PRO_EO_ACT_REF_DELETE.
The following table describes the actions given in the ProExtobjCallbacks data structure.
Callback Type
|
When it is Triggered
|
display_CB
|
The external object is displayed. Currently, this is not implemented.
|
select_CB
|
The external object is selected. Currently, this is not implemented.
|
owner_modify_CB
|
The owner of the external object is modified. Currently, this is not implemented.
|
owner_suppress_CB
|
The owner of the external object is suppressed. Currently, this is not implemented.
|
owner_delete_CB
|
The owner of the external object is deleted. Currently, this is not implemented.
|
ref_modify_CB
|
The reference of the external object is modified.
|
ref_suppress_CB
|
The reference of the external object is suppressed.
|
ref_delete_CB
|
The reference of the external object is deleted.
|