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 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-based processes, and as a general graphical output facility.

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 Current Contents (image) Tab

The Current Contents (image) tab 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.

The tab permits the user to rescale the display independently on both X and Y axes. Checking the Lock X/Y check box fixes the aspect ratio of the display. If the user subsequently changes the scaling on one axis then the scaling on the other axis will be automatically changed so as to preserve the aspect ratio.

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.

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:

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