PK_PART_receive   


PK_ERROR_code_t             PK_PART_receive
(
--- received arguments ---
const char                 *key,         --- key string
const PK_PART_receive_o_t  *options,     --- receive options

--- returned arguments ---
int                  *const n_parts,     --- number of parts received
PK_PART_t           **const parts        --- parts received
)


This function receives one or more parts using the given key string.


Specific Errors:
    PK_ERROR_bad_key               Frustrum (FFOPRD) returned FR_bad_name
                                     (MILD)
    PK_ERROR_key_not_found         Frustrum (FFOPRD) returned FR_not_found
                                     (MILD)
    PK_ERROR_cant_open_file        Frustrum (FFOPRD) returned FR_open_fail
                                     (MILD)
    PK_ERROR_file_access_error     Error reading or closing the transmit file
                                     (MILD)
    PK_ERROR_schema_access_error   Error opening, closing, or reading the
                                      schema file (MILD)
    PK_ERROR_schema_corrupt        Contents of schema file not as expected
                                     (MILD)
    PK_ERROR_schema_incompatible   Schema contents in newer format (MILD)
    PK_ERROR_wrong_format          File does not have expected transmit
                                      format (MILD)
    PK_ERROR_wrong_version         File transmitted by incompatible version
                                      of modeller (MILD)
    PK_ERROR_corrupt_file          Invalid transmit file contents (MILD)
    PK_ERROR_file_read_corruption  Corrupt data read, perhaps an NFS problem
                                     (MILD)
    PK_ERROR_applio_not_registered Application i/o functions not registered
                                     (only relevant if options->transmit_format
                                      is PK_transmit_format_applio) (MILD)
    PK_ERROR_size_mismatch         Transmitted parts created with different
                                      modeller resolution settings (MILD)
    PK_ERROR_attr_defn_mismatch    Transmitted attribute definitions do not
                                      match current ones (MILD)
    PK_ERROR_usfd_mismatch         File has incompatible user-field size (MILD)
    PK_ERROR_withdrawn_surface     File contains a withdrawn blend surface
                                     (MILD)
    PK_ERROR_FG_receive_failure    Part contains irretrievable foreign
                                      geometry (MILD)
    PK_ERROR_bad_field_conversion  Part contains data not convertible to
                                      current format (MILD)


The key is passed to the frustrum to identify the 'file' used to receive the
parts.

The parts are returned in the same order that they were transmitted by
PK_PART_transmit.

The frustrum routine FFOPRD is called with guise FFCXMT (transmit file
containing parts).

The transmit format option affects the format argument to FFOPRD as follows:

    transmit format                format

    PK_transmit_format_text_c      FFTEXT
    PK_transmit_format_binary_c    FFBNRY
    PK_transmit_format_neutral_c   FFBNRY
    PK_transmit_format_applio_c    (registered function is called, not FFOPRD -
                                    see PK_SESSION_register_applio)

If the receive_user_fields option is set to true, user-fields will be
received from the transmit file, if they are present in the file. If the
user-field size in the transmit file is non-zero, but not the same as the
user-field size in the session, the error PK_ERROR_usfd_mismatch will be
returned.

If the receive_user_fields option is set to false, and user fields are in use
in the session, received entities will have their user fields set to zero.

When a part is created the modeller stores in the part the current values for
the linear and angular resolution of the modeller and these values will be
saved with the part in a transmit file. If the resolution values saved with the
part are different from the current values, PK_ERROR_size_mismatch will be
returned.

The definitions of any attributes attached to a part are stored with a part in
the file. When a part is received the modeller may discover a mismatch between
an existing attribute definition and a stored definition with the same
identifier. If this occurs PK_ERROR_attr_defn_mismatch will be returned.

If the transmit file was transmitted by a version of the modeller which is
newer than the current version, PK_ERROR_wrong_version will be returned.

If the parts contain foreign geometry for which an evaluator is not available,
the offending surfaces or curves are identified by having a system attribute
of type SDL/TYSA_BAD_FG attached. Parts containing such geometry must not be
used. This mechanism allows individual parts in a file to be used despite the
presence of other parts containing unusable foreign geometry. Applications
using foreign geometry must check for the presence of this attribute and
delete such parts.