OOF2: The Manual

4.8. The Layer Editor

The Layer Editor Window, shown in Figure 4.18 is used to create new Layers and to edit existing ones. There is only one Layer Editor, shared by all Graphics Windows. The Layer Editor builds LayerSets by specifying an object to be displayed and a set of DisplayMethods, one for each Layer in the LayerSet. When the LayerSet is complete, it is sent to one or more Graphics Windows. If a Layer is selected in the recipient Graphics Window's Layer List, that Layer's LayerSet will be replaced by the new LayerSet. If no Layer is selected in the Graphics Window, the Layers in the new LayerSet will be added to the display.

The components of the Layer Editor are:

  • A menu bar, containing the usual File and Windows menus, as well as a menu of Settings for the Layer Editor.

  • A Displayed Object pane, on the left below the menu bar. The pull-down menus in the pane indicate which object is to be displayed by the LayerSet being edited.

  • A Display Methods pane, to the right of the Displayed Object pane. The pane lists all of the DisplayMethods in the LayerSet currently being edited. Buttons at the bottom of the pane operate on the DisplayMethod selected in the list.

  • A New Layer button, which clears the Displayed Object and Display Methods panes, and deselects all Layers in all Graphics Windows (so that when the new LayerSet is sent to the windows, it won't overwrite existing Layers).

  • A Destination pull-down menu, which determines which Graphics Windows will receive the LayerSet being edited.

  • A Send button, which sends the LayerSet to the windows specified by the Destination menu. (If AutoSend is set in the Settings menu in the menu bar, it's not necessary to use the Send button, except when the Displayed Object is changed.)

Figure 4.18. The Layer Editor

The Layer Editor

Opening the Layer Editor

The Layer Editor can be opened in four ways, which differ in how they initialize the Editor and what they do with the selection in the Layer List:

  1. By the Layer Editor command in the Windows menu in any OOF2 window's menu bar. The contents of the Layer Editor are not affected by this.

  2. By the New command in the Layer menu in a Graphics Window's menu bar. The Displayed Object and Display Methods panes are cleared, the selected Layers are deselected in all Graphics Windows, and the Layer Editor's Destination is set to the originating Graphics Window.

  3. By selecting a Layer in the Layer List in a Graphics Window, and choosing the Edit command from the Layer menu in the window's menu bar. The Displayed Object pane is set to the object of the selected Layer, the Display Methods pane lists all of the DisplayMethods of the Layer's LayerSet, the selected Layer is highlighted in the Display Methods pane, and the Destination menu is set to the originating Graphics Window.

  4. By double clicking on a Layer in the Layer List. This is equivalent to method 3.

The Displayed Object Pane

The Displayed Object Pane contains a pull-down menu labelled category and a set of one or more pull-down menus labelled object. These determine which object will be displayed by the Layers of the LayerSet that is being edited. The category can be set to Image, Microstructure, Skeleton, etc. The object selector lists all of the existing objects in the chosen category. For example, Microstructures are selected by a single menu, but Skeletons require two: one for the Skeleton and one for its Microstructure. Changing any of the pull-down menus invokes the OOF.LayerEditor.LayerSet.DisplayedObject command.

An additional entry appears in the first object pull-down menu in each category. Selecting this entry, which is either <topmost> or something similar (depending on the category), means that the LayerSet will examine the other Layers that display an object of the chosen category, and apply its DisplayMethods to the object in the topmost such Layer. This is most often used in the predefined unlisted layers. For example, there is a predefined LayerSet that displays the pixel selection of the topmost Microstructure.

The Nothing entry in the category menu and the Nobody entry in the object menu are just placeholders indicating that no selection has been made. They can't be used in a LayerSet.

The Display Methods Pane

The Display Methods Pane contains a list of the DisplayMethods in the LayerSet and some buttons for manipulating them. Clicking on entry in the list selects it. Double-clicking an entry is equivalent to selecting it and clicking the Edit button.

The buttons at the bottom of the list have the following functions:

  • The New button brings up a dialog box for creating a new Layer in the LayerSet, as shown in Figure 4.19. The dialog box sets just one parameter, which is the method argument for the OOF.LayerEditor.LayerSet.Add_Method command, but that parameter may be set to an object which has its own parameters. In the figure, method is set to Element Edges, which has its own color and width parameters. The pull-down menu for the method lists only those DisplayMethods that are applicable to the category set in the Displayed Object pane.

    Figure 4.19. Creating a New Layer

    Creating a New Layer

    The pull-down methods, sliders, and text entry boxes define a new DisplayMethod. The OK button adds the method to the LayerSet. The Cancel button doesn't.

  • The Edit button brings up a dialog box just like the New button's box , but it initializes it with the currently selected DisplayMethod. When the OK button is pressed, the new method will replace the currently selected method.

  • The Copy button copies the currently selected DisplayMethod.

  • The Delete button deletes the currently selected DisplayMethod from the LayerSet. The Layer is marked <deleted> in the list. (Because the Layer Editor works on a copy of an entire LayerSet, it's important for it to keep track of exactly which Layers were deleted, so that the correct Layers are deleted when the LayerSet is sent to a Graphics Window.) Deleted Layers cannot be edited.

Because each DisplayMethod only applies to one or two categories of displayable object, changing the category in the Displayed Object pane may invalidate the entries in the Display Methods pane. They will be marked as (invalid). The invalid entries may be edited to make them valid again, or they may be deleted. LayerSets with invalid but not deleted DisplayMethods cannot be sent to a Graphics Window.