Index


RISC World

ArtWorks Made Easy

RISCWorld

6: Order, Layers and the Clipboard

ArtWorks, as mentioned in the Introduction, is an object-based drawing package. This chapter is concerned with three important inter-related features of ArtWorks which are consequences of its object-based philosophy. To understand these we must first look at what is meant by 'object-based' and this takes us back to the fundamental principles of computer graphics.

Objects

There are several distinct types of computer graphics, but the two most commonly encountered are pixel or bitmap graphics, often called 'painting' applications, Acorn Paint being an example, and vector graphic, line-based drawing applications such as Draw and ArtWorks. The principle difference between these two types of application lies in the form in which the graphic image is stored.

Pixel graphics, as the name suggests, consist essentially of arrays of pixels, the tiny rectangles of colour that make up the screen display. Although pixel-based applications may contain sophisticated tools which allow many special effects to be created easily, at the end of the session when the graphic image is saved to disc, what is saved is essentially a list of the colours that appeared on the screen, pixel by pixel, there is no record of how the pixels came to have those colours.

A vector drawing program also changes the colours of pixels on the screen but it does so indirectly. As you create your lines and shapes on the screen, the program stores blocks of data in memory. Each new line or shape added to the drawing constitutes an object and its definition is added to this data. Each object is initially independent and can be edited or moved or deleted without affecting the other objects in the drawing. When you save your graphic to disc, what you are saving is not the pixels that make up the screen display but the actual data itself. When you subsequently reload the file. the application works its way through the data to reproduce the image. Indeed, the application redraws its way through the data whenever necessary, e.g. after clearing some other window that had temporarily obscured the screen.

This object-based philosophy is remarkably versatile. I referred to the definitions of lines and shapes being stored as objects, but other kinds of object can be stored as well. Most object-based drawing packages, including ArtWorks, also allow lines of text and sprites (i.e. pixel graphics) to be incorporated as objects in the data.

This same object-based philosophy forms the basis of serious DTP packages such as Impression and Ovation, their text frames and graphics frames being the 'objects' stored.

This form of data structure offers many advantages over pixel based alternative. For example, it is entirely independent of screen mode or output device; memory requirement depends only on the complexity of the objects stored and not on the area of the document or the output resolution, and it makes editing comparatively easy because edits on one object do not in general affect other objects.

It also confers some interesting properties on the documents represented. They are in fact more than two-dimensional (although less than three-dimensional). Consider what happens when two objects in a drawing overlap. As the application works its way through the data redrawing the objects one by one, first one object is drawn and soon afterwards the other one is drawn, partially obscuring the earlier one (see below). To the human eye the later object therefore appears to stand in front of the earlier one. Indeed one object can be totally concealed behind a later one, but it is not lost because its definition remains in the data and it will reappear if the object that conceals it is subsequently moved or deleted. This is in contrast with pixel graphics where new detail overwrites whatever was previously present, which is lost irrevocably.

Creating an object-based document is therefore rather like a child sticking items into a scrapbook, allowing later ones to obscure earlier ones. The objects in the data have an order from back to front and that order, initially, follows the sequence in which they were created.

Order

We have already seen that the objects in a drawing can be edited. In ArtWorks you use the select tool to select the object you wish to edit. You then select a tool appropriate to the object concerned and, if it is a line or a shape, click on the point you wish to edit which is highlighted by a colour change. Within the unseen workings of the computer Artworks has located that object's definition and identified the part of it that relates to the point concerned. However, it is not just the contents of objects that can be edited, their order within the data can also be changed so an object that was concealed behind another object can be placed in front of it if you wish.

In ArtWorks order is controlled by four icons in the centre of the info bar. These are shown below. There are also four equivalent menu options and keypresses in the Objects menu. To change the order of an object you must first select it using the Select Tool.

Click SELECT on the Front tool to move the selected object to the top of the stack, that is, to the front of the drawing. This is equivalent to using the Bring to Front menu option. If the object is already at the front of the drawing, clearly there will be no change. If the object is not at the front of the drawing but is not obscured behind any other objects, there will be no visible difference on the screen, but nevertheless the order of the objects in the data will be changed. The illustration below shows the effect of the Front tool applied to the 'A' in the previous figure.

Click SELECT on the Back tool to move the selected object to the bottom of the stack, that is, to the back of the drawing. This is equivalent to using the Put to Back menu option. If the object is already at the back of the drawing clearly there will be no change. If the object is not at the front of the drawing but does not overlap any other objects, there will again be no visible difference on the screen, but nevertheless the order of the objects in the data will be changed.

