aboutsummaryrefslogtreecommitdiff
path: root/docs/doxygen/nel/a03762.html
blob: b8dbeff766d60613cbf21a8538bcf5afba4ddfe0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>NeL: NL3D::CZoneSymmetrisation class Reference</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.3.6 -->
<div class="qindex">  <form class="search" action="search.php" method="get">
<a class="qindex" href="main.html">Main&nbsp;Page</a> | <a class="qindex" href="namespaces.html">Namespace List</a> | <a class="qindex" href="hierarchy.html">Class&nbsp;Hierarchy</a> | <a class="qindex" href="classes.html">Alphabetical&nbsp;List</a> | <a class="qindex" href="annotated.html">Data&nbsp;Structures</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="namespacemembers.html">Namespace&nbsp;Members</a> | <a class="qindex" href="functions.html">Data&nbsp;Fields</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related&nbsp;Pages</a>  | <span class="search"><u>S</u>earch&nbsp;for&nbsp;<input class="search" type="text" name="query" value="" size="20" accesskey="s"/></span></form></div>
<h1>NL3D::CZoneSymmetrisation Class Reference</h1><code>#include &lt;<a class="el" href="a06779.html">zone_symmetrisation.h</a>&gt;</code>
<p>
<hr><a name="_details"></a><h2>Detailed Description</h2>
Environnement used to symmetrise zones<p>
This class build symmetry specific informations needed to know how transform tiles when a zone is symmetrise.<p>
There is two states for a tile : Regular or Goofy. If the tile is regular, it doesn't need specific transformation when the zone is symmetrise. If the tile is goofy, the tile must be rotate by 180deg more to be correct.<p>
<dl compact><dt><b>Author:</b></dt><dd>Cyril 'Hulud' Corvazier <p>
Nevrax France </dd></dl>
<dl compact><dt><b>Date:</b></dt><dd>2002 </dd></dl>

<p>

<p>
Definition at line <a class="el" href="a06779.html#l00054">54</a> of file <a class="el" href="a06779.html">zone_symmetrisation.h</a>.<table border=0 cellpadding=0 cellspacing=0>
<tr><td></td></tr>
<tr><td colspan=2><br><h2>Public Types</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>enum &nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a03762.html#NL3D_1_1CZoneSymmetrisationw3">TState</a> { <a class="el" href="a03762.html#NL3D_1_1CZoneSymmetrisationw3NL3D_1_1CZoneSymmetrisationw1">Nothing</a> = 0, 
<a class="el" href="a03762.html#NL3D_1_1CZoneSymmetrisationw3NL3D_1_1CZoneSymmetrisationw2">Regular</a> = 1, 
<a class="el" href="a03762.html#NL3D_1_1CZoneSymmetrisationw3NL3D_1_1CZoneSymmetrisationw0">Goofy</a> = 2
 }</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Symmetrie state.  <a href="#NL3D_1_1CZoneSymmetrisationw3">More...</a><br><br></td></tr>
<tr><td colspan=2><br><h2>Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>bool&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a03762.html#NL3D_1_1CZoneSymmetrisationa0">build</a> (const std::vector&lt; <a class="el" href="a03066.html">CPatchInfo</a> &gt; &amp;patchInfo, float snapCell, float weldThreshold, const <a class="el" href="a03517.html">CTileBank</a> &amp;bank, <a class="el" href="a03763.html">CError</a> &amp;errorDesc, const <a class="el" href="a02851.html">NLMISC::CMatrix</a> &amp;toOriginalSpace)</td></tr>

<tr><td class="memItemLeft" nowrap align=right valign=top>&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a03762.html#NL3D_1_1CZoneSymmetrisationa1">CZoneSymmetrisation</a> ()</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Constructor.  <a href="#NL3D_1_1CZoneSymmetrisationa1"></a><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a03762.html#NL3D_1_1CZoneSymmetrisationw3">TState</a>&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a03762.html#NL3D_1_1CZoneSymmetrisationa2">getOrientedTileBorderState</a> (<a class="el" href="a04558.html#a15">uint</a> patch, <a class="el" href="a04558.html#a15">uint</a> tile) const </td></tr>

<tr><td class="memItemLeft" nowrap align=right valign=top>bool&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a03762.html#NL3D_1_1CZoneSymmetrisationa3">getOrientedTileCorner</a> (<a class="el" href="a04558.html#a15">uint</a> patch, <a class="el" href="a04558.html#a15">uint</a> tile)</td></tr>

<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a03762.html#NL3D_1_1CZoneSymmetrisationw3">TState</a>&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a03762.html#NL3D_1_1CZoneSymmetrisationa4">getTileBorderState</a> (<a class="el" href="a04558.html#a15">uint</a> patch, <a class="el" href="a04558.html#a15">uint</a> tile) const </td></tr>

<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a03762.html#NL3D_1_1CZoneSymmetrisationw3">TState</a>&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a03762.html#NL3D_1_1CZoneSymmetrisationa5">getTileState</a> (<a class="el" href="a04558.html#a15">uint</a> patch, <a class="el" href="a04558.html#a15">uint</a> tile, <a class="el" href="a04558.html#a15">uint</a> layer) const </td></tr>

<tr><td colspan=2><br><h2>Private Member Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>bool&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a03762.html#NL3D_1_1CZoneSymmetrisationd0">propagateTileState</a> (<a class="el" href="a04558.html#a15">uint</a> i, <a class="el" href="a04558.html#a15">uint</a> <a class="el" href="a04223.html#a626">s</a>, <a class="el" href="a04558.html#a15">uint</a> <a class="el" href="a04223.html#a627">t</a>, const std::vector&lt; <a class="el" href="a03066.html">CPatchInfo</a> &gt; &amp;patchInfo, const <a class="el" href="a03517.html">CTileBank</a> &amp;bank, bool forceRegular)</td></tr>

<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a03762.html#NL3D_1_1CZoneSymmetrisationd1">setOrientedTileBorderState</a> (<a class="el" href="a04558.html#a15">uint</a> patch, <a class="el" href="a04558.html#a15">uint</a> tile, <a class="el" href="a03762.html#NL3D_1_1CZoneSymmetrisationw3">TState</a> state)</td></tr>

<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a03762.html#NL3D_1_1CZoneSymmetrisationd2">setOrientedTileCorner</a> (<a class="el" href="a04558.html#a15">uint</a> patch, <a class="el" href="a04558.html#a15">uint</a> tile, bool corner)</td></tr>

<tr><td class="memItemLeft" nowrap align=right valign=top>bool&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a03762.html#NL3D_1_1CZoneSymmetrisationd3">setOrientedTileState</a> (const <a class="el" href="a03066.html">NL3D::CPatchInfo</a> &amp;patch, <a class="el" href="a04558.html#a15">uint</a> patchId, float snapCell, float weldThreshold, <a class="el" href="a03762.html#NL3D_1_1CZoneSymmetrisationw3">TState</a> &amp;state, const <a class="el" href="a02851.html">NLMISC::CMatrix</a> &amp;toOriginalSpace, const <a class="el" href="a03517.html">CTileBank</a> &amp;bank)</td></tr>

<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a03762.html#NL3D_1_1CZoneSymmetrisationd4">setTileBorderState</a> (<a class="el" href="a04558.html#a15">uint</a> patch, <a class="el" href="a04558.html#a15">uint</a> tile, <a class="el" href="a03762.html#NL3D_1_1CZoneSymmetrisationw3">TState</a> state)</td></tr>

<tr><td class="memItemLeft" nowrap align=right valign=top>bool&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a03762.html#NL3D_1_1CZoneSymmetrisationd5">setTileState</a> (const <a class="el" href="a03066.html">NL3D::CPatchInfo</a> &amp;patch, <a class="el" href="a04558.html#a15">uint</a> patchId, float snapCell, float weldThreshold, <a class="el" href="a03762.html#NL3D_1_1CZoneSymmetrisationw3">TState</a> &amp;state, const <a class="el" href="a02851.html">NLMISC::CMatrix</a> &amp;toOriginalSpace, const <a class="el" href="a03517.html">CTileBank</a> &amp;bank)</td></tr>

<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a03762.html#NL3D_1_1CZoneSymmetrisationd6">setTileState</a> (<a class="el" href="a04558.html#a15">uint</a> patch, <a class="el" href="a04558.html#a15">uint</a> tile, <a class="el" href="a04558.html#a15">uint</a> layer, <a class="el" href="a03762.html#NL3D_1_1CZoneSymmetrisationw3">TState</a> state)</td></tr>

<tr><td colspan=2><br><h2>Static Private Member Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>bool&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a03762.html#NL3D_1_1CZoneSymmetrisationh0">snapOnGrid</a> (float &amp;<a class="el" href="a04223.html#a658">value</a>, float resolution, float snap)</td></tr>

<tr><td colspan=2><br><h2>Private Attributes</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>std::vector&lt; std::vector&lt;<br>
 <a class="el" href="a04558.html#a9">uint16</a> &gt; &gt;&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a03762.html#NL3D_1_1CZoneSymmetrisationr0">_TilesLayerStates</a></td></tr>

</table>
<hr><h2>Member Enumeration Documentation</h2>
<a class="anchor" name="NL3D_1_1CZoneSymmetrisationw3" doxytag="NL3D::CZoneSymmetrisation::TState" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> enum <a class="el" href="a03762.html#NL3D_1_1CZoneSymmetrisationw3">NL3D::CZoneSymmetrisation::TState</a>
      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Symmetrie state. 
<p>
<dl compact><dt><b>Enumeration values: </b></dt><dd>
<table border=0 cellspacing=2 cellpadding=0>
<tr><td valign=top><em><a class="anchor" name="NL3D_1_1CZoneSymmetrisationw3NL3D_1_1CZoneSymmetrisationw1" doxytag="Nothing" ></a>Nothing</em>&nbsp;</td><td>
</td></tr>
<tr><td valign=top><em><a class="anchor" name="NL3D_1_1CZoneSymmetrisationw3NL3D_1_1CZoneSymmetrisationw2" doxytag="Regular" ></a>Regular</em>&nbsp;</td><td>
</td></tr>
<tr><td valign=top><em><a class="anchor" name="NL3D_1_1CZoneSymmetrisationw3NL3D_1_1CZoneSymmetrisationw0" doxytag="Goofy" ></a>Goofy</em>&nbsp;</td><td>
</td></tr>
</table>
</dl>

<p>
Definition at line <a class="el" href="a06779.html#l00059">59</a> of file <a class="el" href="a06779.html">zone_symmetrisation.h</a>.
<p>
<div class="fragment"><pre>00060         {
00061                 <a class="code" href="a03762.html#NL3D_1_1CZoneSymmetrisationw3NL3D_1_1CZoneSymmetrisationw1">Nothing</a>         =0,
00062                 <a class="code" href="a03762.html#NL3D_1_1CZoneSymmetrisationw3NL3D_1_1CZoneSymmetrisationw2">Regular</a>         =1,
00063                 <a class="code" href="a03762.html#NL3D_1_1CZoneSymmetrisationw3NL3D_1_1CZoneSymmetrisationw0">Goofy</a>           =2,
00064         };
</pre></div>    </td>
  </tr>
</table>
<hr><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" name="NL3D_1_1CZoneSymmetrisationa1" doxytag="NL3D::CZoneSymmetrisation::CZoneSymmetrisation" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> NL3D::CZoneSymmetrisation::CZoneSymmetrisation </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="mdname1" valign="top" nowrap>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Constructor. 
<p>

<p>
Definition at line <a class="el" href="a06778.html#l00039">39</a> of file <a class="el" href="a06778.html">zone_symmetrisation.cpp</a>.
<p>
<div class="fragment"><pre>00040 {
00041 }
</pre></div>    </td>
  </tr>
