kobject kgeom_get_data(
kobject object,
int primitive,
kvalist)
KGEOM_PRIMITIVE_POSITION
attribute.
If the entry in the primitive list at this
position does not match this primitive, an
error will result.
&data1, &data2, ...
The number of data pointers in the variable argument list for each primitive depends on the primitive.
Geometry primitives typically consist of multiple data components, with different primitives having different data components associated with them.
These data components will be returned via the provided data arguments. The data arguments can be thought of as both input and output arguments. As input, these arguments dictate whether or not space needs to be allocated for the returning data. As output, these arguments will point to the blocks of data being returned.
Specifically, if the data arguments are pointing to NULL, then memory will be allocated to store the requested data If these arguments do not point to NULL, then this function will assume that the data arguments point to a sufficient amount of memory for returning the requested data.
For example, the following call will retrieve the data contained from a geometry object containing spheres as well as allocate space for the data being returned.
float *locations = NULL;
float *colors = NULL;
float *radii = NULL;
kgeom_get_data(object,KGEOM_SPHERES,&locations,&colors,&radii);
The amount of data being returned for each primitive
component is determined by a number of object level
attributes, but is primarily based on the setting
of the primitive-level attribute
KGEOM_NUMBER_OF_VERTICES
.
If NULL is passed in for a data argument, that data data component will be skipped.
Some object level attributes may be set to affect the
presentation of the returned data without affecting
the stored data itself. For example, setting the
object level attribute
KGEOM_LOCATION_DATA_TYPE
to KFLOAT
will cause all location data to be returned as
floating point numbers regardless of how the data may
be physically stored within the data object.
A complete list of geometry attributes and primitives can be found in Chapter 3 of Programming Services Volume II.
none
none
$DATASERV/objects/library/koldgeom/src/geometry.c