If you click SELECT on the Forward tool or choose the Move forward menu option, the selected object will be moved a number of places forward, assuming of course that it was not already at the front of the drawing. The number of places moved depends on the circumstances, it is the minimum number of steps needed to make a visible difference to the drawing. If the selected object is obscured by the next object above it on the stack clearly a move of one place will suffice. If it is only obscured by the object four places above it, it will be moved the four places necessary to change the appearance of the drawing. This is an 'intelligent' operation. If it is not obscured by any other object so that no matter how many places it is moved there will be no difference to the drawing, then it will be moved one place forward.

If you click SELECT on the Backward tool or choose the Move backward menu option, the selected object will be moved a number of places backward, assuming of course that it was not already at the back of the drawing. As with the Forward option, the number of places moved depends on the relative positions of the objects in the drawing. It is either one place or as many places as are needed to make a visible difference to the drawing,

Note that in ArtWorks the movement of objects within the stack is also affected by the layers, which we shall consider next. If your drawing uses more than one layer, you will find that you will only be able to move objects within their layer. Whole layers, however, can be moved in front of or behind each other, together with all the objects they contain.

Layers

Layers in ArtWorks work a little differently from layers in some other RISC OS packages such as DrawPlus and Vector. In those packages layers are simply a form of grouping which allows certain related objects to be made invisible and/or unselectable. It bears no relation whatever to the position of objects within the data and for this reason the term layer in those packages is perhaps somewhat misleading. In ArtWorks layers are zones within the data. They cannot overlap, so you cannot move an object at the front of one layer forward into the layer in front using the order controls previously described. To do this you must either transfer the object into the new layer and then position it with the order controls or you might achieve the required effect by moving one layer in front of the other. We shall see shortly how to do either of these.

If you are creating only a simple drawing you will probably choose to ignore the layers facility. All the objects you create will automatically be in the default layer named Foreground.

As in other packages, the value of layers is that they allow you to make the objects they contain invisible or visible and selectable or unselectable. There are two principal uses for this kind of facility.

You can use layers as an integral part of your finished drawing to turn certain features on and off. For example, if you are interested in transport, you might create a map of Great Britain showing the motorways, other trunk roads, railways, canals and principal air services. You may also add towns, cities and county boundaries. Now if all these features were visible at the same time, the resulting map would almost certainly be so cluttered with detail that it would be impossible to follow. However, if the motorways were on one layer, the trunk roads on another and the railways on another, and so on, you could turn on just those layers in which you were interested. If you wanted to compare the motorway network with the railway network, you could turn on just those two layers and see them clearly without the encumbrance of the trunk roads and canals and airways.

The other value of layers is as a tool during editing. It is all too easy to select an object inadvertently and then to move it, perhaps after it had been very carefully positioned. If, however, you assign finished objects to different layers and ensure that the multilayer facility (explained later) is turned off, you will not be able to select the finished objects and therefore you will not be able to edit them, unless, of course, you consciously make the respective layer the current layer first. Those objects are effectively locked in place.

A further use is if you have a very brightly coloured or a highly detailed object behind the one on which you are working which can make it hard to see what you are doing. However if you assign the offending objects to a layer other than the one on which you are working and then make that layer invisible it will not interfere with your view of your work. But do ensure that multilayer is turned off or you may select and edit an invisible object without realising it.

Whenever a new ArtWorks document is created, it already contains two layers, named Background and Foreground . There is always one layer selected as the current layer. All new objects created are assigned to the current layer. The current layer is named in the infobar display (shown below). By default. Foreground is the current layer. If you are creating a simple drawing which does not use the layers facility, all the objects you create will automatically be in the Foreground layer.

The Layer menu

All layer functions are controlled from a layer menu opened either by clicking SELECT on the menu icon to the right of the current layer display in the info bar or by clicking MENU with the pointer over the current layer display. This menu is shown below.

The layers menu includes a list of all layers in the drawing. The currently selected layer is highlighted by the yellow background behind its name. To choose another layer as the current layer, simply move the pointer over it and click SELECT . Its name will appear in the indicator in the info bar, showing it is selected. A dot beside each layer's name indicates whether or not that layer is visible. If the dot is solid, the layer is visible; if it is hollow it is invisible. Clicking SELECT on the dot toggles that layer between the visible and invisible states.