</table>
<hr><h2>Member Function Documentation</h2>
<a class="anchor" name="NL3D_1_1CZoneSymmetrisationa0" doxytag="NL3D::CZoneSymmetrisation::build" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> bool NL3D::CZoneSymmetrisation::build </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">const std::vector&lt; <a class="el" href="a03066.html">CPatchInfo</a> &gt; &amp;&nbsp;</td>
          <td class="mdname" nowrap> <em>patchInfo</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td></td>
          <td class="md" nowrap>float&nbsp;</td>
          <td class="mdname" nowrap> <em>snapCell</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td></td>
          <td class="md" nowrap>float&nbsp;</td>
          <td class="mdname" nowrap> <em>weldThreshold</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td></td>
          <td class="md" nowrap>const <a class="el" href="a03517.html">CTileBank</a> &amp;&nbsp;</td>
          <td class="mdname" nowrap> <em>bank</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td></td>
          <td class="md" nowrap><a class="el" href="a03763.html">CError</a> &amp;&nbsp;</td>
          <td class="mdname" nowrap> <em>errorDesc</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td></td>
          <td class="md" nowrap>const <a class="el" href="a02851.html">NLMISC::CMatrix</a> &amp;&nbsp;</td>
          <td class="mdname" nowrap> <em>toOriginalSpace</em></td>
        </tr>
        <tr>
          <td></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Build symmetry informations<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign=top><em>zone</em>&nbsp;</td><td>is the zone to build symmetry informations </td></tr>
    <tr><td valign=top><em>snapCell</em>&nbsp;</td><td>is the unit size of the zones </td></tr>
    <tr><td valign=top><em>weldThreshold</em>&nbsp;</td><td>is the threshold used to check vertex over snaped positions </td></tr>
    <tr><td valign=top><em>errorDesc</em>&nbsp;</td><td>is a structure used to return errors </td></tr>
    <tr><td valign=top><em>toOriginalSpace</em>&nbsp;</td><td>is the matrix used to transform back a vertex in its original position before symmetry / rotation </td></tr>
  </table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>false if the patch topology is invalid for this operations</dd></dl>

<p>
Definition at line <a class="el" href="a06778.html#l00186">186</a> of file <a class="el" href="a06778.html">zone_symmetrisation.cpp</a>.
<p>
References <a class="el" href="a06779.html#l00158">_TilesLayerStates</a>, <a class="el" href="a06779.html#l00070">NL3D::CZoneSymmetrisation::CError::Errors</a>, <a class="el" href="a06760.html#l00122">NL3D::CPatchInfo::OrderS</a>, <a class="el" href="a06760.html#l00122">NL3D::CPatchInfo::OrderT</a>, <a class="el" href="a06778.html#l00670">propagateTileState()</a>, <a class="el" href="a05646.html#l00977">s</a>, <a class="el" href="a06778.html#l00472">setOrientedTileState()</a>, <a class="el" href="a06778.html#l00086">setTileState()</a>, <a class="el" href="a05646.html#l00985">t</a>, <a class="el" href="a06229.html#l02652">NLMISC::toString()</a>, and <a class="el" href="a05981.html#l00105">uint</a>.
<p>
Referenced by <a class="el" href="a06758.html#l01825">NL3D::CPatchInfo::transform()</a>.
<p>
<div class="fragment"><pre>00187 {
00188         <span class="comment">// * Clear errors</span>
00189         errorDesc.Errors.clear ();
00190 
00191         <span class="comment">// * Build the patches state</span>
00192         
00193         <span class="comment">// A) Resize arrays</span>
00194         <a class="code" href="a03762.html#NL3D_1_1CZoneSymmetrisationr0">_TilesLayerStates</a>.resize (patchInfo.size ());
00195 
00196         <span class="comment">// D) Resize the tile array</span>
00197         <a class="code" href="a04558.html#a15">uint</a> i;
00198         <span class="keywordflow">for</span> (i=0; i&lt;patchInfo.size (); i++)
00199         {
00200                 <span class="comment">// Ref on the patch</span>
00201                 <span class="keyword">const</span> CPatchInfo &amp;patch = patchInfo[i];
00202                 <a class="code" href="a03762.html#NL3D_1_1CZoneSymmetrisationr0">_TilesLayerStates</a>[i].resize (0);
00203                 <a class="code" href="a03762.html#NL3D_1_1CZoneSymmetrisationr0">_TilesLayerStates</a>[i].resize (patch.OrderS * patch.OrderT, 0);
00204         }
00205 
00206         <span class="comment">// B), C) and E) We need to select patches having an open edge on the zone border. To do so, we use the snapCell and weldThreshold parameters</span>
00207         <span class="keywordflow">for</span> (i=0; i&lt;patchInfo.size (); i++)
00208         {
00209                 <span class="comment">// Ref on the patch</span>
00210                 <span class="keyword">const</span> CPatchInfo &amp;patch = patchInfo[i];
00211 
00212                 <span class="comment">// Does this patch is over a border ?</span>
00213                 <a class="code" href="a03762.html#NL3D_1_1CZoneSymmetrisationw3">TState</a> patchState;
00214                 <span class="keywordflow">if</span> (!<a class="code" href="a03762.html#NL3D_1_1CZoneSymmetrisationd6">setTileState</a> (patch, i, snapCell, weldThreshold, patchState, toOriginalSpace, bank))
00215                 {
00216                         <span class="comment">// Push an error</span>
00217                         errorDesc.Errors.push_back (<span class="stringliteral">"Patch nb "</span>+toString (i)+<span class="stringliteral">" is invalid"</span>);
00218                 }
00219 
00220                 <span class="comment">// Set the oriented patch state</span>
00221                 <span class="keywordflow">if</span> (!<a class="code" href="a03762.html#NL3D_1_1CZoneSymmetrisationd3">setOrientedTileState</a> (patch, i, snapCell, weldThreshold, patchState, toOriginalSpace, bank))
00222                 {
00223                         <span class="comment">// Push an error</span>
00224                         errorDesc.Errors.push_back (<span class="stringliteral">"Patch nb "</span>+toString (i)+<span class="stringliteral">" is invalid"</span>);
00225                 }
00226         }
00227 
00228         <span class="comment">// F) We flag each tile on an opened edge using this formula</span>
00229         <span class="comment">//      - If the patch is not Nothing do</span>
00230         <span class="comment">//              - tileIsGoofy = (patchIsGoofy) XOR ((tileRotation&amp;1) != 0)</span>
00231         <span class="keywordflow">for</span> (i=0; i&lt;patchInfo.size (); i++)
00232         {
00233                 <span class="comment">// Ref on the patch</span>
00234                 <span class="keyword">const</span> CPatchInfo &amp;patch = patchInfo[i];
00235 
00236                 <span class="comment">// For each tile</span>
00237                 <a class="code" href="a04558.html#a15">uint</a> <a class="code" href="a04223.html#a626">s</a>,<a class="code" href="a04223.html#a627">t</a>;
00238                 <span class="keywordflow">for</span> (<a class="code" href="a04223.html#a627">t</a>=0; <a class="code" href="a04223.html#a627">t</a>&lt;patch.OrderT; <a class="code" href="a04223.html#a627">t</a>++)
00239                 {
00240                         <span class="keywordflow">for</span> (<a class="code" href="a04223.html#a626">s</a>=0; <a class="code" href="a04223.html#a626">s</a>&lt;patch.OrderS; <a class="code" href="a04223.html#a626">s</a>++)
00241                         {
00242                                 <span class="keywordflow">if</span> (!<a class="code" href="a03762.html#NL3D_1_1CZoneSymmetrisationd0">propagateTileState</a> (i, s, t, patchInfo, bank, <span class="keyword">false</span>))
00243                                 {
00244                                         <span class="comment">// Push an error</span>
00245                                         errorDesc.Errors.push_back (<span class="stringliteral">"Error during propagation. Topology invalid."</span>);
00246                                         <span class="keywordflow">return</span> <span class="keyword">false</span>;
00247                                 }
00248                         }
00249                 }
00250         }
00251 
00252         <span class="comment">// G) Force all remaining Nothing tiles to Regular</span>
00253         <span class="keywordflow">for</span> (i=0; i&lt;patchInfo.size (); i++)
00254         {
00255                 <span class="comment">// Ref on the patch</span>
00256                 <span class="keyword">const</span> CPatchInfo &amp;patch = patchInfo[i];
00257 
00258                 <span class="comment">// For each tile</span>
00259                 <a class="code" href="a04558.html#a15">uint</a> <a class="code" href="a04223.html#a626">s</a>,<a class="code" href="a04223.html#a627">t</a>;
00260                 <span class="keywordflow">for</span> (<a class="code" href="a04223.html#a627">t</a>=0; <a class="code" href="a04223.html#a627">t</a>&lt;patch.OrderT; <a class="code" href="a04223.html#a627">t</a>++)
00261                 {
00262                         <span class="keywordflow">for</span> (<a class="code" href="a04223.html#a626">s</a>=0; <a class="code" href="a04223.html#a626">s</a>&lt;patch.OrderS; <a class="code" href="a04223.html#a626">s</a>++)
00263                         {
00264                                 <span class="keywordflow">if</span> (!<a class="code" href="a03762.html#NL3D_1_1CZoneSymmetrisationd0">propagateTileState</a> (i, s, t, patchInfo, bank, <span class="keyword">true</span>))
00265                                 {
00266                                         <span class="comment">// Push an error</span>
00267                                         errorDesc.Errors.push_back (<span class="stringliteral">"Error during propagation. Topology invalid."</span>);
00268                                         <span class="keywordflow">return</span> <span class="keyword">false</span>;
00269                                 }
00270                         }
00271                 }
00272         }
00273 
00274         <span class="comment">// Returns true if no error</span>
00275         <span class="keywordflow">return</span> <span class="keyword">true</span>; <span class="comment">// errorDesc.Errors.size () == 0;</span>
00276 }
</pre></div>    </td>
  </tr>
</table>
<a class="anchor" name="NL3D_1_1CZoneSymmetrisationa2" doxytag="NL3D::CZoneSymmetrisation::getOrientedTileBorderState" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> <a class="el" href="a03762.html#NL3D_1_1CZoneSymmetrisationw3">CZoneSymmetrisation::TState</a> NL3D::CZoneSymmetrisation::getOrientedTileBorderState </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top"><a class="el" href="a04558.html#a15">uint</a>&nbsp;</td>
          <td class="mdname" nowrap> <em>patch</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td></td>
          <td class="md" nowrap><a class="el" href="a04558.html#a15">uint</a>&nbsp;</td>
          <td class="mdname" nowrap> <em>tile</em></td>
        </tr>
        <tr>
          <td></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"> const</td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Get tile symmetry state for oriented tiles Can return Regular, Goofy or Nothing.
<p>
Definition at line <a class="el" href="a06778.html#l00072">72</a> of file <a class="el" href="a06778.html">zone_symmetrisation.cpp</a>.
<p>
References <a class="el" href="a06778.html#l00057">getTileState()</a>, and <a class="el" href="a05981.html#l00105">uint</a>.
<p>
<div class="fragment"><pre>00073 {
00074         <span class="keywordflow">return</span> <a class="code" href="a03762.html#NL3D_1_1CZoneSymmetrisationa5">getTileState</a> (patch, tile, 4);
00075 }
</pre></div>    </td>
  </tr>
</table>
<a class="anchor" name="NL3D_1_1CZoneSymmetrisationa3" doxytag="NL3D::CZoneSymmetrisation::getOrientedTileCorner" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> bool NL3D::CZoneSymmetrisation::getOrientedTileCorner </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top"><a class="el" href="a04558.html#a15">uint</a>&nbsp;</td>
          <td class="mdname" nowrap> <em>patch</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td></td>
          <td class="md" nowrap><a class="el" href="a04558.html#a15">uint</a>&nbsp;</td>
          <td class="mdname" nowrap> <em>tile</em></td>
        </tr>
        <tr>
          <td></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Set oriented tile corner state
