get or set a floating-point value
int _ GDget_float_val ( parent_id , _ elem_name , _float * val );
int _ GDget_newfloat_val ( parent_id , _ elem_name , _ seq , _float * val );
int _ GDget_updfloat_val ( parent_id , _ elem_name , _ seq , _float * val );
void _ GDset_float_val ( parent_id , _ elem_name , _float val );
void _ GDset_newfloat_val ( parent_id , _ elem_name , _ seq , _float val );
OMobj_id _ parent_id ;
char _* elem_name ;
int _* seq ;
GDget_float_val gets a floating-point value and places the value into val . The return value is 1 if successful, 0 if a failure.
GDget_newfloat_val gets a floating-point value and places the value into val . The routine also returns the value's updated sequence number. The return value is 1 if the data has changed, 0 if it has not.
GDget_updfloat_val gets a floating-point value and places the value into val . The return value is 1 if the data has changed, 0 if it has not.
GDset_float_val sets a floating-point value.
GDset_newfloat_val sets a floating-point scalar object. The routine also returns the value's updated sequence number.
/* Get, then set, the value of a camera's scale subobject*/
OMobj_id _camera_id; /* Assume this has been set. */
float scale;
int status;
...
status = GDget_float_val(camera_id, "scale", &scale);
if (status == 0) {
printf("Error getting the camera's scale subobject\n");
return(1);
};
/* Modify the value, then set the object. */
scale *= 1.1;
GDset_float_val(camera_id, "scale", scale);