Naming
A number of different naming conventions are required to meet system and application programmer needs.
The Display Pointer
Nodes and branches in the system are named by assigning an integer or array location as an argument in the call used to create them. The system places in these variables a number which points to the physical location of the branch or node position in the picture-subpicture data structure. We call this name the DISPLAY POINTER. As long as the user does not change the contents of these variables he can refer to particular nodes or branches in various subroutines by use of these integer variables as arguments. In other words, to the user, the name of a picture or subpicture can be thought of as the variable used at the time of its creation. Such a naming scheme is clearly required if pictures or subpictures are to be manipulated by the programmer.
The Light Button Code
Additional identification is useful to the application programmer in order to simplify his programming task. A user has no control over the number assigned by the system to a Display Pointer. There are situations in which the user would like to associate a particular known number with a branch. One common example is in the use of "light buttons". A light button is a displayed object that the user wants to be able to point at in order to command the controlling application program to do something. A light button is commonly a string of characters forming an English word or words, but could be any picture. When the user picks or hits the light button, information identifying the object must be transmitted to the timesharing application program. The program must then branch to an appropriate statement or subroutine to perform the operations required to execute the command. The Display Pointer uniquely identifies the object hit, but because its value is not under the programmers control, writing the code necessary to test it against the various Display Pointers considered legitimate to be hit at this point in the program is tedious. If, however, the application programmer knew that at this point only objects with identification numbers 20-28 were legitimate to be hit, then testing to see that one was in this range and branching by use of a computed GOTO simplifies the programming of flow of control. Often one does not need unique identification of an object, but wants to perform a certain action if any object in a class of objects is hit.
The above need for identification is satisfied by allowing the application programmer the ability to assign a number, not necessarily unique, to a branch. This number is called the Light Button Code. This code can be used in any way the programmer desires, but is most commonly used, as its name implies, as a code identifying light buttons. This number is sent to the application program along with the Display pointer of the object hit on the screen with a graphical input device.
The Back Pointer
We indicated earlier that it is required in interactive graphic programming to be able to associate application oriented data with picture and subpicture objects on the screen. The data may be stored in many kinds of data structures depending on the nature of the application, examples being arrays, lists, trees, etc. We meet the need by associating with each branch one word which could contain a pointer to the appropriate spot in the application data structure containing the data associated with the branch. We call this word the Back Pointer. The application programmer can in fact store any code he desires in this word and use it in any way desired, but its common use as a pointer back into a data base in the application program dictated its name.
For example, consider an application which would allow a chemical engineer to draw a chemical flow sheet on the screen and then input this flow sheet into a process calculation system. There will be various symbol-pictures on the screen representing basic process units such as heat exchangers, mixers, columns, and so forth that can be copied and positioned on the screen. These units will have to be connected together by streams. The units and the streams will have names and data associated with them describing their contents and properties. Further, the node-branch structure. while visually indicating to the user what units are connected together and how, does not necessarily have the connecting information in a form easily handled by the application program.
The continuity is best represented by a data structure using simple list processing in which each unit and stream has a block of cells associated with it containing data for it and pointers containing the connectivity information. When a branch is created to position and display a unit, it will contain in the Back Pointer a pointer to the block of data associated with it. The block of data will probably contain the Display Pointer for the associated branch so that one can go from the picture to the data block or from the data block to the picture. For example, one may point at a unit for the purpose of deleting it. Given the Back Pointer of the unit hit, one can find its associated block and return that block to free space. One can then follow the appropriate chain of pointers to the blocks for the streams connected to the unit. In these blocks one has the Display Pointers for the branches displaying the stream and can then delete it from the node-branch structure, thus making it disappear from the screen.
An additional form of name is to allow the programmer to store an alphanumeric string with each branch or node. This form of name is not required for most applications, but can be useful with the picture editor.
To review, each node and branch has associated with it a unique identifier named by the user and called the Display Pointer; its value is assigned by the system. Each branch has two additional pieces of information which can be assigned to it by the programmer, called the Light Button Code and Back Pointer.
Given a Display Pointer for a branch, the programmer can obtain the Light Button Code or the Back Pointer for the branch. Given a Light Button Code or the Back Pointer, the programmer can obtain a Display Pointer for a branch with such a code. This display pointer may not be unique if several branches have the same Light Button Code or Back Pointer. The above naming and identification inventions have proven to be easy to understand and yet completely general and easy to use.