Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

EXECUTE STRUCTURE(3P)  —  Kubota Pacfic Computer Inc. (29 February 1991)

NAME

EXECUTE STRUCTURE − create a structure element to invoke another structure

SYNOPSIS

C Syntax

void
pexec_struct ( struct_id )
Pintstruct_id;structure identifier

Required PHIGS Operating States

(PHOP, ∗, STOP, ∗)

DESCRIPTION

Purpose

EXECUTE STRUCTURE puts a structure element containing the structure identifier into the currently open structure according to the current edit mode.  If no structure exists with the structure identifier, an empty structure is created with that identifier.  EXECUTE STRUCTURE elements are used to define hierarchical structure networks by invoking one structure from within another during structure traversal. 

If the current edit mode is INSERT, the EXECUTE STRUCTURE element is inserted into the open structure after the element pointed to by the current element pointer. If the edit mode is REPLACE, the EXECUTE STRUCTURE element replaces the element pointed to by the element pointer. In either case, the element pointer is updated to point to the new EXECUTE STRUCTURE element. 

C Input Parameter

struct_id
Identifies structure to be invoked from the currently open structure.

Execution

When an EXECUTE STRUCTURE element is traversed, the traversal performs the following in order:

1.Suspends the traversal of the current structure. 

2.Saves the current states of:

    all primitive attributes,
    local and global modelling transformations,
    the view index,
    HLHSR and PICK identifiers,
    the name set, and
    modelling clipping limits and clipping indicator.

3.Sets the global modelling transformation to the current composite modelling transformation.  Sets the local modelling transformation to an identity matrix. 

4.Traverses the structure specified by structure identifier. This process will be repeated for any EXECUTE STRUCTURE elements encountered in the structure with the structure identifier and its subordinate structures before returning to the current structure. 

5.Restores all the saved states. 

6.Resumes traversal of the current structure. 

If structure identifier itself contains an EXECUTE STRUCTURE element, traversal of the structure with the structure identifier is also suspended, and traversal continues with that structure invocation.  At the end of a structure (i.e., after its last element), traversal returns to the invoking structure, restoring the saved state, and continuing with later elements in the invoking structure, until its end.  This continues until the entire structure network is traversed (i.e., until traversal of the posted structure is completed). 

The application must avoid recursive structure networks: no EXECUTE STRUCTURE element may invoke any ancestor structure.  The PHIGS implementation is not required to check for this problem, and PEX-SI does not. 

Each subordinate structure inherits the current attribute values from its parent structure, except for the modelling transformations, as described in step 3 above.  Unless the attributes are explicitly changed with the appropriate SET element, they retain the last value set in a structure higher in the structure network hierarchy. On the other hand, when traversal of a structure is suspended, the current attribute values are saved and later restored when traversal of the structure resumes. This means that structures can only affect the display of structures subordinate to them in the network; no structure can affect any attributes of its parent. 

Implementations vary in the depth of structure execution supported, and in the efficiency of EXECUTE STRUCTURE traversal.  PEX-SI is limited only by available virtual memory, and EXECUTE STRUCTURE is quite efficient. 

ERRORS

005Ignoring function, function requires state (PHOP, ∗, STOP, ∗)

SEE ALSO

POST STRUCTURE (3P)
DELETE STRUCTURE NETWORK (3P)
CHANGE STRUCTURE REFERENCES (3P)
CHANGE STRUCTURE IDENTIFIER AND REFERENCES (3P)
INQUIRE PATHS TO ANCESTORS (3P)
INQUIRE PATHS TO DESCENDENTS (3P)

September 02, 1992

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026