DATASERV (kgeom) functions


LIBRARY ROUTINE

kgeom_number_primitives - count the number of primitives in the given object

LIBRARY CALL

int
kgeom_number_primitives(kgeom_object *object)

INPUT

OUTPUT

none

RETURN VALUE

the number of primitives contained in the object

DESCRIPTION

This function will return the number of primitives contained in 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. 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

Note that another geometry object contained on the primitive list of this object will be considered to be a single primitive. The primitives contained in a subobject is not considered when counting the number of primitives in the given object.

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_add_primitive, kgeom_remove_primitive, kgeom_get_primitive

COPYRIGHT

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