GAMGI Formats: Introduction Defaults

Introduction Defaults
The properties of the objects defined in GAMGI are governed by many different parameters, which must have default values, otherwise users would have to set all of them.

The default values applied when importing objects from GML files are the same as when creating them directly in GAMGI. In order to create files simple to handle, parameters which contain the default values are not exported To guarantee that a given configuration, after being exported and imported again, is still the same, the defaults must be identical when both operations take place.

The default values, the configuration data, can be modified by users, in two ways: directly in GAMGI, selecting the Config task for the required class of object, or importing a XML file with the new configuration data, also entered as XML elements: <atom/>, <bond/>, etc. GAMGI distinguishes object data and configuration data because configuration data is inside <gamgi></gamgi> blocks (the rationale is, configuration data is valid for the whole GAMGI).

When importing files containing <gamgi></gamgi> blocks, the new configuration parameters become immediately effective. Therefore, if a given parameter is changed several times during an import operation, different defaults will be applied on each section, which may be useful to avoid many parameter repetitions in files.

When exporting configuration data, GAMGI applies the same criterium used with object data, exporting only non-default data. To ensure that the objects defaults are identical when exporting and then importing object data, GAMGI always exports the non-default configuration data before exporting the requested object data. This way, the next time the file is imported, the non-default configuration data will be already in place when the object data is imported.

To reset configuration parameters to the values that were in place when the importing operation started (not necessarily the initial GAMGI defaults), these parameters should be entered with empty attributes, as in attribute="".

### Good:

    <gml>
      <gamgi>
        <atom element="H" mass="2.0"/> change default
      </gamgi>
      <atom element="H" /> atom mass is 2.0
      <gamgi>
        <atom element="H" mass="3.0"/> change default
      </gamgi>
      <atom element="H" /> atom mass is 3.0
      <gamgi>
        <atom element="H" mass=""/> reset default
      </gamgi>
      <atom element="H" /> atom mass is 1.00794,
      if the GAMGI default was not changed
    </gml>

Home