COGENT Online
CONTENTS
COGENT Help

Buffer/Analogue

Introduction

Analogue buffers are specialised COGENT buffers which contain and manipulate graphical representations. Their contents are interpreted as denoting graphical representations, and they can be displayed graphically, but they can also be manipulated using ordinary COGENT rules and conditions. In their present form, they can be used to form the basis of a variety of models of imagery processes, and reasoning processes based on imagery.

Analogue buffers can only contain objects of a specified range of types, presently points, intervals, lines, circles, boxes, polygons, polylines and markers. Each type has a specific syntax, as detailed below. Configurable buffer properties include Dimensionality (1-d or 2-d), Continuity (continuous or granular, subspecified by Granularity, or grain size) and Point movement, which implements a variety of imagistic decay, characterised by the tendency for point locations to drift randomly, within configurable limits. Additionally, extra Access properties permit retrieval ordering based on geometrical order, with possible values Right->Left, Left->Right, Top->Bottom and Bottom->Top.

The Image View

The image viewer displays the contents of the analogue buffer under a geometric interpretation. Thus each object in the buffer is interpreted as specifying a graphical object, such as a point, interval, line, polyline, polygon, circle, box, text object or x_mark, and displayed accordingly.

As well as displaying each object's graphical information, the viewer also constructs and displays a key, using the contents of each object's first parameter, Name, as text. Each distinct Name entry is colour-coded to correspond to its associated graphical representation. In the one-dimensional case, the graphic object is displayed beside its key entry, using the horizontal dimension of the screen to display the graphical information. In the two-dimensional case, both dimensions of the screen are used to express the graphical information, and associations between graphical displays and key entries are expressed by the colour coding alone.

Colour-coding may be over-ridden by specifying a known colour for an object, and it is possible to deselect this colour coding and display the graphic in monochrome, using the Colour checkbox on the Viewer window. If Colour is deselected, the Key is not displayed.

The viewer window permits the user to rescale the display independently on both X and Y axes, and by default locks the scaling on the two dimensions, to preserve the diagram's aspect ratio. This locking can be deselected by the user if required.

Graphical Objects

Graphical objects are represented within OOS as prolog structures, and only a limited range of these are permitted to be added to an analogue buffer. In general, each permitted graphical object type has a principal functor (such as point, line or circle), and two arguments specifying first, its Name, and second, its geometrical specification. The Name argument can be instantiated as any prolog structure, but the geometrical specifications depend on the object type, as detailed below. A third, optional argument, specified as a list, permits specification of display options for the object, such as colour, line weight and style, and filled or line drawing.

In general, a 1-d point is represented as a single number which specifies its position on the dimension, whereas a 2-d point is represented as a pair of coordinates, using the comma operator and round brackets, specifying its position in two dimensions, like this: (X, Y). Since all values are evaluated before addition of the object to the buffer, they can be specified as evaluable functions: ((37 + 2) - 27, 16 mod 5) will be evaluated to (12, 1) before the object is added to the buffer. If the function is not evaluable, OOS will print a warning and the object will not be added, since the interpretation of the buffer as a diagrammatic representation implies that all locations should be fully specific, precluding objects with unspecified locations.

Some object types (point, line, text and x_mark) can be used in both 1-d and 2-d buffers; note, however, that their geometric specifications will differ in each case.

1-D Object Types

Object types supported in a 1-d analogue buffer must specify their coordinates as single numeric values, since they can only range along one dimension.

2-D Object Types

All 2-d object types use (X, Y) coordinate pairs to denote locations. In keeping with the computational tradition, the location (0, 0) denotes the top, left corner of the display, so the value of X increases from left to right, while the value of Y increases from top to bottom.

The text and box object types can be given an optional alignment specifier, which controls how the object is aligned with respect to its reference point. This is specified as (Xalign, Yalign) where Xalign can have one of the values l (left), c (centre) or r (right), and Yalign can have one of the values b (bottom), c (centre) or t (top). If omitted, the viewer assumes the default values (l, b).

Secondary properties of graphical objects

Any graphical object may be given a third, optional argument, consisting of a list of secondary property specifications. For example, to colour a circle red, and fill it, use:

There are no restrictions on the syntax of items in the secondary properties list, but only the following have any effect:

Secondary properties are not currently supported in PostScript output or in HTML output.

Analogue Buffer Properties

As a subclass of the standard, propositional buffer class, analogue buffers have all the standard configurable properties such as Decay, Capacity and Access order. These all operate as normal, on the graphical objects which may exist in an analogue buffer:

Additionally, analogue buffers have special properties pertaining to their interpretive domain:

The Buffer Element Editor

Recall that all information must be represented in COGENT via Prolog terms. Buffer elements are no exception, but they are perhaps the simplest sorts of box elements in COGENT. This is reflected in the simplicity of the buffer element editor. Apart from the comment line, it contains a single text field into which the buffer element should be typed. The contents of this field should be a valid Prolog term. If not, however, COGENT does automatic syntax checking (and attempted correction) of editor elements, and so any error will be noted and (possibly) corrected.


COGENT Online
CONTENTS
COGENT Help