previous contents next
Previous: The Network Plane Next: Parameters and Configurable Objects

The Stylus

Generating even the most elaborate plot can finally be reduced to the following three simple basic tasks: drawing of lines, filling of regions and writing of texts. Let's now look at each of these tasks and see what display properties are associated with each of them:

General purpose graphic programs would normally require the specification of these display properties separately and independently for each single graphic element. However, when displaying transportation networks there are too many network elements, rendering it neither practical nor efficient to have to deal with each of them individually. Thus, it is crucial to conceptualize the graphic display properties in a way which allows a unified specification for large sets of network elements, but yet is flexible enough to customize plots to cover all (or at least most) needs.

In this spirit, all graphic drawing and writing in Enif is done by a versatile ``all-in-one'' type tool we shall call a stylus.

A simple stylus consists of the specification of one set of the following display properties:

Pen color as a full 24-bit RGB color specification;
Pen pattern as one of the following: solid line, dashed, dotted, dash-dot, dash-dot-dot, no pen;
Pen width as a value between 0 and 16 (0 denoting the smallest possible pen width of the output device);
Fill color as a full 24-bit RGB color specification;
Fill style as one of the following: solid fill, 94% fill, 88% fill, 63% fill, 50% fill, 37% fill, 12% fill, 6% fill, horizontal lines, vertical lines, cross hatch, diagonal up, diagonal down, diagonal cross, no filling;
Text color as a full 24-bit RGB color specification;
Text attribute as one of the following: normal, bold, italic, underline;
Text size factor as one of the following: 50%, 64%, 80%, 100% (normal size), 120%, 150%, 200%, no text;
Text font family as one of the following: default, sans serif, serif, typewriter, decorative, user 1, user 2, user 3 (the corresponding font family names which are actually used can be defined in the user preferences);

Figure 4 illustrates the above choices for the non-color properties of a simple stylus. If a stylus is used in a particular way which does not make use of some of the properties (such as e.g. for a background which has neither an outline nor any text associated), they are left unspecified. On the other hand it is always possible to configure a stylus to selectively suppress outline, filling or text contents, by selecting the properties no pen, no filling and/or no text.

Figure 4: Non-color properties of a simple stylus: a) pen pattern, b) pen width, c) fill pattern, d) text attribute, e) text size factor, f) text font family
\includegraphics[width=\textwidth, keepaspectratio]{}

Note that the above display properties do not determine the character size of the text, they merely provide a relative text size factor. The actual text size is obtained by multiplying a text size parameter (provided by the mapper as a separate parameter) by this factor. This allows changing the overall size of the texts very easily via one single parameter, while maintaining the relative sizes specified in the used styli.

An indexed stylus consists of the specification of several sets of these display properties. An sequential index is associated with each set, starting with index 0. When used with a particular index value, it provides for a convenient way to specify a systematic variation of the display properties and, thus, can be looked at as a generalization of the color index used in EMME/2.

Index values outside the range of defined value sets are always referred to either the first or the last set.

As the index values are not limited to integer values, but may assume any floating point value, interpolation properties for pen, fill and text operations are associated with each specified stylus property set. Each interpolation property can be set to one of the following: round to next lower, round to next higher, round to nearest and linear interpolation. This information is used to determine which set of properties to use for fractional index values.

Linear interpolation implies that an interpolated color is used made up from the interpolated red, green and blue components of the colors specified in the next lower and next higher property sets. In case of a pen interpolation, the pen width is also interpolated in the same way. For all other (non-interpolatable) properties, the setting ``linear interpolation'' behaves the same as ``round to nearest''.

Indexed styli provide a very powerful tool to translate numerical values into discrete or continuous color sequences. As we shall see later, when looking at network plots, the index values are often provided by evaluating the so called stylus index expression.

The example in Figure 5 illustrates how to use an indexed stylus for generating gray-scale displays. In this example, an index value of zero corresponds to a black filling, a value of 1 to a white filling, values in between to the corresponding level of gray. In order to visually differentiate text and outline from the filling, they are colored white for fillings in black or dark gray, and black for fillings in light gray or white. The stylus used to produce Figure 5 uses only two indices, 0 and 1, which have the following properties:

Property: Set 0: Set 1:
Pen color: white black
Pen interpolation nearest *
Fill color: black white
Fill interpolation: linear *
Text color: white black
Text interpolation: nearest *

 (*: not important, as the interpolation property of the last set is never used)

Figure 5: Gray-scale interpolation with an indexed stylus
\includegraphics[width=\textwidth, keepaspectratio]{}

A stylus can always be modified interactively by pushing the corresponding stylus button. This opens a popup menu which, depending on the context, provides options for all allowed modifications, such as changing of the properties, adding or removing indices, reversing the indices or copying/exchanging colors. Once a complex stylus is configured, it is also possible to associate a name with it and store it as a predefined stylus so that it can be recalled later on, whenever the same stylus configuration is needed again. The set of predefined styli becomes part of the user preferences.

previous contents next
Previous: The Network Plane Next: Parameters and Configurable Objects

Enif - Toward a New Interface for EMME/2, Heinz Spiess, October 2000