
/*
Copyright (c) 2009-2010, Bruno Golosio, Antonio Brunetti, Manuel Sanchez del Rio, Tom Schoonjans and Teemu Ikonen
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
    * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
    * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
    * The names of the contributors may not be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY Bruno Golosio, Antonio Brunetti, Manuel Sanchez del Rio, Tom Schoonjans and Teemu Ikonen ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL Bruno Golosio, Antonio Brunetti, Manuel Sanchez del Rio, Tom Schoonjans and Teemu Ikonen BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#define KL1_LINE -1
#define KL2_LINE -2
#define KL3_LINE -3
#define KM1_LINE -4
#define KM2_LINE -5
#define KM3_LINE -6
#define KM4_LINE -7
#define KM5_LINE -8
#define KN1_LINE -9
#define KN2_LINE -10
#define KN3_LINE -11
#define KN4_LINE -12
#define KN45_LINE -13
#define KN5_LINE -14
#define KN6_LINE -15
#define KN7_LINE -16
#define KO1_LINE -17
#define KO2_LINE -18
#define KO23_LINE -19
#define KO3_LINE -20
#define KO4_LINE -21
#define KO45_LINE -22
#define KO5_LINE -23
#define KO6_LINE -24
#define KO7_LINE -25
#define KP1_LINE -26
#define KP2_LINE -27
#define KP23_LINE -28
#define KP3_LINE -29
#define KP4_LINE -30
#define KP5_LINE -31
#define L1L2_LINE -32
#define L1L3_LINE -33
#define L1M1_LINE -34
#define L1M2_LINE -35
#define L1M3_LINE -36
#define L1M4_LINE -37
#define L1M45_LINE -38
#define L1M5_LINE -39
#define L1N1_LINE -40
#define L1N2_LINE -41
#define L1N3_LINE -42
#define L1N4_LINE -43
#define L1N45_LINE -44
#define L1N5_LINE -45
#define L1N6_LINE -46
#define L1N7_LINE -47
#define L1O1_LINE -48
#define L1O2_LINE -49
#define L1O23_LINE -50
#define L1O3_LINE -51
#define L1O4_LINE -52
#define L1O5_LINE -53
#define L1O6_LINE -54
#define L1O7_LINE -55
#define L1P1_LINE -56
#define L1P2_LINE -57
#define L1P23_LINE -58
#define L1P3_LINE -59
#define L1P4_LINE -60
#define L1P5_LINE -61
#define L2L3_LINE -62
#define L2M1_LINE -63
#define L2M2_LINE -64
#define L2M3_LINE -65
#define L2M4_LINE -66
#define L2M5_LINE -67
#define L2N1_LINE -68
#define L2N2_LINE -69
#define L2N3_LINE -70
#define L2N4_LINE -71
#define L2N5_LINE -72
#define L2N6_LINE -73
#define L2N7_LINE -74
#define L2O1_LINE -75
#define L2O2_LINE -76
#define L2O3_LINE -77
#define L2O4_LINE -78
#define L2O5_LINE -79
#define L2O6_LINE -80
#define L2O7_LINE -81
#define L2P1_LINE -82
#define L2P2_LINE -83
#define L2P3_LINE -84
#define L2P4_LINE -85
#define L2P5_LINE -86
#define L3M1_LINE -87
#define L3M2_LINE -88
#define L3M3_LINE -89
#define L3M4_LINE -90
#define L3M5_LINE -91
#define L3N1_LINE -92
#define L3N2_LINE -93
#define L3N3_LINE -94
#define L3N4_LINE -95
#define L3N5_LINE -96
#define L3N6_LINE -97
#define L3N7_LINE -98
#define L3O1_LINE -99
#define L3O2_LINE -100
#define L3O3_LINE -101
#define L3O4_LINE -102
#define L3O45_LINE -103
#define L3O5_LINE -104
#define L3O6_LINE -105
#define L3O7_LINE -106
#define L3P1_LINE -107
#define L3P2_LINE -108
#define L3P3_LINE -109
#define L3P4_LINE -110
#define L3P5_LINE -111
#define M1M2_LINE -112
#define M1M3_LINE -113
#define M1M4_LINE -114
#define M1M5_LINE -115
#define M1N1_LINE -116
#define M1N2_LINE -117
#define M1N3_LINE -118
#define M1N4_LINE -119
#define M1N5_LINE -120
#define M1N6_LINE -121
#define M1N7_LINE -122
#define M1O1_LINE -123
#define M1O2_LINE -124
#define M1O3_LINE -125
#define M1O4_LINE -126
#define M1O5_LINE -127
#define M1O6_LINE -128
#define M1O7_LINE -129
#define M1P1_LINE -130
#define M1P2_LINE -131
#define M1P3_LINE -132
#define M1P4_LINE -133
#define M1P5_LINE -134
#define M2M3_LINE -135
#define M2M4_LINE -136
#define M2M5_LINE -137
#define M2N1_LINE -138
#define M2N2_LINE -139
#define M2N3_LINE -140
#define M2N4_LINE -141
#define M2N5_LINE -142
#define M2N6_LINE -143
#define M2N7_LINE -144
#define M2O1_LINE -145
#define M2O2_LINE -146
#define M2O3_LINE -147
#define M2O4_LINE -148
#define M2O5_LINE -149
#define M2O6_LINE -150
#define M2O7_LINE -151
#define M2P1_LINE -152
#define M2P2_LINE -153
#define M2P3_LINE -154
#define M2P4_LINE -155
#define M2P5_LINE -156
#define M3M4_LINE -157
#define M3M5_LINE -158
#define M3N1_LINE -159
#define M3N2_LINE -160
#define M3N3_LINE -161
#define M3N4_LINE -162
#define M3N5_LINE -163
#define M3N6_LINE -164
#define M3N7_LINE -165
#define M3O1_LINE -166
#define M3O2_LINE -167
#define M3O3_LINE -168
#define M3O4_LINE -169
#define M3O5_LINE -170
#define M3O6_LINE -171
#define M3O7_LINE -172
#define M3P1_LINE -173
#define M3P2_LINE -174
#define M3P3_LINE -175
#define M3P4_LINE -176
#define M3P5_LINE -177
#define M3Q1_LINE -178
#define M4M5_LINE -179
#define M4N1_LINE -180
#define M4N2_LINE -181
#define M4N3_LINE -182
#define M4N4_LINE -183
#define M4N5_LINE -184
#define M4N6_LINE -185
#define M4N7_LINE -186
#define M4O1_LINE -187
#define M4O2_LINE -188
#define M4O3_LINE -189
#define M4O4_LINE -190
#define M4O5_LINE -191
#define M4O6_LINE -192
#define M4O7_LINE -193
#define M4P1_LINE -194
#define M4P2_LINE -195
#define M4P3_LINE -196
#define M4P4_LINE -197
#define M4P5_LINE -198
#define M5N1_LINE -199
#define M5N2_LINE -200
#define M5N3_LINE -201
#define M5N4_LINE -202
#define M5N5_LINE -203
#define M5N6_LINE -204
#define M5N7_LINE -205
#define M5O1_LINE -206
#define M5O2_LINE -207
#define M5O3_LINE -208
#define M5O4_LINE -209
#define M5O5_LINE -210
#define M5O6_LINE -211
#define M5O7_LINE -212
#define M5P1_LINE -213
#define M5P2_LINE -214
#define M5P3_LINE -215
#define M5P4_LINE -216
#define M5P5_LINE -217
#define N1N2_LINE -218
#define N1N3_LINE -219
#define N1N4_LINE -220
#define N1N5_LINE -221
#define N1N6_LINE -222
#define N1N7_LINE -223
#define N1O1_LINE -224
#define N1O2_LINE -225
#define N1O3_LINE -226
#define N1O4_LINE -227
#define N1O5_LINE -228
#define N1O6_LINE -229
#define N1O7_LINE -230
#define N1P1_LINE -231
#define N1P2_LINE -232
#define N1P3_LINE -233
#define N1P4_LINE -234
#define N1P5_LINE -235
#define N2N3_LINE -236
#define N2N4_LINE -237
#define N2N5_LINE -238
#define N2N6_LINE -239
#define N2N7_LINE -240
#define N2O1_LINE -241
#define N2O2_LINE -242
#define N2O3_LINE -243
#define N2O4_LINE -244
#define N2O5_LINE -245
#define N2O6_LINE -246
#define N2O7_LINE -247
#define N2P1_LINE -248
#define N2P2_LINE -249
#define N2P3_LINE -250
#define N2P4_LINE -251
#define N2P5_LINE -252
#define N3N4_LINE -253
#define N3N5_LINE -254
#define N3N6_LINE -255
#define N3N7_LINE -256
#define N3O1_LINE -257
#define N3O2_LINE -258
#define N3O3_LINE -259
#define N3O4_LINE -260
#define N3O5_LINE -261
#define N3O6_LINE -262
#define N3O7_LINE -263
#define N3P1_LINE -264
#define N3P2_LINE -265
#define N3P3_LINE -266
#define N3P4_LINE -267
#define N3P5_LINE -268
#define N4N5_LINE -269
#define N4N6_LINE -270
#define N4N7_LINE -271
#define N4O1_LINE -272
#define N4O2_LINE -273
#define N4O3_LINE -274
#define N4O4_LINE -275
#define N4O5_LINE -276
#define N4O6_LINE -277
#define N4O7_LINE -278
#define N4P1_LINE -279
#define N4P2_LINE -280
#define N4P3_LINE -281
#define N4P4_LINE -282
#define N4P5_LINE -283
#define N5N6_LINE -284
#define N5N7_LINE -285
#define N5O1_LINE -286
#define N5O2_LINE -287
#define N5O3_LINE -288
#define N5O4_LINE -289
#define N5O5_LINE -290
#define N5O6_LINE -291
#define N5O7_LINE -292
#define N5P1_LINE -293
#define N5P2_LINE -294
#define N5P3_LINE -295
#define N5P4_LINE -296
#define N5P5_LINE -297
#define N6N7_LINE -298
#define N6O1_LINE -299
#define N6O2_LINE -300
#define N6O3_LINE -301
#define N6O4_LINE -302
#define N6O5_LINE -303
#define N6O6_LINE -304
#define N6O7_LINE -305
#define N6P1_LINE -306
#define N6P2_LINE -307
#define N6P3_LINE -308
#define N6P4_LINE -309
#define N6P5_LINE -310
#define N7O1_LINE -311
#define N7O2_LINE -312
#define N7O3_LINE -313
#define N7O4_LINE -314
#define N7O5_LINE -315
#define N7O6_LINE -316
#define N7O7_LINE -317
#define N7P1_LINE -318
#define N7P2_LINE -319
#define N7P3_LINE -320
#define N7P4_LINE -321
#define N7P5_LINE -322
#define O1O2_LINE -323
#define O1O3_LINE -324
#define O1O4_LINE -325
#define O1O5_LINE -326
#define O1O6_LINE -327
#define O1O7_LINE -328
#define O1P1_LINE -329
#define O1P2_LINE -330
#define O1P3_LINE -331
#define O1P4_LINE -332
#define O1P5_LINE -333
#define O2O3_LINE -334
#define O2O4_LINE -335
#define O2O5_LINE -336
#define O2O6_LINE -337
#define O2O7_LINE -338
#define O2P1_LINE -339
#define O2P2_LINE -340
#define O2P3_LINE -341
#define O2P4_LINE -342
#define O2P5_LINE -343
#define O3O4_LINE -344
#define O3O5_LINE -345
#define O3O6_LINE -346
#define O3O7_LINE -347
#define O3P1_LINE -348
#define O3P2_LINE -349
#define O3P3_LINE -350
#define O3P4_LINE -351
#define O3P5_LINE -352
#define O4O5_LINE -353
#define O4O6_LINE -354
#define O4O7_LINE -355
#define O4P1_LINE -356
#define O4P2_LINE -357
#define O4P3_LINE -358
#define O4P4_LINE -359
#define O4P5_LINE -360
#define O5O6_LINE -361
#define O5O7_LINE -362
#define O5P1_LINE -363
#define O5P2_LINE -364
#define O5P3_LINE -365
#define O5P4_LINE -366
#define O5P5_LINE -367
#define O6O7_LINE -368
#define O6P4_LINE -369
#define O6P5_LINE -370
#define O7P4_LINE -371
#define O7P5_LINE -372
#define P1P2_LINE -373
#define P1P3_LINE -374
#define P1P4_LINE -375
#define P1P5_LINE -376
#define P2P3_LINE -377
#define P2P4_LINE -378
#define P2P5_LINE -379
#define P3P4_LINE -380
#define P3P5_LINE -381
