Advanced Metagraf – 4

Layers and the Stack.-

When drawing with Metagraf, every time a new object is created it is placed in a “stack” where all the objects “live”. The stack saves the “order” in which the objects have been created. This same order will be the one to redraw the objects in Metagraf but also the order in which the drawing is translated to Metapost.

There are situations in which the order used for making a drawing is not the right one for the finished drawing. This situation is usually related with some closed objects filled with color, that will made invisible other objects or part of other objects placed under them.

In the next figure three “filled” circles are shown:

It is clear the the object at the bottom of the stack is the red circle. Then comes the green one and finally, the last one created has been the blue one. This is very intuitive as is the same as would be to place the objects in a surface one after the others.

Mg5 as a couple of utilities to change the order of objects in the stack. In the bottom of Metagraf screen, at left, a button and a text field are the tools to cup with this item. In netx image, they are sown:

The button at left shows a couple of arrows in opposite direction and the text field shows a legend of the type: “some number” of “some number” . The meaning of this legend is as follows: the first number correspond to the object that has been selected. The second number correspond to the total number of objects on the stack.

If two objects should have their places on the stack interchanged, for example if it is wanted to show the complete red circle and to have the blue one as the least visible, one way to proceed is to select both objects and then click the button at left.

The order of the objects will change to: blue circle at the bottom of the stack; then will come the green one (not modified) and finally the red one at the top. The corresponding image will be:

Another function of the button provided to change layers, is to change the layer of just one object. Selecting the object, in the corresponding window it will be shown what place occupies the object in relation with the totality of the stack. Then, clicking the button (same effect pressing the key “S” on the keyboard), will make the selected object go one steep up on the stack. This can be done repeatedly. When the object is at the top of the stack, pressing once more the button will send it to the bottom in a kind of circular motion.

For changing places of objects in the stack, if there are many objects in the drawing and looking for economy of actions, it is recommended to group the ones not affecting the changes. When some objects are grouped, they disappear from the stack and a new group object is placed at the top. From this, one possibility to place an “old” object at the top of the stack is just selecting it; grouping it (yes, it is possible to group only one object) an immediately, ungrouping it.

It is a matter of practicing a little bit and manipulate all those capabilities to find the better way for each one to proceed.





Previous page

Next page

Madrid, January 2006