Layer translator class for mapping layers. More...
| layerTranslator() | |
| void | clear() |
| void | invert() |
| void | mapAll(int to_layer) |
| void | mapLayer(int from_layer, int to_layer) |
| int | map(int from_layer) |
A layerTranslator is a mapping from every layer number to a destination layer. drawingField mapLayer and cell mapLayer take a pointer to this object and rewrite the shapes. After construction the mapping is identical: each layer maps to itself. mapLayer changes one pair, mapAll sends every layer to one destination, clear restores the identity map, and invert swaps the direction of the stored pairs. map looks up what a given source layer becomes. Build the translator first, then pass its address to the drawing or the cell; the translator itself does not walk the design.
Example:
layerTranslator t;
t.mapLayer(18, 19);
t.mapLayer(19, 18);
layout->drawing->mapLayer(&t);
int dest = t.map(18);
Creates a layerTranslator with an identical mapping for every layer.
Resets the mapping to an identical mapping for every layer.
Inverts the stored mapping. If the translator maps layer 1 to layer 2, the inverted translator maps layer 2 to layer 1.
Maps every source layer to to_layer.
Maps from_layer to to_layer.
Returns: the destination layer for from_layer.