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.

Close-up view

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 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:

Data model with support of layers

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:

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: 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

  1. 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.
  2. 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.
  3. 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. 
  4. 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).
  5. The following functions can set the displaying of layer and zoom script:
  6. 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.

Object properties palette - 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:
  1. Blue circle - is displayed on active layer. It is 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 the point 4 is not applied, but the object contains the internal flag, which tells that the changes should by copied to all layers (e.g. when creating a new object).
  4. Blue arrows - they are displayed when the settings according to the point 4 is 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 change, which 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 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, caused that the new object will 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 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.

Default picture settings
Selection of a background bitmap
GrEditor keyboard shortcuts