<p>
Definition at line <a class="el" href="a06778.html#l00079">79</a> of file <a class="el" href="a06778.html">zone_symmetrisation.cpp</a>.
<p>
References <a class="el" href="a06779.html#l00158">_TilesLayerStates</a>, and <a class="el" href="a05981.html#l00105">uint</a>.
<p>
Referenced by <a class="el" href="a06778.html#l00670">propagateTileState()</a>.
<p>
<div class="fragment"><pre>00080 {
00081         <span class="keywordflow">return</span> ( ( <a class="code" href="a03762.html#NL3D_1_1CZoneSymmetrisationr0">_TilesLayerStates</a>[patch][tile] &gt;&gt; 10 ) &amp; 1 ) != 0;
00082 }
</pre></div>    </td>
  </tr>
</table>
<a class="anchor" name="NL3D_1_1CZoneSymmetrisationa4" doxytag="NL3D::CZoneSymmetrisation::getTileBorderState" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> <a class="el" href="a03762.html#NL3D_1_1CZoneSymmetrisationw3">CZoneSymmetrisation::TState</a> NL3D::CZoneSymmetrisation::getTileBorderState </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top"><a class="el" href="a04558.html#a15">uint</a>&nbsp;</td>
          <td class="mdname" nowrap> <em>patch</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td></td>
          <td class="md" nowrap><a class="el" href="a04558.html#a15">uint</a>&nbsp;</td>
          <td class="mdname" nowrap> <em>tile</em></td>
        </tr>
        <tr>
          <td></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"> const</td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Get tile symmetry state Can return Regular, Goofy or Nothing.
<p>
Definition at line <a class="el" href="a06778.html#l00065">65</a> of file <a class="el" href="a06778.html">zone_symmetrisation.cpp</a>.
<p>
References <a class="el" href="a06778.html#l00057">getTileState()</a>, and <a class="el" href="a05981.html#l00105">uint</a>.
<p>
<div class="fragment"><pre>00066 {
00067         <span class="keywordflow">return</span> <a class="code" href="a03762.html#NL3D_1_1CZoneSymmetrisationa5">getTileState</a> (patch, tile, 3);
00068 }
</pre></div>    </td>
  </tr>
</table>
<a class="anchor" name="NL3D_1_1CZoneSymmetrisationa5" doxytag="NL3D::CZoneSymmetrisation::getTileState" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> <a class="el" href="a03762.html#NL3D_1_1CZoneSymmetrisationw3">CZoneSymmetrisation::TState</a> NL3D::CZoneSymmetrisation::getTileState </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top"><a class="el" href="a04558.html#a15">uint</a>&nbsp;</td>
          <td class="mdname" nowrap> <em>patch</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td></td>
          <td class="md" nowrap><a class="el" href="a04558.html#a15">uint</a>&nbsp;</td>
          <td class="mdname" nowrap> <em>tile</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td></td>
          <td class="md" nowrap><a class="el" href="a04558.html#a15">uint</a>&nbsp;</td>
          <td class="mdname" nowrap> <em>layer</em></td>
        </tr>
        <tr>
          <td></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"> const</td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Get tile symmetry state Can return Regular, Goofy or Nothing.
<p>
Definition at line <a class="el" href="a06778.html#l00057">57</a> of file <a class="el" href="a06778.html">zone_symmetrisation.cpp</a>.
<p>
References <a class="el" href="a06779.html#l00158">_TilesLayerStates</a>, <a class="el" href="a05622.html#l00290">nlassert</a>, and <a class="el" href="a05981.html#l00105">uint</a>.
<p>
Referenced by <a class="el" href="a06778.html#l00072">getOrientedTileBorderState()</a>, <a class="el" href="a06778.html#l00065">getTileBorderState()</a>, <a class="el" href="a06778.html#l00670">propagateTileState()</a>, and <a class="el" href="a06758.html#l01825">NL3D::CPatchInfo::transform()</a>.
<p>
<div class="fragment"><pre>00058 {
00059         <a class="code" href="a04199.html#a6">nlassert</a> (layer&lt;5);
00060         <span class="keywordflow">return</span> (<a class="code" href="a03762.html#NL3D_1_1CZoneSymmetrisationw3">TState</a>)((<a class="code" href="a03762.html#NL3D_1_1CZoneSymmetrisationr0">_TilesLayerStates</a>[patch][tile]&gt;&gt;(layer*2))&amp;0x3);
00061 }
</pre></div>    </td>
  </tr>
</table>
<a class="anchor" name="NL3D_1_1CZoneSymmetrisationd0" doxytag="NL3D::CZoneSymmetrisation::propagateTileState" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> bool NL3D::CZoneSymmetrisation::propagateTileState </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top"><a class="el" href="a04558.html#a15">uint</a>&nbsp;</td>
          <td class="mdname" nowrap> <em>i</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td></td>
          <td class="md" nowrap><a class="el" href="a04558.html#a15">uint</a>&nbsp;</td>
          <td class="mdname" nowrap> <em>s</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td></td>
          <td class="md" nowrap><a class="el" href="a04558.html#a15">uint</a>&nbsp;</td>
          <td class="mdname" nowrap> <em>t</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td></td>
          <td class="md" nowrap>const std::vector&lt; <a class="el" href="a03066.html">CPatchInfo</a> &gt; &amp;&nbsp;</td>
          <td class="mdname" nowrap> <em>patchInfo</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td></td>
          <td class="md" nowrap>const <a class="el" href="a03517.html">CTileBank</a> &amp;&nbsp;</td>
          <td class="mdname" nowrap> <em>bank</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td></td>
          <td class="md" nowrap>bool&nbsp;</td>
          <td class="mdname" nowrap> <em>forceRegular</em></td>
        </tr>
        <tr>
          <td></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"><code> [private]</code></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Propagate tile state information for a given tile.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign=top><em>i</em>&nbsp;</td><td>is the patch number in the zone that contain the tile to propagate </td></tr>
    <tr><td valign=top><em>u</em>&nbsp;</td><td>is the tile u coordinate in the patch </td></tr>
    <tr><td valign=top><em>v</em>&nbsp;</td><td>is the tile v coordinate in the patch </td></tr>
    <tr><td valign=top><em>patchInfo</em>&nbsp;</td><td>is a vector of patch information </td></tr>
    <tr><td valign=top><em>bank</em>&nbsp;</td><td>is the tile bank used by the landscape </td></tr>
    <tr><td valign=top><em>forceRegular</em>&nbsp;</td><td>must be true to force the first propagated tile to Regular if Nothing </td></tr>
  </table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>false if the patch topology is invalid for this operations true if succesful</dd></dl>

