kgeom_primitive *
kgeom_read_primitive(kgeom_object *object)
none
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 reading a geometry object. It should
only be used when you wish to read a geometry object
primitive-by-primitive.
If you wish to use this function to read in a primitive at a time, you should follow this sequence to reading the object:
object = kgeom_read_header("filename");
If this has returned a valid object, then the object itself can be read. The next call will read in all the specific information
kgeom_start_reading_object(object);
At this point, you can start reading in individual
primitives using the kgeom_read_primitive()
function. The file to be read from is determined
from the open fid inside the object. This function
will return NULL if there are no more primitives to
read.
After all primitives have been read, finish with the following calls :
kgeom_finish_reading_object(object);
kgeom_done_reading(object);
The object presentation is used to determine how much
data is present in the primitive. The call to
kgeom_start_reading_object()
should have
initialized these fields appropriately. The primitive
will not be added to the object, so you are free to
destroy it or add it to a different object if you
choose.
none
none
$DATASERV/objects/library/kgeom/src/prim_read.c