The layers in picture enable to control the object visibility that depends on Picture zoom size. The object visibility is defined in layers. The layer visibility is defined from zoom.
Data model of graphic objects (GO) which did not support the layers was as follows:
Objects are drawn in the order and according to their visibility. In the multilayer implementation of the pictures their definitions contain also the layers.
Data model of graphic objects for picture drawing:
Layer visibility is evaluated during drawing. If layer is visible it will be drawn. Objects are drawn in the layer only if they are defined as visible in this layer.
The properties of this solution can be better understood by looking at the pictures mentioned above - they show only the principle of the new picture attribute - layers.
Data model of graphic objects which did not support the layers:
Multilayer data model of graphic objects for the picture drawing:
Objects in layers share RefId for connecting for display and control.
Mode Visibility in layer is added. This mode enables to set the parameters of object attributes and modifies them for individual layers.
For example: Text "Zilina" displayed in layer No. 1 can be replaced by the text "Zilina - No. of the train sets 10" in the layer No. 5.
Font, colour, placement, etc. can be also changed.
Displaying in HI
- During the drawing of Picture the layer visibility is evaluated according to zoom. Visibility layer will be drawn. Objects will be drawn in the layer only if they are defined as visible in this layer. Script is informed about the change of layer by entry OnNewLayer.
- Picture zoom is done through Windows facilities but there are some objects that can not be zoomed in/out. Their size and placement is set by script. The script is informed about the change of zoom by entry OnPictZoom.
- Choosing the zoom mode, the aspect ratio is kept in the rate 1:1. The ratio in display is affected by picture size. It means, if the display ratio is changed - e.g. only one side is expanded - this change is kept also in zoom.
- Changes of object attributes from the script relate only to some layers. This can be set with the function %HI_LayersParams (function sets the attributes for active layer, all layer or for a range of layers).
- The following functions can set the displaying of layer and zoom script:
- %HI_SetZoom - sets zoom and layer according to zoom,
- %HI_SetCurrLayer - sets the active layer and zoom according to layer,
- %HI_SetCurrLayerIgnoreZoom - special function which sets the layer which will be visible regardless of the size of zoom.
- Active layer can be detected by the function %HI_GetCurrLayer.
Controlling graphic objects from a script
When defining the parameters of graphic objects from a script, you may define the particular layers for which the parameters will be applied by %HI_LayersParams. It is applied for the pictures with layers. Default setting is applied for the active layer, but you may define it also for all layers or for the range of layers.
Creating Pictures with layers
Pictures with layers are created in graphic editor.
- In the window Picture settings, you may define the layer parameters (quantity and reduction ratio, which layers are visible, for example No. 5 means drawing ratio 1:5).
- The zoom resolution in Layer 1 (basic layer) is 1:1 (e.g. picture resolution 8000:6000 in which the picture has been created).
- There are two icons to work with layers in the toolbar of D2000 GrEditor:
- Set active layer - it sets a top layer and zoom according to it.
- Paint all layers - displays all objects that are drawn in all layers.
- You may choose the active layer with CTRL key + number of required layer when drawing the picture.
- Objects in picture dialog box, option All, provides the information whether the object is zoomed in/out (Z) and in which layers it has been used (1,2,3,...).
- Dialog box Object properties also supports the work with layers.
1 | Number of active layer is displayed in the title bar. |
2 | The checkboxes (1..10) indicate in which layers the object is drawn. If the picture has not any layers, the checkboxes are disabled. |
3 | Copying parameters between the layers. Click the button "P" to show more options. |
4 | The checkboxes, situated below P symbol (layer parameters), allow to apply the changes of parameters automatically for both previous and following layers in the object. |
5 | The symbol Magnifier indicates whether the object is zoomed during the zoom change. If the checkbox is not checked off, the object will not be zoomed. Its size and position will be set by a script. Script is informed about the change of zoom size by entry OnPictZoom. |
6 | Next to layers, there is the information into which layers the change of
parameters will be copied. Meaning of symbols:
|
Picture drawing
- New graphic object will be created in all layers. The changes of its parameters will be applied on all layers until any parameter in other layer is changed. Then object parameters will be changed in active layer and also in the layers which are checked off in dialog box Object properties.
- Concerning the replicated graphic object, the change of position will be applied in all layers by the same change until any parameter in another layer is changed. Then object parameters will be changed in active layer and also in the layers which are checked off in dialog box Object properties.
- Concerning the graphic object, created as copy of other object by mouse or hotkeys, the change of its position will be applied in all layers by the same change until any parameter in other layer is changed. Its position parameters will be changed in active layer and in layers marked by checkboxes in Object properties palette. Graphic object, created as copy of other object via clipboard by CTRL+C, CTRL+X and CTRL+V, will be placed in all layers top left. This object is moved only in the active layer.
- Objects can have different parameters in each layer. This parameters are changed in dialog box Object properties.
- The setting of parameters in dialog box Connect objects is the same for all layers.
- Changing the layer cancels the creating the object but creates the selection as when selecting the object by clicking on it.
- If an object of group is not visible in some layer, it is as it were "removed" from the group in the given layer. It means that it is still in the group but it is not included.
Selecting objects
Conditions that are applied for selection of objects in the pictures with layers:
- Each layer should contain the list of selected objects that will be used when changing the layer. If the layer, which is defined, has not the selected objects, then the objects from the active layer will be used.
- Creating a new object by drawing or copying, caused that the new object will be selected in all layers.
- The object(s) are selected only in one layer (selection in other layers is not changed).
Copying objects
- When copying the objects through the clipboard, the objects will be inserted to each layer in the top left visible area.
Copying objects between the pictures with different number of layers
- When copying objects from the picture with the layers into the picture without layers, only objects from the active layer will be copied (for example, if layer 3 is an active layer, the objects only from this layer will be copied).
- When copying objects to the picture with more layers then the original picture - data on the remaining layers up to maximum layer will be set according to the last layer of original picture.
- When copying objects to the picture with less layers then the original picture - only valid layers will be copied, the remaining layers up to maximum layer will be set according to the last layer of target picture.
Copying parameters between the layers
To show the options for copying the parameters between the layers, click the button "P".
The checkboxes 1 - 10 represents the layers to which data can be copied from
the active layer.
Position - the position parameters will be copied.
Parameters - all parameters except for the position will be copied.
0 komentárov