<p>
Definition at line <a class="el" href="a06778.html#l00670">670</a> of file <a class="el" href="a06778.html">zone_symmetrisation.cpp</a>.
<p>
References <a class="el" href="a06760.html#l00108">NL3D::CPatchInfo::CBindInfo::Edge</a>, <a class="el" href="a06778.html#l00663">NL3D::CFillStackNode::Edge</a>, <a class="el" href="a06537.html#l00333">NL3D::CTileSet::getOriented()</a>, <a class="el" href="a06778.html#l00079">getOrientedTileCorner()</a>, <a class="el" href="a06537.html#l00528">NL3D::CTileBank::getTileCount()</a>, <a class="el" href="a06537.html#l00520">NL3D::CTileBank::getTileSet()</a>, <a class="el" href="a06537.html#l00516">NL3D::CTileBank::getTileSetCount()</a>, <a class="el" href="a06778.html#l00057">getTileState()</a>, <a class="el" href="a06537.html#l00560">NL3D::CTileBank::getTileXRef()</a>, <a class="el" href="a03762.html#NL3D_1_1CZoneSymmetrisationw3NL3D_1_1CZoneSymmetrisationw0">Goofy</a>, <a class="el" href="a06760.html#l00106">NL3D::CPatchInfo::CBindInfo::Next</a>, <a class="el" href="a06541.html#l00053">NL_TILE_ELM_LAYER_EMPTY</a>, <a class="el" href="a05622.html#l00290">nlassert</a>, <a class="el" href="a05622.html#l00135">nlwarning</a>, <a class="el" href="a03762.html#NL3D_1_1CZoneSymmetrisationw3NL3D_1_1CZoneSymmetrisationw1">Nothing</a>, <a class="el" href="a06760.html#l00101">NL3D::CPatchInfo::CBindInfo::NPatchs</a>, <a class="el" href="a06760.html#l00122">NL3D::CPatchInfo::OrderS</a>, <a class="el" href="a06778.html#l00662">NL3D::CFillStackNode::Patch</a>, <a class="el" href="a03762.html#NL3D_1_1CZoneSymmetrisationw3NL3D_1_1CZoneSymmetrisationw2">Regular</a>, <a class="el" href="a06778.html#l00664">NL3D::CFillStackNode::Rotate</a>, <a class="el" href="a06778.html#l00660">NL3D::CFillStackNode::S</a>, <a class="el" href="a05646.html#l00977">s</a>, <a class="el" href="a06778.html#l00086">setTileState()</a>, <a class="el" href="a05981.html#l00104">sint</a>, <a class="el" href="a06778.html#l00665">NL3D::CFillStackNode::State</a>, <a class="el" href="a06778.html#l00661">NL3D::CFillStackNode::T</a>, <a class="el" href="a05646.html#l00985">t</a>, <a class="el" href="a06760.html#l00149">NL3D::CPatchInfo::Tiles</a>, <a class="el" href="a05646.html#l00244">type</a>, and <a class="el" href="a05981.html#l00105">uint</a>.
<p>
Referenced by <a class="el" href="a06778.html#l00186">build()</a>.
<p>
<div class="fragment"><pre>00671 {
00672         <span class="comment">// For each layer</span>
00673         <a class="code" href="a04558.html#a15">uint</a> layer;
00674         <span class="keywordflow">for</span> (layer=0; layer&lt;3; layer++)
00675         {
00676                 <span class="comment">// Get the patch ptr</span>
00677                 <span class="keyword">const</span> CPatchInfo *currentPatchPtr = &amp;(patchInfo[patch]);
00678 
00679                 <span class="comment">// Get the tile index</span>
00680                 <a class="code" href="a04558.html#a15">uint</a> tile = <a class="code" href="a04223.html#a626">s</a>+<a class="code" href="a04223.html#a627">t</a>*currentPatchPtr-&gt;OrderS;
00681 
00682                 <span class="comment">// Get the tiles set used here</span>
00683                 <a class="code" href="a04558.html#a15">uint</a> tileIndex = currentPatchPtr-&gt;Tiles[tile].Tile[layer];
00684                 <span class="keywordflow">if</span> (tileIndex != <a class="code" href="a05118.html#a12">NL_TILE_ELM_LAYER_EMPTY</a>)
00685                 {
00686                         <span class="comment">// Valid tile number ?</span>
00687                         <span class="keywordflow">if</span> (tileIndex &gt;= (<a class="code" href="a04558.html#a15">uint</a>)bank.getTileCount ())
00688                         {
00689                                 <a class="code" href="a04199.html#a2">nlwarning</a> (<span class="stringliteral">"CZoneSymmetrisation::propagateTileState: Invalid tile index"</span>);
00690                                 <span class="keywordflow">return</span> <span class="keyword">false</span>;
00691                         }
00692 
00693                         <span class="comment">// Get the tile set used by this layer</span>
00694                         <span class="keywordtype">int</span> tileSetToPropagate;
00695                         <span class="keywordtype">int</span> number;
00696                         CTileBank::TTileType <a class="code" href="a04223.html#a581">type</a>;
00697                         bank.getTileXRef (tileIndex, tileSetToPropagate, number, type);
00698 
00699                         <span class="keywordflow">if</span> ((tileSetToPropagate &lt; 0) || (tileSetToPropagate &gt;= bank.getTileSetCount()))
00700                         {
00701                                 <a class="code" href="a04199.html#a2">nlwarning</a>(<span class="stringliteral">"CZoneSymmetrisation::propagateTileState: tile %d has an unknown tileSet (%d)"</span>, tileIndex, tileSetToPropagate);
00702                         }
00703                         <span class="keywordflow">else</span>
00704                         {
00705                                 <span class="comment">// Oriented ?</span>
00706                                 <span class="keywordtype">bool</span> oriented = bank.getTileSet (tileSetToPropagate)-&gt;getOriented ();
00707 
00708                                 <span class="comment">// If oriented, must not be a corner</span>
00709                                 <span class="keywordflow">if</span> (!(oriented &amp;&amp; <a class="code" href="a03762.html#NL3D_1_1CZoneSymmetrisationa3">getOrientedTileCorner</a> (patch, tile)))
00710                                 {
00711                                         <span class="comment">// Current node</span>
00712                                         CFillStackNode currentNode (patch, s, t, currentPatchPtr-&gt;Tiles[tile].getTileOrient(layer), <a class="code" href="a03762.html#NL3D_1_1CZoneSymmetrisationa5">getTileState</a> (patch, tile, layer));
00713 
00714                                         <span class="comment">// Propagate non-Nothing tiles</span>
00715                                         <span class="keywordflow">if</span> ( (!forceRegular &amp;&amp; (currentNode.State != <a class="code" href="a03762.html#NL3D_1_1CZoneSymmetrisationw3NL3D_1_1CZoneSymmetrisationw1">Nothing</a>)) || (forceRegular &amp;&amp; (currentNode.State == <a class="code" href="a03762.html#NL3D_1_1CZoneSymmetrisationw3NL3D_1_1CZoneSymmetrisationw1">Nothing</a>)) )
00716                                         {
00717                                                 <span class="comment">// Force to Regular ?</span>
00718                                                 <span class="keywordflow">if</span> (forceRegular)
00719                                                 {
00720                                                         <a class="code" href="a03762.html#NL3D_1_1CZoneSymmetrisationd6">setTileState</a> (patch, tile, layer, Regular);
00721                                                         currentNode.State = <a class="code" href="a03762.html#NL3D_1_1CZoneSymmetrisationw3NL3D_1_1CZoneSymmetrisationw2">Regular</a>;
00722                                                 }
00723 
00724                                                 <span class="comment">// Fill stack</span>
00725                                                 vector&lt;CFillStackNode&gt;  stack;
00726                                                 stack.push_back (currentNode);
00727 
00728                                                 <span class="comment">// While people in the stack</span>
00729                                                 <span class="keywordflow">while</span> (!stack.empty ())
00730                                                 {               
00731                                                         <span class="comment">// Pop last element</span>
00732                                                         currentNode = stack.back ();
00733                                                         stack.pop_back ();
00734 
00735                                                         <span class="keywordflow">do</span>
00736                                                         {
00737                                                                 <span class="comment">// Set current patch pointer</span>
00738                                                                 currentPatchPtr = &amp;(patchInfo[currentNode.Patch]);
00739 
00740                                                                 <span class="comment">// Get neighbor</span>
00741                                                                 CFillStackNode neighborNode (currentNode.Patch, currentNode.S, currentNode.T, currentNode.Rotate, currentNode.State);
00742                                                                 <span class="keywordflow">switch</span> (currentNode.Edge)
00743                                                                 {
00744                                                                 <span class="keywordflow">case</span> 0:
00745                                                                         neighborNode.S--;
00746                                                                         <span class="keywordflow">break</span>;
00747                                                                 <span class="keywordflow">case</span> 1:
00748                                                                         neighborNode.T++;
00749                                                                         <span class="keywordflow">break</span>;
00750                                                                 <span class="keywordflow">case</span> 2:
00751                                                                         neighborNode.S++;
00752                                                                         <span class="keywordflow">break</span>;
00753                                                                 <span class="keywordflow">case</span> 3:
00754                                                                         neighborNode.T--;
00755                                                                         <span class="keywordflow">break</span>;
00756                                                                 }
00757 
00758                                                                 <span class="comment">// Is still in patch ?</span>
00759                                                                 <span class="keywordflow">if</span> ( (neighborNode.S&gt;=patchInfo[currentNode.Patch].OrderS) || (neighborNode.T&gt;=patchInfo[currentNode.Patch].OrderT) )
00760                                                                 {
00761                                                                         <span class="comment">// No, found new patch</span>
00762                                                                         <a class="code" href="a04558.html#a15">uint</a> position;
00763                                                                         <span class="keywordflow">switch</span> (currentNode.Edge)
00764                                                                         {
00765                                                                         <span class="keywordflow">case</span> 0:
00766                                                                                 position = neighborNode.T;
00767                                                                                 <span class="keywordflow">break</span>;
00768                                                                         <span class="keywordflow">case</span> 1:
00769                                                                                 position = neighborNode.S;
00770                                                                                 <span class="keywordflow">break</span>;
00771                                                                         <span class="keywordflow">case</span> 2:
00772                                                                                 position = patchInfo[currentNode.Patch].OrderT - neighborNode.T - 1;
00773                                                                                 <span class="keywordflow">break</span>;
00774                                                                         <span class="keywordflow">case</span> 3:
00775                                                                                 position = patchInfo[currentNode.Patch].OrderS - neighborNode.S - 1;
00776                                                                                 <span class="keywordflow">break</span>;
00777                                                                         }
00778 
00779                                                                         <span class="comment">// Get next patch</span>
00780                                                                         <a class="code" href="a04558.html#a15">uint</a> patchOut;
00781                                                                         <a class="code" href="a04558.html#a14">sint</a> sOut;
00782                                                                         <a class="code" href="a04558.html#a14">sint</a> tOut;
00783                                                                         <span class="keywordflow">if</span> (patchInfo[currentNode.Patch].getNeighborTile (currentNode.Patch, currentNode.Edge, position, 
00784                                                                                 patchOut, sOut, tOut, patchInfo))
00785                                                                         {
00786                                                                                 <span class="comment">// Should be another patch</span>
00787                                                                                 <a class="code" href="a04199.html#a6">nlassert</a> (patchOut != currentNode.Patch);
00788 
00789                                                                                 <span class="comment">// Get patch id</span>
00790                                                                                 neighborNode.Patch = patchOut;
00791 
00792                                                                                 <span class="comment">// Coordinate must be IN the patch</span>
00793                                                                                 <a class="code" href="a04199.html#a6">nlassert</a> (sOut &gt;= 0);
00794                                                                                 <a class="code" href="a04199.html#a6">nlassert</a> (tOut &gt;= 0);
00795                                                                                 <a class="code" href="a04199.html#a6">nlassert</a> (sOut &lt; patchInfo[neighborNode.Patch].OrderS);
00796                                                                                 <a class="code" href="a04199.html#a6">nlassert</a> (tOut &lt; patchInfo[neighborNode.Patch].OrderT);
00797 
00798                                                                                 <span class="comment">// Copy it</span>
00799                                                                                 neighborNode.S = sOut;
00800                                                                                 neighborNode.T = tOut;
00801 
00802                                                                                 <span class="comment">// Find neighbor</span>
00803                                                                                 <span class="keyword">const</span> CPatchInfo::CBindInfo &amp;neighborBindInfo = patchInfo[currentNode.Patch].BindEdges[currentNode.Edge];
00804                                                                                 <a class="code" href="a04558.html#a15">uint</a> edgePatch;
00805                                                                                 <span class="keywordflow">for</span> (edgePatch=0; edgePatch&lt;(<a class="code" href="a04558.html#a15">uint</a>)neighborBindInfo.NPatchs; edgePatch++)
00806                                                                                 {
00807                                                                                         <span class="keywordflow">if</span> (neighborBindInfo.Next[edgePatch] == neighborNode.Patch)
00808                                                                                                 <span class="keywordflow">break</span>;
00809                                                                                 }
00810 
00811                                                                                 <span class="comment">// Must find one patch</span>
00812                                                                                 <a class="code" href="a04199.html#a6">nlassert</a> (edgePatch&lt;(<a class="code" href="a04558.html#a15">uint</a>)neighborBindInfo.NPatchs);
00813 
00814                                                                                 <span class="comment">// Rotation</span>
00815                                                                                 neighborNode.Rotate = (currentNode.Rotate + 2 + neighborBindInfo.Edge[edgePatch] - currentNode.Edge) &amp; 3;
00816 
00817                                                                                 <span class="comment">// Toggle the state ?</span>
00818                                                                                 <span class="keywordflow">if</span> ((neighborNode.Rotate ^ currentNode.Rotate) &amp; 1)
00819                                                                                 {
00820                                                                                         <span class="comment">// Yes</span>
00821                                                                                         neighborNode.State = (neighborNode.State == <a class="code" href="a03762.html#NL3D_1_1CZoneSymmetrisationw3NL3D_1_1CZoneSymmetrisationw2">Regular</a>) ? <a class="code" href="a03762.html#NL3D_1_1CZoneSymmetrisationw3NL3D_1_1CZoneSymmetrisationw0">Goofy</a> : <a class="code" href="a03762.html#NL3D_1_1CZoneSymmetrisationw3NL3D_1_1CZoneSymmetrisationw2">Regular</a>;
00822                                                                                 }
00823                                                                         }
00824                                                                         <span class="keywordflow">else</span>
00825                                                                         {
00826                                                                                 <span class="comment">// No propagation, continue</span>
00827                                                                                 currentNode.Edge++;
00828                                                                                 <span class="keywordflow">continue</span>;
00829                                                                         }
00830                                                                 }
00831 
00832                                                                 <span class="comment">// Neighbor patch</span>
00833                                                                 <span class="keyword">const</span> CPatchInfo *neighborPatchPtr = &amp;(patchInfo[neighborNode.Patch]);
00834 
00835                                                                 <span class="comment">// Get the tile index</span>
00836                                                                 <a class="code" href="a04558.html#a15">uint</a> neighborTile = neighborNode.S+neighborNode.T*neighborPatchPtr-&gt;OrderS;
00837                                                                 
00838                                                                 <span class="comment">// Look for the same tile set in the new tile</span>
00839                                                                 <a class="code" href="a04558.html#a15">uint</a> neighborLayer;
00840                                                                 <span class="keywordflow">for</span> (neighborLayer=0; neighborLayer&lt;3; neighborLayer++)
00841                                                                 {
00842                                                                         <span class="comment">// Get the tile index</span>
00843                                                                         <a class="code" href="a04558.html#a15">uint</a> neighborTileIndex = neighborPatchPtr-&gt;Tiles[neighborTile].Tile[neighborLayer];
00844 
00845                                                                         <span class="keywordflow">if</span> (neighborTileIndex != <a class="code" href="a05118.html#a12">NL_TILE_ELM_LAYER_EMPTY</a>)
00846                                                                         {
00847                                                                                 <span class="comment">// Valid tile number ?</span>
00848                                                                                 <span class="keywordflow">if</span> (neighborTileIndex &gt;= (<a class="code" href="a04558.html#a15">uint</a>)bank.getTileCount ())
00849                                                                                 {
00850                                                                                         <a class="code" href="a04199.html#a2">nlwarning</a> (<span class="stringliteral">"CZoneSymmetrisation::propagateTileState: Invalid tile index"</span>);
00851                                                                                         <span class="keywordflow">return</span> <span class="keyword">false</span>;
00852                                                                                 }
00853 
00854                                                                                 <span class="comment">// Get tileset</span>
00855                                                                                 <span class="keywordtype">int</span> neighborTileSet;
00856                                                                                 <span class="keywordtype">int</span> neighborNumber;
00857                                                                                 CTileBank::TTileType neighborType;
00858                                                                                 bank.getTileXRef (neighborTileIndex, neighborTileSet, neighborNumber, neighborType);
00859 
00860                                                                                 <span class="comment">// Same tileset ? Stop!</span>
00861                                                                                 <span class="keywordflow">if</span> (    (neighborTileSet == tileSetToPropagate) &amp;&amp; 
00862                                                                                                 (neighborNode.Rotate == neighborPatchPtr-&gt;Tiles[neighborTile].getTileOrient(neighborLayer)) )
00863                                                                                         <span class="keywordflow">break</span>;
00864                                                                         }
00865                                                                 }
00866 
00867                                                                 <span class="comment">// Found ?</span>
00868                                                                 <span class="keywordflow">if</span> (neighborLayer&lt;3)
00869                                                                 {
00870                                                                         <span class="comment">// If oriented, must not be a corner</span>
00871                                                                         <span class="keywordflow">if</span> (!(oriented &amp;&amp; <a class="code" href="a03762.html#NL3D_1_1CZoneSymmetrisationa3">getOrientedTileCorner</a> (neighborNode.Patch, neighborTile)))
00872                                                                         {
00873                                                                                 <span class="comment">// Propagate in the new node ?</span>
00874                                                                                 <a class="code" href="a03762.html#NL3D_1_1CZoneSymmetrisationw3">TState</a> neighborState = <a class="code" href="a03762.html#NL3D_1_1CZoneSymmetrisationa5">getTileState</a> (neighborNode.Patch, neighborTile, neighborLayer);
00875                                                                                 <span class="keywordflow">if</span> (neighborState == <a class="code" href="a03762.html#NL3D_1_1CZoneSymmetrisationw3NL3D_1_1CZoneSymmetrisationw1">Nothing</a>)
00876                                                                                 {
00877                                                                                         <span class="comment">// Set the state</span>
00878                                                                                         <a class="code" href="a03762.html#NL3D_1_1CZoneSymmetrisationd6">setTileState</a> (neighborNode.Patch, neighborTile, neighborLayer, neighborNode.State);
00879 
00880                                                                                         <span class="comment">// Stack current node if some neighbor left to visit</span>
00881                                                                                         <span class="keywordflow">if</span> (currentNode.Edge &lt; 3)
00882                                                                                         {
00883                                                                                                 currentNode.Edge++;
00884                                                                                                 stack.push_back (currentNode);
00885                                                                                         }
00886 
00887                                                                                         <span class="comment">// Continue with the new node</span>
00888                                                                                         currentNode = neighborNode;
00889                                                                                 }
00890                                                                                 <span class="keywordflow">else</span> <span class="keywordflow">if</span> (neighborState != neighborNode.State)
00891                                                                                 {
00892                                                                                         <span class="comment">// Error, same tile but not same state</span>
00893                                                                                         <span class="comment">// nlwarning ("CZoneSymmetrisation::propagateTileState: error, find same iso surfaces with different state.");</span>
00894 
00895                                                                                         <span class="comment">// No propagation, continue</span>
00896                                                                                         currentNode.Edge++;
00897                                                                                 }
00898                                                                                 <span class="keywordflow">else</span>
00899                                                                                 {
00900                                                                                         <span class="comment">// No propagation, continue</span>
00901                                                                                         currentNode.Edge++;
00902                                                                                 }
00903                                                                         }
00904                                                                         <span class="keywordflow">else</span>
00905                                                                         {
00906                                                                                 <span class="comment">// No propagation, continue</span>
00907                                                                                 currentNode.Edge++;
00908                                                                         }
00909                                                                 }
00910                                                                 <span class="keywordflow">else</span>
00911                                                                         <span class="comment">// No propagation, continue</span>
00912                                                                         currentNode.Edge++;
00913                                                         }
00914                                                         <span class="keywordflow">while</span> (currentNode.Edge&lt;4);
00915                                                 }
00916                                         }
00917                                 }
00918                         }
00919                 }
00920         }
00921 
00922         <span class="keywordflow">return</span> <span class="keyword">true</span>;
00923 }
</pre></div>    </td>
  </tr>
