The layers in the picture enable the control of the object visibility which depends on the Picture zoom size. The object visibility is defined in layers. The layer visibility is defined from zoom.

Close-up view

The data model of graphic objects (GO) which did not support the layers was as follows:

Data model without support of layers

Objects are drawn in order and according to their visibility. In the multilayer implementation of the pictures, their definitions contain also the layers.

The data model of graphic objects for picture drawing:

Data model with support of layers

Layer visibility is evaluated during drawing. If a 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.

The data model of graphic objects which did not support the layers:

Data model without support of layers

Multilayer data model of graphic objects for the picture drawing:

Multilayer data model

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, the Text "Zilina" displayed in layer No. 1 can be replaced by the text "Zilina - No. of the train sets 10" in layer No. 5.

Font, colour, placement, etc. can be also changed.


Displaying in HI

  1. During the drawing of the Picture, the layer visibility is evaluated according to zoom. A visibility layer will be drawn. Objects will be drawn in the layer only if they are defined as visible in this layer. The script is informed about the change of layer by entry OnNewLayer.
  2. Picture zoom is done through Windows facilities but there are some objects that can not be zoomed in/out. Their size and placement are set by the script. The script is informed about the change of zoom by entry OnPictZoom.
  3. Choosing the zoom mode, the aspect ratio is kept at the rate of 1:1. The ratio in the display is affected by picture size. It means that if the display ratio is changed - e.g. only one side is expanded - this change is kept also in zoom. 
  4. Changes in object attributes from the script relate only to some layers. This can be set with the function %HI_LayersParams (function sets the attributes for the active layer, all layers or for a range of layers).
  5. The following functions can set the displaying of layer and zoom script:
  6. The 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 to the pictures with layers. The 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 the graphic editor.

Object properties palette - layers


1The number of active layers is displayed in the title bar.
2The checkboxes (1..10) indicate in which layers the object is drawn. If the picture does not have any layers, the checkboxes are disabled.
3Copying parameters between the layers. Click the button "P" to show more options.
4The checkboxes, situated below the P symbol (layer parameters), allow the application changes of parameters automatically for both previous and following layers in the object.
5The 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.
6Next to layers, there is the information into which layers the change of parameters will be copied. Meaning of symbols:
  1. Blue circle - is displayed on the active layer. It is a working layer where the object parameters can be changed.
  2. Red arrows – they relate with point 4. They display the selection at the layers - all parameters will be copied from the working layer into the layers with these arrows.
  3. Pink arrows - they are displayed when the settings according to point 4 are not applied, but the object contains the internal flag, which tells that the changes should be copied to all layers (e.g. when creating a new object).
  4. Blue arrows - they are displayed when the settings according to point 4 are not applied, but the object contains the internal flag, which tells that only the position changes should be copied to all layers. However, a new position is not transmitted into layers, but the size of a change is added to the position on the layer.
  5. Grey symbol - displayed when no object is selected.


Picture drawing


Selecting objects

Conditions that are applied for the selection of objects in the pictures with layers:

  1. 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.
  2. Creating a new object by drawing or copying causes the new object to be selected in all layers.
  3. The object(s) are selected only in one layer (selection in other layers is not changed).


Copying objects


Copying objects between the pictures with different number of layers


Copying parameters between the layers

To show the options for copying the parameters between the layers, click the button "P".

Copying the parameters between the layers

The checkboxes 1-10 represent 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.

Default picture settings
Selection of a background bitmap
GrEditor keyboard shortcuts