Action:
|
Restores an
entity_list from disk.
|
|
Prototype:
|
outcome api_restore_entity_list_file (
|
|
|
FileInterface* file_ptr,
|
// open file descriptor
|
|
|
ENTITY_LIST& entities,
|
// returns entities
|
|
|
|
|
// restored
|
|
|
AcisOptions* ao = NULL
|
// acis options
|
|
|
);
|
|
Includes:
|
#include "kernel/acis.hxx"
|
|
#include "kernel/kernapi/api/api.hxx"
|
|
#include "kernel/kernapi/api/kernapi.hxx"
|
|
#include "kernel/kerndata/lists/lists.hxx"
|
|
#include "kernel/kernutil/fileio/fileif.hxx"
|
|
#include "kernel/kernapi/api/acis_options.hxx"
|
|
Description:
|
This API restores a list of entities from a file. The
file_ptr points to an open file positioned at the point where this API begins the restore entity. When the restore is complete, the file will be correctly positioned at the end of the entity save. This allows an application to restore multiple entities intermixed with other application specific data in a single save file.
|
|
|
The calling API must establish whether the file is text or binary and
text_mode must be set correctly.
|
|
|
Restoring a binary file is roughly twice as fast as restoring a text file. However, use binary files only when the file is created and read on the same version of
ACIS running on the same type of machine. If an unrecognized entity type is encountered in a binary file, the restore process goes awry.
|
|
|
When an entity is restored from a text file, any unrecognized main entity types (BODY,
CURVE, etc.) are skipped and any references to those entities are set to
NULL. Unrecognized descendent entities of
ATTRIB,
SURFACE, or
CURVE generate a new record for their immediate owner class and references to them become references to the new record. If a record for a derived class of
ATTRIB is not recognized, at the least an
ATTRIB record will result so that the chain of attributes for the entity owning the unrecognized attribute remains connected.
|
|
|
It is possible to restore entities made by versions of
ACIS having different sets of attribute classes. Attribute types common to the two versions will be restored, but attributes of types unknown to the receiving version of
ACIS will be ignored.
|
|
|
Reading from text files gives better recovery from error than does reading from binary files.
|
|
|
A warning is given if the version of
ACIS receiving the model differs from the version that made the save file. It is an error if the current
ACIS is older than that recorded in the file.
|
|
Errors:
|
Warning: Version number of this
ACIS differs from version that made the save file being read.
|
|
|
|
Warning: Record for unrecognized entity is being skipped. Unable to read file. Malformed save file.
|
|
Library:
|
kernel
|
|
Filename:
|
kern/kernel/kernapi/api/kernapi.hxx
|
|
Effect:
|
Changes model
|