DATASERV (kgeom) functions


LIBRARY ROUTINE

kgeom_add_primitive - add a primitive to a geometry object

LIBRARY CALL

int
kgeom_add_primitive(
   kgeom_object *object,
   kgeom_primitive *primitive)

INPUT

OUTPUT

none

RETURN VALUE

TRUE on success, FALSE on failure

DESCRIPTION

This function will add the given primitive to the end of the primitive list of the given object.

Geometry Primitives and Primitive Lists

A geometry primitive contains geometric data which describes a shape in space. Lines, triangles, and spheres, are all considered to be geometric primitives. For a complete description of all the geometry primitives, see the kgeom_primitive man page.

Each geometry object contains a list of such geometry primitives. New primitives can be created using the function kgeom_new_primitive(). The function kgeom_remove_primitive() allows you to remove a primitive from the primitive list of an object after it has been added. At any time, the number of primitives which have been added to the primitive list of an object can be determined by the function kgeom_number_primitives(). A primitive at any given position can be retrieved using the function kgeom_get_primitive().

The primitive functions should be the only means used for accessing the primitives on a primitive list. Even though the primitive list of the geometry object could be acccessed directly, it should be considered to be private. By using the primitive list function calls, you can be certain to maintain the integrity of the primitive list.

ADDITIONAL INFORMATION

* If the primitive provided is another geometry object, the geometry object will be placed on the primitive list as a subobject. Using this capability, complex hierarchies of geometric data can be constructed. Note that the geometry object should be cast to the kgeom_primitive * type when being passed into this function.

EXAMPLES

none

SIDE EFFECTS

none

RESTRICTIONS

none

MODIFICATION

none

FILES

$DATASERV/objects/library/kgeom/src/object.c

SEE ALSO

kgeom(3), kgeom_primitive, kgeom_new_primitive, kgeom_blast_primitive, kgeom_remove_primitive, kgeom_get_primitive, kgeom_number_primitives

COPYRIGHT

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