int
kgeom_add_primitive(
kgeom_object *object,
kgeom_primitive *primitive)
none
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.
*
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.
none
$DATASERV/objects/library/kgeom/src/object.c