</table>
<a class="anchor" name="NL3D_1_1CZoneSymmetrisationd1" doxytag="NL3D::CZoneSymmetrisation::setOrientedTileBorderState" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> void NL3D::CZoneSymmetrisation::setOrientedTileBorderState </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top"><a class="el" href="a04558.html#a15">uint</a>&nbsp;</td>
          <td class="mdname" nowrap> <em>patch</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td></td>
          <td class="md" nowrap><a class="el" href="a04558.html#a15">uint</a>&nbsp;</td>
          <td class="mdname" nowrap> <em>tile</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td></td>
          <td class="md" nowrap><a class="el" href="a03762.html#NL3D_1_1CZoneSymmetrisationw3">TState</a>&nbsp;</td>
          <td class="mdname" nowrap> <em>state</em></td>
        </tr>
        <tr>
          <td></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"><code> [private]</code></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Set border oriented tile symmetry state
<p>
Definition at line <a class="el" href="a06778.html#l00102">102</a> of file <a class="el" href="a06778.html">zone_symmetrisation.cpp</a>.
<p>
References <a class="el" href="a06778.html#l00086">setTileState()</a>, and <a class="el" href="a05981.html#l00105">uint</a>.
<p>
Referenced by <a class="el" href="a06778.html#l00472">setOrientedTileState()</a>.
<p>
<div class="fragment"><pre>00103 {
00104         <a class="code" href="a03762.html#NL3D_1_1CZoneSymmetrisationd6">setTileState</a> (patch, tile, 4, state);
00105 }
</pre></div>    </td>
  </tr>
</table>
<a class="anchor" name="NL3D_1_1CZoneSymmetrisationd2" doxytag="NL3D::CZoneSymmetrisation::setOrientedTileCorner" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> void NL3D::CZoneSymmetrisation::setOrientedTileCorner </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top"><a class="el" href="a04558.html#a15">uint</a>&nbsp;</td>
          <td class="mdname" nowrap> <em>patch</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td></td>
          <td class="md" nowrap><a class="el" href="a04558.html#a15">uint</a>&nbsp;</td>
          <td class="mdname" nowrap> <em>tile</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td></td>
          <td class="md" nowrap>bool&nbsp;</td>
          <td class="mdname" nowrap> <em>corner</em></td>
        </tr>
        <tr>
          <td></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"><code> [private]</code></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Set oriented tile corner state
<p>
Definition at line <a class="el" href="a06778.html#l00109">109</a> of file <a class="el" href="a06778.html">zone_symmetrisation.cpp</a>.
<p>
References <a class="el" href="a06779.html#l00158">_TilesLayerStates</a>, <a class="el" href="a05981.html#l00105">uint</a>, and <a class="el" href="a05981.html#l00098">uint16</a>.
<p>
Referenced by <a class="el" href="a06778.html#l00472">setOrientedTileState()</a>.
<p>
<div class="fragment"><pre>00110 {
00111         <a class="code" href="a04558.html#a9">uint16</a> &amp;ref = <a class="code" href="a03762.html#NL3D_1_1CZoneSymmetrisationr0">_TilesLayerStates</a>[patch][tile];
00112         ref &amp;= ~(1&lt;&lt;10);
00113         ref |= ((<a class="code" href="a04558.html#a9">uint16</a>)corner)&lt;&lt;(10);
00114 }
</pre></div>    </td>
  </tr>
</table>
<a class="anchor" name="NL3D_1_1CZoneSymmetrisationd3" doxytag="NL3D::CZoneSymmetrisation::setOrientedTileState" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> bool NL3D::CZoneSymmetrisation::setOrientedTileState </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">const <a class="el" href="a03066.html">NL3D::CPatchInfo</a> &amp;&nbsp;</td>
          <td class="mdname" nowrap> <em>patch</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td></td>
          <td class="md" nowrap><a class="el" href="a04558.html#a15">uint</a>&nbsp;</td>
          <td class="mdname" nowrap> <em>patchId</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td></td>
          <td class="md" nowrap>float&nbsp;</td>
          <td class="mdname" nowrap> <em>snapCell</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td></td>
          <td class="md" nowrap>float&nbsp;</td>
          <td class="mdname" nowrap> <em>weldThreshold</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td></td>
          <td class="md" nowrap><a class="el" href="a03762.html#NL3D_1_1CZoneSymmetrisationw3">TState</a> &amp;&nbsp;</td>
          <td class="mdname" nowrap> <em>state</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td></td>
          <td class="md" nowrap>const <a class="el" href="a02851.html">NLMISC::CMatrix</a> &amp;&nbsp;</td>
          <td class="mdname" nowrap> <em>toOriginalSpace</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td></td>
          <td class="md" nowrap>const <a class="el" href="a03517.html">CTileBank</a> &amp;&nbsp;</td>
          <td class="mdname" nowrap> <em>bank</em></td>
        </tr>
        <tr>
          <td></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"><code> [private]</code></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>