In the menu, the Background layer is below a dotted line. Any layer below this line is said to be in the background and, when the document is printed, objects in background layers are omitted. Items in background layers are shown at half their normal intensity. In other respects background layers are exactly like all other layers. If the layer called Background (or any other background layer) is moved above the dotted line it comes into the foreground and is printed in the normal way. Background layers are valuable for setting out guidelines, grids and comments that are useful when creating the drawing but not needed in finished printouts.

The Multilayer option controls which layers are selectable and therefore editable. If this option is ticked, all layers are selectable and so all objects are editable. If it is not ticked, only the current layer is selectable and objects on all other layers are protected against inadvertent editing. Click SELECT on the option to toggle between the two states.

Use the New layer option to create new layers in the drawing. This opens the dialogue box shown below. This allows you to allocate a name for the new layer (maximum 31 characters, spaces permitted) and to decide whether or not its contents will be visible. Click on Select to confirm the new layer and it will be created and made the current layer.

The Edit layer option allows you to change the name and other attributes of the current layer. It opens a dialogue box identical to that shown above except for its title and the availability of the Remove option. Remove destroys the layer and all objects that were in it. Caution ! No warning is given. However, if you inadvertently destroy a layer full of objects in this way the Undo option may reinstate it.

To change the order of the layers in the stack simply display the layers menu, move the pointer over the layer to be moved and drag it with ADJUST to the required position. The top of the menu corresponds to the front of the drawing. You may freely drag layers through the dotted line that divides the foreground from the background. You may even drag the layer named Background into the foreground and the layer named Foreground into the background if you wish. To move one or more objects from one layer to another select them in the normal way, cut them (using the Edit menu), make the destination layer the current layer and paste them (using the Edit menu again). Hold down Shift during the pasting operation or you will find that the pasted objects have moved and may need to be repositioned.

The Clipboard

The cut and paste operation just described uses the clipboard which is worthy of special attention. The clipboard is a reserved area of memory used in editing. In fact it is a specialised layer and its use has implications for the regular layers described above.

If you are familiar with Impression or Ovation or various other packages, you will probably know how a clipboard works. That in ArtWorks offers the same facilities, but also many more.

The familiar editing facilities that use the clipboard are Cut, Copy and Paste in the Edit menu.

To Cut or Copy you must first have one or more objects or groups selected in the normal way. Both cutting and copying place a duplicate of the selection on the clipboard. Cutting then removes the selection from the original document and copying leaves the original unchanged. When you cut or copy to the clipboard any previous clipboard contents are overwritten and lost without any warning being given.

The Paste operation will be not be available unless there is something already on the clipboard that you have previously cut or copied. Select the Paste option from the Edit menu. A copy of the clipboard contents will appear at the pointer position and can be moved to the required position. There is an alternative method of pasting, simply drag the clipboard icon into the document window.

Although pasting places the contents of the clipboard at the required location it does not empty the clipboard. The clipboard contents remain unchanged until you cut or copy something else and so you may paste the clipboard contents again, as many times as you like. This is a very quick way of building up large collections of identical objects.

You may have several ArtWorks documents open at once, provided that your computer has sufficient memory. The same clipboard, however, is common to all of them, so the clipboard provides a very simple and effective method of transferring material from one document to another. Simply cut or copy it from the source document and then paste it into the destination document(s).

While the clipboard contains something a tick appears in the clipboard icon on the info bar, as shown below. If you have forgotten what is on the clipboard there is a very simple way to find out. Either double-click SELECT on the clipboard icon or click MENU on the ArtWorks icon on the icon bar, move right on to the New View menu item and you will find an entry named Clipboard. Click on this and a window named Clipboard will open giving you a view of the clipboard contents.

Now the sophistication of the clipboard in ArtWorks resides in the fact that this window is not simply a passive view to remind you of what you have placed on the clipboard, it is an ArtWorks document in its own right. Click SELECT in the window and it will gain a toolbox and an info bar just like a normal ArtWorks document, so you can edit the contents of the clipboard. Click MENU in the window and you will open the normal ArtWorks main menu from which you can print or save the clipboard contents or export them to Draw or some other application. This is very useful indeed as it not only replaces but also improves upon the 'Save Selection' facility provided in Draw and other drawing packages. There are, however, two differences between the clipboard window and a regular ArtWorks document:

1. The clipboard window does not have the default layer structure; initially there is a single layer called Clipboard layer, but you may rename this and you may create new layers in the clipboard if you wish. 2. If you quit ArtWorks while there is unsaved matter in the clipboard, you will not be given the same warning and an opportunity to save its contents as when you quit a normal document.

RISCWorld

 Index