Command: gstructure

Syntax

gstructure <name> {
    <data-block>
}

Description

Define a graphic structure identifier.

Parameters

Switches

None

Block

Multiple command lines, each of the form:

{<qual>} <type> { <element>{[<num>]} { = <value> } }

where:

Notes

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.

Examples

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) >

See Also

Commands:

class, compound, entity, epointer, filter, glist, list, structure

Identifiers:

unique_gstructure_name (string)

Structures:

gstructure