<p>
Definition at line <a class="el" href="a06778.html#l00472">472</a> of file <a class="el" href="a06778.html">zone_symmetrisation.cpp</a>.
<p>
References <a class="el" href="a06537.html#l00333">NL3D::CTileSet::getOriented()</a>, <a class="el" href="a06537.html#l00520">NL3D::CTileBank::getTileSet()</a>, <a class="el" href="a06537.html#l00516">NL3D::CTileBank::getTileSetCount()</a>, <a class="el" href="a06537.html#l00560">NL3D::CTileBank::getTileXRef()</a>, <a class="el" href="a03762.html#NL3D_1_1CZoneSymmetrisationw3NL3D_1_1CZoneSymmetrisationw0">Goofy</a>, <a class="el" href="a06541.html#l00053">NL_TILE_ELM_LAYER_EMPTY</a>, <a class="el" href="a05622.html#l00135">nlwarning</a>, <a class="el" href="a03762.html#NL3D_1_1CZoneSymmetrisationw3NL3D_1_1CZoneSymmetrisationw1">Nothing</a>, <a class="el" href="a06760.html#l00122">NL3D::CPatchInfo::OrderS</a>, <a class="el" href="a06760.html#l00122">NL3D::CPatchInfo::OrderT</a>, <a class="el" href="a06760.html#l00120">NL3D::CPatchInfo::Patch</a>, <a class="el" href="a03762.html#NL3D_1_1CZoneSymmetrisationw3NL3D_1_1CZoneSymmetrisationw2">Regular</a>, <a class="el" href="a06778.html#l00102">setOrientedTileBorderState()</a>, <a class="el" href="a06778.html#l00109">setOrientedTileCorner()</a>, <a class="el" href="a06778.html#l00086">setTileState()</a>, <a class="el" href="a05981.html#l00104">sint</a>, <a class="el" href="a05981.html#l00099">sint32</a>, <a class="el" href="a06778.html#l00280">snapOnGrid()</a>, <a class="el" href="a06760.html#l00149">NL3D::CPatchInfo::Tiles</a>, <a class="el" href="a05646.html#l00244">type</a>, <a class="el" href="a05981.html#l00105">uint</a>, <a class="el" href="a05479.html#l00077">NL3D::CBezierPatch::Vertices</a>, <a class="el" href="a06673.html#l00051">NLMISC::CVector::x</a>, and <a class="el" href="a06673.html#l00051">NLMISC::CVector::y</a>.
<p>
Referenced by <a class="el" href="a06778.html#l00186">build()</a>.
<p>
<div class="fragment"><pre>00473 {
00474         <span class="comment">// Edges state</span>
00475         <a class="code" href="a03762.html#NL3D_1_1CZoneSymmetrisationw3">TState</a> edgesState[4] = { <a class="code" href="a03762.html#NL3D_1_1CZoneSymmetrisationw3NL3D_1_1CZoneSymmetrisationw1">Nothing</a>, <a class="code" href="a03762.html#NL3D_1_1CZoneSymmetrisationw3NL3D_1_1CZoneSymmetrisationw1">Nothing</a>, Nothing, Nothing };
00476 
00477         <span class="comment">// Vertices position</span>
00478         <a class="code" href="a04558.html#a10">sint32</a> vertPosU[4];
00479         <a class="code" href="a04558.html#a10">sint32</a> vertPosV[4];
00480         
00481         <span class="comment">// For each vertices</span>
00482         <a class="code" href="a04558.html#a15">uint</a> i;
00483         <span class="keywordflow">for</span> (i=0; i&lt;4; i++)
00484         {
00485                 <span class="comment">// Snap the vertex</span>
00486                 CVector original = toOriginalSpace * patch.<a class="code" href="a03066.html#NL3D_1_1CPatchInfoz1194_8">Patch</a>.Vertices[i];
00487                 <span class="keywordtype">float</span> valueU = original.x;
00488                 <span class="keywordtype">float</span> valueV = original.y;
00489 
00490                 <span class="comment">// Snap on U</span>
00491                 <span class="keywordflow">if</span> (<a class="code" href="a03762.html#NL3D_1_1CZoneSymmetrisationh0">snapOnGrid</a> (valueU, snapCell, weldThreshold))
00492                         vertPosU[i] = (<a class="code" href="a04558.html#a10">sint32</a>)((valueU+0.5f) / snapCell);
00493                 <span class="keywordflow">else</span>
00494                         vertPosU[i] = 0x80000000;
00495 
00496                 <span class="comment">// Snap on V</span>
00497                 <span class="keywordflow">if</span> (<a class="code" href="a03762.html#NL3D_1_1CZoneSymmetrisationh0">snapOnGrid</a> (valueV, snapCell, weldThreshold))
00498                         vertPosV[i] = (<a class="code" href="a04558.html#a10">sint32</a>)((valueV+0.5f) / snapCell);
00499                 <span class="keywordflow">else</span>
00500                         vertPosV[i] = 0x80000000;
00501         }
00502 
00503         <span class="comment">// Patch flags</span>
00504         <span class="keywordtype">bool</span> regular = <span class="keyword">false</span>;
00505         <span class="keywordtype">bool</span> goofy = <span class="keyword">false</span>;
00506         <span class="keywordtype">bool</span> EdgeSnaped[4] = { <span class="keyword">false</span>, <span class="keyword">false</span>, <span class="keyword">false</span>, <span class="keyword">false</span> };
00507 
00508         <span class="comment">// For each edges</span>
00509         <span class="keywordflow">for</span> (i=0; i&lt;4; i++)
00510         {
00511                 <span class="comment">// Vertex snapped and align on a common axis ?</span>
00512                 <span class="keywordflow">if</span> ( (vertPosU[i] != 0x80000000) || (vertPosV[i] != 0x80000000) )
00513                 {
00514                         <span class="comment">// Snapped on U or V ?</span>
00515                         <span class="keywordtype">bool</span> snapU = (vertPosU[i] == vertPosU[(i+1)&amp;3]) &amp;&amp; (vertPosU[i] != 0x80000000);
00516                         <span class="keywordtype">bool</span> snapV = (vertPosV[i] == vertPosV[(i+1)&amp;3]) &amp;&amp; (vertPosV[i] != 0x80000000);
00517                         
00518                         <span class="comment">// If snapped on one, continue</span>
00519                         <span class="keywordflow">if</span> (snapU || snapV)
00520                         {
00521                                 <span class="comment">// If snap on the both, error</span>
00522                                 <span class="keywordflow">if</span> (snapU &amp;&amp; snapV)
00523                                         <span class="keywordflow">return</span> <span class="keyword">false</span>;
00524 
00525                                 <span class="comment">// Is this edge Regular or Goofy ?</span>
00526                                 edgesState[i] = (i&amp;1)?<a class="code" href="a03762.html#NL3D_1_1CZoneSymmetrisationw3NL3D_1_1CZoneSymmetrisationw0">Goofy</a>:<a class="code" href="a03762.html#NL3D_1_1CZoneSymmetrisationw3NL3D_1_1CZoneSymmetrisationw2">Regular</a>;
00527 
00528                                 <span class="comment">// Flag the patch</span>
00529                                 <span class="keywordflow">if</span> (edgesState[i] == <a class="code" href="a03762.html#NL3D_1_1CZoneSymmetrisationw3NL3D_1_1CZoneSymmetrisationw2">Regular</a>)
00530                                         regular = <span class="keyword">true</span>;
00531                                 <span class="keywordflow">else</span>
00532                                         goofy = <span class="keyword">true</span>;
00533 
00534                                 <span class="comment">// Edge snaped</span>
00535                                 EdgeSnaped[i] = <span class="keyword">true</span>;
00536                         }
00537                 }
00538         }
00539 
00540         <span class="comment">// * Set the tiles</span>
00541 
00542         <span class="comment">// For each edges</span>
00543         <span class="keywordflow">for</span> (i=0; i&lt;4; i++)
00544         {
00545                 <span class="comment">// Edge snapped ?</span>
00546                 <span class="keywordflow">if</span> (EdgeSnaped[i])
00547                 {
00548                         <span class="comment">// For each tiles</span>
00549                         <a class="code" href="a04558.html#a15">uint</a> tileCount = ((i&amp;1)!=0)?patch.<a class="code" href="a03066.html#NL3D_1_1CPatchInfoz1194_6">OrderS</a>:patch.<a class="code" href="a03066.html#NL3D_1_1CPatchInfoz1194_7">OrderT</a>;
00550                         <a class="code" href="a04558.html#a14">sint</a> currentTile;
00551                         <a class="code" href="a04558.html#a14">sint</a> delta;
00552                         <span class="keywordflow">switch</span> (i)
00553                         {
00554                         <span class="keywordflow">case</span> 0:
00555                                 currentTile = 0;
00556                                 delta = patch.<a class="code" href="a03066.html#NL3D_1_1CPatchInfoz1194_6">OrderS</a>;
00557                                 <span class="keywordflow">break</span>;
00558                         <span class="keywordflow">case</span> 1:
00559                                 currentTile = patch.<a class="code" href="a03066.html#NL3D_1_1CPatchInfoz1194_6">OrderS</a>*(patch.<a class="code" href="a03066.html#NL3D_1_1CPatchInfoz1194_7">OrderT</a>-1);
00560                                 delta = 1;
00561                                 <span class="keywordflow">break</span>;
00562                         <span class="keywordflow">case</span> 2:
00563                                 currentTile = patch.<a class="code" href="a03066.html#NL3D_1_1CPatchInfoz1194_6">OrderS</a>-1;
00564                                 delta = patch.<a class="code" href="a03066.html#NL3D_1_1CPatchInfoz1194_6">OrderS</a>;
00565                                 <span class="keywordflow">break</span>;
00566                         <span class="keywordflow">case</span> 3:
00567                                 currentTile = 0;
00568                                 delta = 1;
00569                                 <span class="keywordflow">break</span>;
00570                         }
00571                         <a class="code" href="a04558.html#a15">uint</a> j;
00572                         <span class="keywordflow">for</span> (j=0; j&lt;tileCount; j++)
00573                         {
00574                                 <span class="comment">// Set the border state</span>
00575                                 <a class="code" href="a03762.html#NL3D_1_1CZoneSymmetrisationd1">setOrientedTileBorderState</a> (patchId, currentTile, edgesState[i]);
00576 
00577                                 <span class="comment">// For each layer</span>
00578                                 <a class="code" href="a04558.html#a15">uint</a> layer;
00579                                 <span class="keywordflow">for</span> (layer=0; layer&lt;3; layer++)
00580                                 {
00581                                         <span class="comment">// Get the tiles set used here</span>
00582                                         <a class="code" href="a04558.html#a15">uint</a> tile = patch.<a class="code" href="a03066.html#NL3D_1_1CPatchInfoz1196_3">Tiles</a>[currentTile].Tile[layer];
00583                                         <span class="keywordflow">if</span> (tile != <a class="code" href="a05118.html#a12">NL_TILE_ELM_LAYER_EMPTY</a>)
00584                                         {
00585                                                 <span class="keywordtype">int</span> tileSet;
00586                                                 <span class="keywordtype">int</span> number;
00587                                                 CTileBank::TTileType <a class="code" href="a04223.html#a581">type</a>;
00588 
00589                                                 bank.getTileXRef (tile, tileSet, number, type);
00590                                                 <span class="keywordflow">if</span> ((tileSet &lt; 0) || (tileSet &gt;= bank.getTileSetCount()))
00591                                                 {
00592                                                         <a class="code" href="a04199.html#a2">nlwarning</a>(<span class="stringliteral">"CZoneSymmetrisation::setOrientedTileState : tile %d has an unknown tileSet (%d)"</span>, tile, tileSet);
00593                                                         <span class="keywordflow">return</span> <span class="keyword">false</span>;
00594                                                 }
00595 
00596                                                 <span class="comment">// Set it only if oriented</span>
00597                                                 <span class="keywordflow">if</span> (bank.getTileSet (tileSet)-&gt;getOriented ())
00598                                                 {
00599                                                         <a class="code" href="a03762.html#NL3D_1_1CZoneSymmetrisationd6">setTileState</a> (patchId, currentTile, layer, edgesState[i]);
00600                                                 }
00601                                         }
00602                                 }
00603 
00604                                 <span class="comment">// Next tile</span>
00605                                 currentTile += delta;
00606                         }
00607                 }
00608         }
00609         
00610         <span class="comment">// For each corners</span>
00611         <span class="keywordflow">for</span> (i=0; i&lt;4; i++)
00612         {
00613                 <span class="comment">// Corner snapped ?</span>
00614                 <a class="code" href="a04558.html#a15">uint</a> next = (i+1)&amp;3;
00615                 <span class="keywordflow">if</span> (EdgeSnaped[i] &amp;&amp; EdgeSnaped[next])
00616                 {
00617                         <span class="comment">// Flag tile as corner</span>
00618                         <span class="keywordflow">switch</span> (i)
00619                         {
00620                         <span class="keywordflow">case</span> 0:
00621                                 <a class="code" href="a03762.html#NL3D_1_1CZoneSymmetrisationd2">setOrientedTileCorner</a> (patchId, patch.<a class="code" href="a03066.html#NL3D_1_1CPatchInfoz1194_6">OrderS</a>*(patch.<a class="code" href="a03066.html#NL3D_1_1CPatchInfoz1194_7">OrderT</a>-1), <span class="keyword">true</span>);
00622                                 <span class="keywordflow">break</span>;
00623                         <span class="keywordflow">case</span> 1:
00624                                 <a class="code" href="a03762.html#NL3D_1_1CZoneSymmetrisationd2">setOrientedTileCorner</a> (patchId, patch.<a class="code" href="a03066.html#NL3D_1_1CPatchInfoz1194_6">OrderS</a>*patch.<a class="code" href="a03066.html#NL3D_1_1CPatchInfoz1194_7">OrderT</a>-1, <span class="keyword">true</span>);
00625                                 <span class="keywordflow">break</span>;
00626                         <span class="keywordflow">case</span> 2:
00627                                 <a class="code" href="a03762.html#NL3D_1_1CZoneSymmetrisationd2">setOrientedTileCorner</a> (patchId, patch.<a class="code" href="a03066.html#NL3D_1_1CPatchInfoz1194_6">OrderS</a>-1, <span class="keyword">true</span>);
00628                                 <span class="keywordflow">break</span>;
00629                         <span class="keywordflow">case</span> 3:
00630                                 <a class="code" href="a03762.html#NL3D_1_1CZoneSymmetrisationd2">setOrientedTileCorner</a> (patchId, 0, <span class="keyword">true</span>);
00631                                 <span class="keywordflow">break</span>;
00632                         }
00633                 }
00634         }
00635         
00636         <span class="keywordflow">return</span> <span class="keyword">true</span>;
00637 }
</pre></div>    </td>
  </tr>
