# SUBSYSTEM OVERVIEW

VDAFS ASCII File Formatter (VAFF) Subsystem

The VAFF subsystem is responsible for formatting the internal working form as an ASCII VDAFS data file.

# USAGE

The VAFF subsystem has one main interface routine, vaff_FormatFile. This routine takes a source model and the name of the VDAFS file to be created as its arguments. An option value allows the VDAFS file to be overwritten if it already exists. Normally the formatter is invoked by calling mda_FormatFile with any options to be passed to vaff_FormatFile (the routine vdaf_InitModelInfo configures the model so that vaff_FormatFile is invoked).

# AUTOMATIC ENTITY NAMING

Another option value will cause the formatter to automatically name each entity in the model as it is formatted. The existing entity names (if any) are discarded and new entity names are generated. The generated entity name consists of a two-character prefix based on the entity type, and a numeric index value. The prefix for each entity type is as follows:

    "PN" -   Point
    "PS" -   Point Sequence
    "MD" -   Point Vector Sequence (Master Dimension)
    "CI" -   Circle/Arc
    "CV" -   Curve
    "SR" -   Surface
    "CO" -   Curve on Surface (CONS)
    "FC" -   Bounded Surface (FACE)
    "TP" -   Topology of a Surface (TOP)
    "HD" -   Header
    "ST" -   Set
    "GR" -   Group
    "TM" -   Transformation Matrix
    "TL" -   Transformation List

The generated entity names are 8-characters wide in which the first two characters correspond to the specific entity type. The remaining six characters of the entity name are reserved for an index value (starting at zero) that is incremented for each entity of a particular type. For example, the first Point entity if the model would be named "PN000000" and the second "PN000001". Likewise, the first Curve in the model would be named "CV000000" and the second "CV000001". With this naming convention, one million unique names can be generated for each entity type (000000-999999). Even though it is very unlikely, if more than one million entities of any type exist in the model, a warning message will be outputted and subsequent entity names for that type will be duplicated.

# ENTITY ORDERING

Given a VDAFS model, the formatter must determine the order that the entities are to be formatted into the target file. In the VDAFS file, it is essential that an entity be declared before it is referenced by another entity. With this in mind, the formatter must write out each entity in the target file before it is referenced by another entity in the model. In order to accomplish this, some assumptions and limitations were placed on the formatter. Please refer to the vdaf_intro manual page for complete details on the limitations of the VDAFS file formatter.