DATASERV (koldgeom) functions


LIBRARY ROUTINE

kgeom_put_data - put data into a data object.

LIBRARY CALL

kobject kgeom_put_data(
   kobject object,
   int     primitive,
   kvalist)

INPUT

OUTPUT

none

RETURN VALUE

TRUE (1) on success, FALSE (0) otherwise

DESCRIPTION

This function is used to put data for a given primitive into a data services object.

Geometry primitives typically consist of multiple data segments, with different primitives having different data segments associated with them. These data components are provided to this function via multiple data arguments.

For example, the following call will assign the data a list of sphere data to a geometry primitive.

float *locations = (float *) get_some_location_data(); float *colors = (float *) get_some_color_data(); float *radii = (float *) get_some_radii_data();

kgeom_put_data(object,KGEOM_SPHERES,locations,colors,radii);

Note that data does not have to be provided for all segments. In such cases, a NULL may be provided as the data argument. For example, to put a spheres primitive with no color data, the following call would be used.

kgeom_put_data(object,KGEOM_SPHERES,locations,NULL,radii);

The amount of data and data type expected for each primitive component is determined by a number of object level attributes. The primitive-level attribute KGEOM_NUMBER_OF_VERTICES should be set before any data is put to indicate how much data is going to be put. This is not true for the mesh primitives, which each have their different size attributes.

A complete list of geometry attributes and primitives can be found in Chapter 3 of Programming Services Volume II.

ADDITIONAL INFORMATION

none

EXAMPLES

none

SIDE EFFECTS

none

RESTRICTIONS

This function assumes that a sufficient number of pointers are given with the variable argument list to supply data for all segments of the primitive. If they are not, unpredictable behavior may occur. Also, once a primitive has been put, it can not be "re-put". It may be destroyed along with the rest of the primitive list with a call to kgeom_destroy_primitive_list().

MODIFICATION

none

FILES

$DATASERV/objects/library/koldgeom/src/geometry.c

SEE ALSO

koldgeom(3)

COPYRIGHT

Copyright (C) 1993 - 1997, Khoral Research, Inc. ("KRI") All rights reserved.