</table>
<a class="anchor" name="NL3D_1_1CZoneSymmetrisationd4" doxytag="NL3D::CZoneSymmetrisation::setTileBorderState" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> void NL3D::CZoneSymmetrisation::setTileBorderState </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top"><a class="el" href="a04558.html#a15">uint</a>&nbsp;</td>
          <td class="mdname" nowrap> <em>patch</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td></td>
          <td class="md" nowrap><a class="el" href="a04558.html#a15">uint</a>&nbsp;</td>
          <td class="mdname" nowrap> <em>tile</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td></td>
          <td class="md" nowrap><a class="el" href="a03762.html#NL3D_1_1CZoneSymmetrisationw3">TState</a>&nbsp;</td>
          <td class="mdname" nowrap> <em>state</em></td>
        </tr>
        <tr>
          <td></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"><code> [private]</code></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Set border tile symmetry state
<p>
Definition at line <a class="el" href="a06778.html#l00095">95</a> of file <a class="el" href="a06778.html">zone_symmetrisation.cpp</a>.
<p>
References <a class="el" href="a06778.html#l00086">setTileState()</a>, and <a class="el" href="a05981.html#l00105">uint</a>.
<p>
Referenced by <a class="el" href="a06778.html#l00312">setTileState()</a>.
<p>
<div class="fragment"><pre>00096 {
00097         <a class="code" href="a03762.html#NL3D_1_1CZoneSymmetrisationd6">setTileState</a> (patch, tile, 3, state);
00098 }
</pre></div>    </td>
  </tr>
</table>
<a class="anchor" name="NL3D_1_1CZoneSymmetrisationd5" doxytag="NL3D::CZoneSymmetrisation::setTileState" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> bool NL3D::CZoneSymmetrisation::setTileState </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">const <a class="el" href="a03066.html">NL3D::CPatchInfo</a> &amp;&nbsp;</td>
          <td class="mdname" nowrap> <em>patch</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td></td>
          <td class="md" nowrap><a class="el" href="a04558.html#a15">uint</a>&nbsp;</td>
          <td class="mdname" nowrap> <em>patchId</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td></td>
          <td class="md" nowrap>float&nbsp;</td>
          <td class="mdname" nowrap> <em>snapCell</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td></td>
          <td class="md" nowrap>float&nbsp;</td>
          <td class="mdname" nowrap> <em>weldThreshold</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td></td>
          <td class="md" nowrap><a class="el" href="a03762.html#NL3D_1_1CZoneSymmetrisationw3">TState</a> &amp;&nbsp;</td>
          <td class="mdname" nowrap> <em>state</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td></td>
          <td class="md" nowrap>const <a class="el" href="a02851.html">NLMISC::CMatrix</a> &amp;&nbsp;</td>
          <td class="mdname" nowrap> <em>toOriginalSpace</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td></td>
          <td class="md" nowrap>const <a class="el" href="a03517.html">CTileBank</a> &amp;&nbsp;</td>
          <td class="mdname" nowrap> <em>bank</em></td>
        </tr>
        <tr>
          <td></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"><code> [private]</code></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Set tile state of a patch
<p>
Definition at line <a class="el" href="a06778.html#l00312">312</a> of file <a class="el" href="a06778.html">zone_symmetrisation.cpp</a>.
<p>
References <a class="el" href="a06537.html#l00333">NL3D::CTileSet::getOriented()</a>, <a class="el" href="a06537.html#l00520">NL3D::CTileBank::getTileSet()</a>, <a class="el" href="a06537.html#l00516">NL3D::CTileBank::getTileSetCount()</a>, <a class="el" href="a06537.html#l00560">NL3D::CTileBank::getTileXRef()</a>, <a class="el" href="a03762.html#NL3D_1_1CZoneSymmetrisationw3NL3D_1_1CZoneSymmetrisationw0">Goofy</a>, <a class="el" href="a06541.html#l00053">NL_TILE_ELM_LAYER_EMPTY</a>, <a class="el" href="a05622.html#l00135">nlwarning</a>, <a class="el" href="a03762.html#NL3D_1_1CZoneSymmetrisationw3NL3D_1_1CZoneSymmetrisationw1">Nothing</a>, <a class="el" href="a06760.html#l00122">NL3D::CPatchInfo::OrderS</a>, <a class="el" href="a06760.html#l00122">NL3D::CPatchInfo::OrderT</a>, <a class="el" href="a06760.html#l00120">NL3D::CPatchInfo::Patch</a>, <a class="el" href="a03762.html#NL3D_1_1CZoneSymmetrisationw3NL3D_1_1CZoneSymmetrisationw2">Regular</a>, <a class="el" href="a06778.html#l00095">setTileBorderState()</a>, <a class="el" href="a06778.html#l00086">setTileState()</a>, <a class="el" href="a05981.html#l00104">sint</a>, <a class="el" href="a05981.html#l00099">sint32</a>, <a class="el" href="a06778.html#l00280">snapOnGrid()</a>, <a class="el" href="a06760.html#l00149">NL3D::CPatchInfo::Tiles</a>, <a class="el" href="a05646.html#l00244">type</a>, <a class="el" href="a05981.html#l00105">uint</a>, <a class="el" href="a05479.html#l00077">NL3D::CBezierPatch::Vertices</a>, <a class="el" href="a06673.html#l00051">NLMISC::CVector::x</a>, and <a class="el" href="a06673.html#l00051">NLMISC::CVector::y</a>.
<p>
<div class="fragment"><pre>00313 {
00314         <span class="comment">// Edges state</span>
00315         <a class="code" href="a03762.html#NL3D_1_1CZoneSymmetrisationw3">TState</a> edgesState[4] = { <a class="code" href="a03762.html#NL3D_1_1CZoneSymmetrisationw3NL3D_1_1CZoneSymmetrisationw1">Nothing</a>, <a class="code" href="a03762.html#NL3D_1_1CZoneSymmetrisationw3NL3D_1_1CZoneSymmetrisationw1">Nothing</a>, Nothing, Nothing };
00316 
00317         <span class="comment">// Vertices position</span>
00318         <a class="code" href="a04558.html#a10">sint32</a> vertPosU[4];
00319         <a class="code" href="a04558.html#a10">sint32</a> vertPosV[4];
00320         
00321         <span class="comment">// For each vertices</span>
00322         <a class="code" href="a04558.html#a15">uint</a> i;
00323         <span class="keywordflow">for</span> (i=0; i&lt;4; i++)
00324         {
00325                 <span class="comment">// Snap the vertex</span>
00326                 CVector original = toOriginalSpace * patch.<a class="code" href="a03066.html#NL3D_1_1CPatchInfoz1194_8">Patch</a>.Vertices[i];
00327                 <span class="keywordtype">float</span> valueU = original.x;
00328                 <span class="keywordtype">float</span> valueV = original.y;
00329 
00330                 <span class="comment">// Snap on U</span>
00331                 <span class="keywordflow">if</span> (<a class="code" href="a03762.html#NL3D_1_1CZoneSymmetrisationh0">snapOnGrid</a> (valueU, snapCell, weldThreshold))
00332                         vertPosU[i] = (<a class="code" href="a04558.html#a10">sint32</a>)((valueU+0.5f) / snapCell);
00333                 <span class="keywordflow">else</span>
00334                         vertPosU[i] = 0x80000000;
00335 
00336                 <span class="comment">// Snap on V</span>
00337                 <span class="keywordflow">if</span> (<a class="code" href="a03762.html#NL3D_1_1CZoneSymmetrisationh0">snapOnGrid</a> (valueV, snapCell, weldThreshold))
00338                         vertPosV[i] = (<a class="code" href="a04558.html#a10">sint32</a>)((valueV+0.5f) / snapCell);
00339                 <span class="keywordflow">else</span>
00340                         vertPosV[i] = 0x80000000;
00341         }
00342 
00343         <span class="comment">// Patch flags</span>
00344         <span class="keywordtype">bool</span> regular = <span class="keyword">false</span>;
00345         <span class="keywordtype">bool</span> goofy = <span class="keyword">false</span>;
00346         <span class="keywordtype">bool</span> EdgeSnaped[4] = { <span class="keyword">false</span>, <span class="keyword">false</span>, <span class="keyword">false</span>, <span class="keyword">false</span> };
00347 
00348         <span class="comment">// For each edges</span>
00349         <span class="keywordflow">for</span> (i=0; i&lt;4; i++)
00350         {
00351                 <span class="comment">// Vertex snapped and align on a common axis ?</span>
00352                 <span class="keywordflow">if</span> ( (vertPosU[i] != 0x80000000) || (vertPosV[i] != 0x80000000) )
00353                 {
00354                         <span class="comment">// Snapped on U or V ?</span>
00355                         <span class="keywordtype">bool</span> snapU = (vertPosU[i] == vertPosU[(i+1)&amp;3]) &amp;&amp; (vertPosU[i] != 0x80000000);
00356                         <span class="keywordtype">bool</span> snapV = (vertPosV[i] == vertPosV[(i+1)&amp;3]) &amp;&amp; (vertPosV[i] != 0x80000000);
00357                         
00358                         <span class="comment">// If snapped on one, continue</span>
00359                         <span class="keywordflow">if</span> (snapU || snapV)
00360                         {
00361                                 <span class="comment">// If snap on the both, error</span>
00362                                 <span class="keywordflow">if</span> (snapU &amp;&amp; snapV)
00363                                         <span class="keywordflow">return</span> <span class="keyword">false</span>;
00364 
00365                                 <span class="comment">// Is this edge Regular or Goofy ?</span>
00366                                 <span class="keywordflow">if</span> (snapU)
00367                                         edgesState[i] = (i&amp;1)?<a class="code" href="a03762.html#NL3D_1_1CZoneSymmetrisationw3NL3D_1_1CZoneSymmetrisationw0">Goofy</a>:<a class="code" href="a03762.html#NL3D_1_1CZoneSymmetrisationw3NL3D_1_1CZoneSymmetrisationw2">Regular</a>;
00368                                 <span class="keywordflow">else</span> <span class="comment">// (snapV)</span>
00369                                         edgesState[i] = (i&amp;1)?<a class="code" href="a03762.html#NL3D_1_1CZoneSymmetrisationw3NL3D_1_1CZoneSymmetrisationw2">Regular</a>:<a class="code" href="a03762.html#NL3D_1_1CZoneSymmetrisationw3NL3D_1_1CZoneSymmetrisationw0">Goofy</a>;
00370 
00371                                 <span class="comment">// Flag the patch</span>
00372                                 <span class="keywordflow">if</span> (edgesState[i] == <a class="code" href="a03762.html#NL3D_1_1CZoneSymmetrisationw3NL3D_1_1CZoneSymmetrisationw2">Regular</a>)
00373                                         regular = <span class="keyword">true</span>;
00374                                 <span class="keywordflow">else</span>
00375                                         goofy = <span class="keyword">true</span>;
00376 
00377                                 <span class="comment">// Edge snaped</span>
00378                                 EdgeSnaped[i] = <span class="keyword">true</span>;
00379                         }
00380                 }
00381         }
00382 
00383         <span class="comment">// Goofy and regular ? Error</span>
00384         <span class="keywordflow">if</span> (goofy &amp;&amp; regular)
00385                 <span class="keywordflow">return</span> <span class="keyword">false</span>;
00386 
00387         <span class="comment">// Nothing ?</span>
00388         <span class="keywordflow">if</span> ((!goofy) &amp;&amp; (!regular))
00389                 state = Nothing;
00390         <span class="keywordflow">else</span>
00391         {
00392                 <span class="comment">// Not nothing ?</span>
00393                 state = regular?<a class="code" href="a03762.html#NL3D_1_1CZoneSymmetrisationw3NL3D_1_1CZoneSymmetrisationw2">Regular</a>:<a class="code" href="a03762.html#NL3D_1_1CZoneSymmetrisationw3NL3D_1_1CZoneSymmetrisationw0">Goofy</a>;
00394 
00395                 <span class="comment">// * Set the tiles</span>
00396 
00397                 <span class="comment">// For each edges</span>
00398                 <span class="keywordflow">for</span> (i=0; i&lt;4; i++)
00399                 {
00400                         <span class="comment">// Edge snapped ?</span>
00401                         <span class="keywordflow">if</span> (EdgeSnaped[i])
00402                         {
00403                                 <span class="comment">// For each tiles</span>
00404                                 <a class="code" href="a04558.html#a15">uint</a> tileCount = ((i&amp;1)!=0)?patch.<a class="code" href="a03066.html#NL3D_1_1CPatchInfoz1194_6">OrderS</a>:patch.<a class="code" href="a03066.html#NL3D_1_1CPatchInfoz1194_7">OrderT</a>;
00405                                 <a class="code" href="a04558.html#a14">sint</a> currentTile;
00406                                 <a class="code" href="a04558.html#a14">sint</a> delta;
00407                                 <span class="keywordflow">switch</span> (i)
00408                                 {
00409                                 <span class="keywordflow">case</span> 0:
00410                                         currentTile = 0;
00411                                         delta = patch.<a class="code" href="a03066.html#NL3D_1_1CPatchInfoz1194_6">OrderS</a>;
00412                                         <span class="keywordflow">break</span>;
00413                                 <span class="keywordflow">case</span> 1:
00414                                         currentTile = patch.<a class="code" href="a03066.html#NL3D_1_1CPatchInfoz1194_6">OrderS</a>*(patch.<a class="code" href="a03066.html#NL3D_1_1CPatchInfoz1194_7">OrderT</a>-1);
00415                                         delta = 1;
00416                                         <span class="keywordflow">break</span>;
00417                                 <span class="keywordflow">case</span> 2:
00418                                         currentTile = patch.<a class="code" href="a03066.html#NL3D_1_1CPatchInfoz1194_6">OrderS</a>-1;
00419                                         delta = patch.<a class="code" href="a03066.html#NL3D_1_1CPatchInfoz1194_6">OrderS</a>;
00420                                         <span class="keywordflow">break</span>;
00421                                 <span class="keywordflow">case</span> 3:
00422                                         currentTile = 0;
00423                                         delta = 1;
00424                                         <span class="keywordflow">break</span>;
00425                                 }
00426                                 <a class="code" href="a04558.html#a15">uint</a> j;
00427                                 <span class="keywordflow">for</span> (j=0; j&lt;tileCount; j++)
00428                                 {
00429                                         <span class="comment">// Set the border state</span>
00430                                         <a class="code" href="a03762.html#NL3D_1_1CZoneSymmetrisationd4">setTileBorderState</a> (patchId, currentTile, state);
00431 
00432                                         <span class="comment">// For each layer</span>
00433                                         <a class="code" href="a04558.html#a15">uint</a> layer;
00434                                         <span class="keywordflow">for</span> (layer=0; layer&lt;3; layer++)
00435                                         {
00436                                                 <span class="comment">// Get the tiles set used here</span>
00437                                                 <a class="code" href="a04558.html#a15">uint</a> tile = patch.<a class="code" href="a03066.html#NL3D_1_1CPatchInfoz1196_3">Tiles</a>[currentTile].Tile[layer];
00438                                                 <span class="keywordflow">if</span> (tile != <a class="code" href="a05118.html#a12">NL_TILE_ELM_LAYER_EMPTY</a>)
00439                                                 {
00440                                                         <span class="keywordtype">int</span> tileSet;
00441                                                         <span class="keywordtype">int</span> number;
00442                                                         CTileBank::TTileType <a class="code" href="a04223.html#a581">type</a>;
00443                                                         bank.getTileXRef (tile, tileSet, number, type);
00444 
00445                                                         <span class="keywordflow">if</span> ((tileSet &lt; 0) || (tileSet &gt;= bank.getTileSetCount()))
00446                                                         {
00447                                                                 <a class="code" href="a04199.html#a2">nlwarning</a>(<span class="stringliteral">"CZoneSymmetrisation::setTileState : tile %d has an unknown tileSet (%d)"</span>, tile, tileSet);
00448                                                                 <span class="keywordflow">return</span> <span class="keyword">false</span>;
00449                                                         }
00450 
00451                                                         <span class="comment">// Set it only if not oriented</span>
00452                                                         <span class="keywordflow">if</span> (!bank.getTileSet (tileSet)-&gt;getOriented ())
00453                                                         {
00454                                                                 <span class="comment">// Set the tile state</span>
00455                                                                 <a class="code" href="a03762.html#NL3D_1_1CZoneSymmetrisationd6">setTileState</a> (patchId, currentTile, layer, state);
00456                                                         }
00457                                                 }
00458                                         }
00459 
00460                                         <span class="comment">// Next tile</span>
00461                                         currentTile += delta;
00462                                 }
00463                         }
00464                 }
00465         }
00466 
00467         <span class="keywordflow">return</span> <span class="keyword">true</span>;
00468 }
</pre></div>    </td>
  </tr>
