gstructure <name> { <data-block> }
Define a graphic structure identifier.
<name>
The name of the structure.
None
Multiple command lines, each of the form:
{<qual>} <type> { <element>{[<num>]} { = <value> } }
where:
<qual>
If included, may be one or more of the qualifying words "static"
or "heritage".
<type>
The identifier type.
<element>
The element name, unique for the structure. This is optional, see Notes
below.
<num>
The array dimension if the element is an array (may be omitted from variable-length
arrays).
<value>
A class value for the element. When an object of this structure class is
created, its element <element> will
be assigned the value <value>. This
will remain its value until changed by an object member assignment. Only
non-array elements can have a class value and only when <type>
is one of the following:
blob, channel, epointer, filter, group, layer, menupane, numeric, panel, point, projection, string, time, treenode, window, procedure/function
Values for members of type filter must be single-line definitions.
Once defined, the gstructure <name> may be used as a command to create an object of that gstructure type.
When such an object is created, a graphic primitive may be assigned to the object, similar to that attributable to an entity identifier.
<element> and <num> may be omitted when <type> is another class of structure or gstructure. In such cases the members of <type> are copied into the new gstructure and given the same element names.
A structure with graphic members (e.g. entities or gstructures) is a special case of a gstructure and is known as a compound. The compound command is used for such structures.
The gstructure definition must have application scope and objects of its type are given global scope.
The qualifying word "static" defines an element to be a class value with the same value for all instances of <name>. Defining elements as static can result in considerable savings of object storage.
The qualifying word "heritage" defines an element to be available to child structures. For example, if an element named t of a structure is declared heritage, then object.child.child.t is equivalent to object.t.
The class command may also be used to define a gstructure, by inheriting from entity.
Define a gstructure (remember no graphic members).
gstructure ~maps.map_square_t { string title string map_ref point coords[2] }
Create an object of type ~maps.map_square and define its graphic contents...
~maps.map_square_t mapa = get $maps/mapa
... then define its non-graphic member values.
mapa.title = 'Geological Survey' mapa.map_ref = 'AU/Q0516A' mapa.coords = < (50000,20000),(51000,21000) >
Commands: |
class, compound, entity, epointer, filter, glist, list, structure |
Identifiers: |
unique_gstructure_name (string) |
Structures: |