TOC PREV NEXT INDEX

GDget_refer_db

Synopsis

get or set a reference to an object

int _ GDget_refer_db _( parent_id , _ elem_name , _OMobj_id * ref_id );
void _ GDset_refer_db _( parent_id , _ elem_name , _OMobj_id ref_id );

OMobj_id _ parent_id ;
char _* elem_name ;

Description

Several objects in the Graphics Display Kit are references to other objects. For example, consider the view object's camera subobject:

group GDview_templ {
...
GDcamera_templ &camera; // "&" means by-reference.
...

camera is a reference, or connection, to a camera object.

The routines described here enable you to get or set the reference to an object.

GDget_ref_db gets an object's reference. The routine returns into ref_id the id of the referenced object.

GDset_ref_db sets an object's reference to the object identified by ref_id .

Parameters

parent_id

The id of the target object's parent object.

elem_name

The name of the target object.

ref_id

In GDget_refer_db, an output argument set to the the id of the referenced object.
In GDset_refer_db, an input argument indicating the id of the new referenced object.

Return Value

(GDget_refer_db only) _1 if successful; 0 if GDget_refer_db failed.

Example

/* Get the id of the object referenced by a view's camera
__subobject. */
OMobj_id _view_id; /* Assume this has been set. */
OMobj_id camera_ref_id;
int status;
...
status = GDget_refer_db(view_id, "camera", &camera_ref_id);
if (status == 0) {
printf("Error getting the camera reference\n");
return(1);
};


TOC PREV NEXT INDEX