DATASERV (kgeom) functions


LIBRARY ROUTINE

kgeom_write_primitive - write a geometry primitive

LIBRARY CALL

int
kgeom_write_primitive(
   kgeom_object    *object, 
   kgeom_primitive *primitive)

INPUT

OUTPUT

none

RETURN VALUE

TRUE on success, FALSE otherwise

DESCRIPTION

This routine will write a given primitive and all associated data to the file indicated by the provided object.

In general, the kgeom_write_object() function should be used instead of this function. This function has been made public to provide complete flexibility for writing a geometry object. It should only be used when you wish to write a geometry object primitive-by-primitive.

If you wish to use this function to write out a primitive at a time, you should follow this sequence to write out the the object:

kgeom_write_header(object, "filename");

kgeom_start_writing_object(object);

At this point, you can start writing out individual primitives using the kgeom_write_primitive() function. The file to be written to is determined from the open fid inside the object.

When you are done writing primitives, finish with the following calls :

kgeom_finish_writing_object(object);

kgeom_done_writing(object);

The object presentation is used to determine how much data is present in the primitive, so make sure the has_alpha, layout, location_dim, and other fields are set correctly. These should be valid before the call to kgeom_start_writing_object() is made. The primitive does not have to be present on the object's primitive list to be written.

ADDITIONAL INFORMATION

none

EXAMPLES

none

SIDE EFFECTS

none

RESTRICTIONS

none

MODIFICATION

none

FILES

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

SEE ALSO

kgeom(3)

COPYRIGHT

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