## QisMLayerSynth Extension

Users often need to do some sort of operation on what we call "derived" layers. This is data that does not exist in the source layout file but which is created (or derived) from one or more Boolean operations performed on the source layers.

QisMLayerSynth is an extension API that allows a client application to synthesize (create) new layers of boundary data by evaluating an expression of boolean operations between one or more layers in a given window of the view cell.

The API is classic (C++ 98) object-oriented C++ designed to be simple, cross platform, extensible and always backwards compatible (source and binary) with a simple and consistent error handling scheme (error codes and error strings)

The layer operation argument can be expressed in two forms: Serial and Postfix. Both support control of layer and datatype.

**Serial Notation**
Example
"100:0=2+5;200:0=100:0-5;300:0=200^5;400:0=300&5"
Assign (=) UNION (+) of 2:* and 5:* to 100:0 (L:* means all datatypes for layer L)
Transmit 100:0 to client application
Assign DIFFERENCE (-) of 100:0 and 5:* to 200:0
Transmit 200:0
Assign XOR (^) of 200:* and 5:* to 300:0
Transmit 300:0
Assign INTERSECTION (&) of 300:* and 5:* to 400:0
Transmit 400:0
100:0 = 1 + 2 - 3 & 4 will be interpreted as 100:0 = ((1 + 2) - 3) & 4

Serial notation does __not__ support parentheses. To control the order in which operations are performed, use the postfix notation.

**Postfix notation**
**Example**
"@1 2 ^ 100:0 = 0:0 ~ 3 4 | 200:0 = 0:1 * 100:0 200:0 & 0:3 ~"
@ indicates postfix notation
Assign (=) XOR (^) of 1:* and 2:* to 100:0
Transmit (~) 100:0 as 0:0
Merge (|) 3:* and 4:* and assign to 200:0
Transmit UNION (*) of 200:0 as 0:1
Compute INTERSECTION (&) of 100:0 and 200:0 and transmit the result as 0:3

Postfix notation is recommended over serial notation because of efficiency and flexibility

### Block Diagram Example

Consider the case where we want to first unionize data on layer 1 and layer 2 (all datatypes); then take the results and subtract (difference) data from layer:datatype 3:0; the final results go on layer:datatype 0:0

**Serial Notation**

0:0 = 1 + 2 -3:0

**Postfix Notation**

@ 1 2 + 3:0 - 0:0~

The block diagram below shows the flow of data and which functions are used.

Page 2