GDIndex.gif Previous-2.gif Next-3.gif

GDget_float_val- GD API


Synopsis

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 ;

Description

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.

Parameters

parent_id

The id of the target subobject's parent.

elem_name

The name of the target subobject.

seq

(GDget_newfloat_val only)  An input/output argument. It is used to compare against the value's current sequence number to determine if the value has changed. It is then updated with the current sequence number.

(GDget_updfloat_val only)  An input argument. It is used to compare against the value's current sequence number to determine if the value has changed.

(GDset_newfloat_val only)  An output argument that is updated with the current sequence number.

val

In the GDget_xxxx routines, the address where the routine places the value.

In the GDset_xxxx routines, the value that the routine copies.

Example


/* 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);

 



GDIndex.gif Previous-2.gif Next-3.gif