</table>
<a class="anchor" name="NL3D_1_1CZoneSymmetrisationd6" doxytag="NL3D::CZoneSymmetrisation::setTileState" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> void NL3D::CZoneSymmetrisation::setTileState </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top"><a class="el" href="a04558.html#a15">uint</a>&nbsp;</td>
          <td class="mdname" nowrap> <em>patch</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td></td>
          <td class="md" nowrap><a class="el" href="a04558.html#a15">uint</a>&nbsp;</td>
          <td class="mdname" nowrap> <em>tile</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td></td>
          <td class="md" nowrap><a class="el" href="a04558.html#a15">uint</a>&nbsp;</td>
          <td class="mdname" nowrap> <em>layer</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td></td>
          <td class="md" nowrap><a class="el" href="a03762.html#NL3D_1_1CZoneSymmetrisationw3">TState</a>&nbsp;</td>
          <td class="mdname" nowrap> <em>state</em></td>
        </tr>
        <tr>
          <td></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"><code> [private]</code></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Set orientedtile symmetry state
<p>
Definition at line <a class="el" href="a06778.html#l00086">86</a> of file <a class="el" href="a06778.html">zone_symmetrisation.cpp</a>.
<p>
References <a class="el" href="a06779.html#l00158">_TilesLayerStates</a>, <a class="el" href="a05981.html#l00105">uint</a>, and <a class="el" href="a05981.html#l00098">uint16</a>.
<p>
Referenced by <a class="el" href="a06778.html#l00186">build()</a>, <a class="el" href="a06778.html#l00670">propagateTileState()</a>, <a class="el" href="a06778.html#l00102">setOrientedTileBorderState()</a>, <a class="el" href="a06778.html#l00472">setOrientedTileState()</a>, <a class="el" href="a06778.html#l00095">setTileBorderState()</a>, and <a class="el" href="a06778.html#l00312">setTileState()</a>.
<p>
<div class="fragment"><pre>00087 {
00088         <a class="code" href="a04558.html#a9">uint16</a> &amp;ref = <a class="code" href="a03762.html#NL3D_1_1CZoneSymmetrisationr0">_TilesLayerStates</a>[patch][tile];
00089         ref &amp;= ~(3&lt;&lt;(layer*2));
00090         ref |= ((<a class="code" href="a04558.html#a9">uint16</a>)state)&lt;&lt;(layer*2);
00091 }
</pre></div>    </td>
  </tr>
</table>
<a class="anchor" name="NL3D_1_1CZoneSymmetrisationh0" doxytag="NL3D::CZoneSymmetrisation::snapOnGrid" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> bool NL3D::CZoneSymmetrisation::snapOnGrid </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">float &amp;&nbsp;</td>
          <td class="mdname" nowrap> <em>value</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td></td>
          <td class="md" nowrap>float&nbsp;</td>
          <td class="mdname" nowrap> <em>resolution</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td></td>
          <td class="md" nowrap>float&nbsp;</td>
          <td class="mdname" nowrap> <em>snap</em></td>
        </tr>
        <tr>
          <td></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"><code> [static, private]</code></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>

<p>
Definition at line <a class="el" href="a06778.html#l00280">280</a> of file <a class="el" href="a06778.html">zone_symmetrisation.cpp</a>.
<p>
References <a class="el" href="a05622.html#l00290">nlassert</a>, and <a class="el" href="a05646.html#l01132">value</a>.
<p>
Referenced by <a class="el" href="a06778.html#l00472">setOrientedTileState()</a>, and <a class="el" href="a06778.html#l00312">setTileState()</a>.
<p>
<div class="fragment"><pre>00281 {
00282         <span class="comment">// Calc the floor</span>
00283         <span class="keywordtype">float</span> _floor = (<span class="keywordtype">float</span>) ( resolution * floor (value / resolution) );
00284         <a class="code" href="a04199.html#a6">nlassert</a> (_floor&lt;=value);
00285 
00286         <span class="comment">// Calc the remainder</span>
00287         <span class="keywordtype">float</span> remainder = <a class="code" href="a04223.html#a658">value</a> - _floor;
00288         <span class="comment">//nlassert ( (remainder&gt;=0) &amp;&amp; (remainder&lt;resolution) );</span>
00289 
00290         <span class="comment">// Check the snape</span>
00291         <span class="keywordflow">if</span> ( remainder &lt;= snap )
00292         {
00293                 <span class="comment">// Flag it</span>
00294                 <a class="code" href="a04223.html#a658">value</a> = _floor;
00295 
00296                 <span class="comment">// Floor is good</span>
00297                 <span class="keywordflow">return</span> <span class="keyword">true</span>;
00298         }
00299         <span class="keywordflow">else</span> <span class="keywordflow">if</span> ( (resolution - remainder) &lt;= snap )
00300         {
00301                 <span class="comment">// Flag it</span>
00302                 <a class="code" href="a04223.html#a658">value</a> = _floor + resolution;
00303 
00304                 <span class="comment">// Floor + resolution is good</span>
00305                 <span class="keywordflow">return</span> <span class="keyword">true</span>;
00306         }
00307         <span class="keywordflow">return</span> <span class="keyword">false</span>;
00308 }
</pre></div>    </td>
  </tr>
</table>
<hr><h2>Field Documentation</h2>
<a class="anchor" name="NL3D_1_1CZoneSymmetrisationr0" doxytag="NL3D::CZoneSymmetrisation::_TilesLayerStates" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> std::vector&lt;std::vector&lt;<a class="el" href="a04558.html#a9">uint16</a>&gt; &gt; <a class="el" href="a03762.html#NL3D_1_1CZoneSymmetrisationr0">NL3D::CZoneSymmetrisation::_TilesLayerStates</a><code> [private]</code>
      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>

<p>
Definition at line <a class="el" href="a06779.html#l00158">158</a> of file <a class="el" href="a06779.html">zone_symmetrisation.h</a>.
<p>
Referenced by <a class="el" href="a06778.html#l00186">build()</a>, <a class="el" href="a06778.html#l00079">getOrientedTileCorner()</a>, <a class="el" href="a06778.html#l00057">getTileState()</a>, <a class="el" href="a06778.html#l00109">setOrientedTileCorner()</a>, and <a class="el" href="a06778.html#l00086">setTileState()</a>.    </td>
  </tr>
</table>
<hr>The documentation for this class was generated from the following files:<ul>
<li><a class="el" href="a06779.html">zone_symmetrisation.h</a><li><a class="el" href="a06778.html">zone_symmetrisation.cpp</a></ul>
<hr size="1"><address style="align: right;"><small>Generated on Tue Mar 16 08:36:36 2004 for NeL by
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border=0 > 
</a>1.3.6 </small></address>
</body>
</html>