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
|
<!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::CZoneCornerSmoother 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 Page</a> | <a class="qindex" href="namespaces.html">Namespace List</a> | <a class="qindex" href="hierarchy.html">Class Hierarchy</a> | <a class="qindex" href="classes.html">Alphabetical List</a> | <a class="qindex" href="annotated.html">Data Structures</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="namespacemembers.html">Namespace Members</a> | <a class="qindex" href="functions.html">Data Fields</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related Pages</a> | <span class="search"><u>S</u>earch for <input class="search" type="text" name="query" value="" size="20" accesskey="s"/></span></form></div>
<h1>NL3D::CZoneCornerSmoother Class Reference</h1><code>#include <<a class="el" href="a06765.html">zone_corner_smoother.h</a>></code>
<p>
<hr><a name="_details"></a><h2>Detailed Description</h2>
A class used to setup CornerSmoothFlag in <a class="el" href="a03057.html">CPatch</a>. NB: it works with a compiled <a class="el" href="a03730.html">CZone</a> (ie added in a landscape, and got with landscape->getZone()). NB: it changes values directly in <a class="el" href="a03057.html">CPatch</a> (which it should not be permitted...), but don't except see the changes in realtime. <dl compact><dt><b>Author:</b></dt><dd>Lionel Berenguier <p>
Nevrax France </dd></dl>
<dl compact><dt><b>Date:</b></dt><dd>2001 </dd></dl>
<p>
<p>
Definition at line <a class="el" href="a06765.html#l00051">51</a> of file <a class="el" href="a06765.html">zone_corner_smoother.h</a>.<table border=0 cellpadding=0 cellspacing=0>
<tr><td></td></tr>
<tr><td colspan=2><br><h2>Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a03735.html#NL3D_1_1CZoneCornerSmoothera0">computeAllCornerSmoothFlags</a> (<a class="el" href="a03730.html">CZone</a> *zone, std::vector< <a class="el" href="a03730.html">CZone</a> * > neighborZones)</td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top> </td><td class="memItemRight" valign=bottom><a class="el" href="a03735.html#NL3D_1_1CZoneCornerSmoothera1">CZoneCornerSmoother</a> ()</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Constructor. <a href="#NL3D_1_1CZoneCornerSmoothera1"></a><br><br></td></tr>
<tr><td colspan=2><br><h2>Private Types</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>typedef TIdVertexMap::iterator </td><td class="memItemRight" valign=bottom><a class="el" href="a03735.html#NL3D_1_1CZoneCornerSmoothery0">ItIdVertexMap</a></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>typedef TVertexMap::iterator </td><td class="memItemRight" valign=bottom><a class="el" href="a03735.html#NL3D_1_1CZoneCornerSmoothery1">ItVertexMap</a></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>typedef std::map< const <a class="el" href="a03482.html">CTessVertex</a> *,<br>
<a class="el" href="a04558.html#a14">sint</a> > </td><td class="memItemRight" valign=bottom><a class="el" href="a03735.html#NL3D_1_1CZoneCornerSmoothery2">TIdVertexMap</a></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>typedef std::map< <a class="el" href="a04558.html#a14">sint</a>, <a class="el" href="a03736.html">CVertexSmoothInfo</a> > </td><td class="memItemRight" valign=bottom><a class="el" href="a03735.html#NL3D_1_1CZoneCornerSmoothery3">TVertexMap</a></td></tr>
<tr><td colspan=2><br><h2>Private Member Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a03735.html#NL3D_1_1CZoneCornerSmootherd0">buildPatchBindInfo</a> (<a class="el" href="a03057.html">CPatch</a> &pa, const <a class="el" href="a03731.html">CZone::CPatchConnect</a> &pc, bool smoothEdge[4], bool cornerOnBind[4])</td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a03735.html#NL3D_1_1CZoneCornerSmootherd1">updateVertex</a> (<a class="el" href="a04558.html#a15">uint</a> idVert, <a class="el" href="a04558.html#a15">uint</a> corner, bool smoothEdge[4], bool cornerOnBind[4])</td></tr>
<tr><td colspan=2><br><h2>Private Attributes</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a03735.html#NL3D_1_1CZoneCornerSmoothery2">TIdVertexMap</a> </td><td class="memItemRight" valign=bottom><a class="el" href="a03735.html#NL3D_1_1CZoneCornerSmootherr0">IdVertexMap</a></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a03735.html#NL3D_1_1CZoneCornerSmoothery3">TVertexMap</a> </td><td class="memItemRight" valign=bottom><a class="el" href="a03735.html#NL3D_1_1CZoneCornerSmootherr1">VertexMap</a></td></tr>
</table>
<hr><h2>Member Typedef Documentation</h2>
<a class="anchor" name="NL3D_1_1CZoneCornerSmoothery0" doxytag="NL3D::CZoneCornerSmoother::ItIdVertexMap" ></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"> typedef TIdVertexMap::iterator <a class="el" href="a03735.html#NL3D_1_1CZoneCornerSmoothery0">NL3D::CZoneCornerSmoother::ItIdVertexMap</a><code> [private]</code>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
<p>
Definition at line <a class="el" href="a06765.html#l00095">95</a> of file <a class="el" href="a06765.html">zone_corner_smoother.h</a>.
<p>
Referenced by <a class="el" href="a06764.html#l00134">computeAllCornerSmoothFlags()</a>. </td>
</tr>
</table>
<a class="anchor" name="NL3D_1_1CZoneCornerSmoothery1" doxytag="NL3D::CZoneCornerSmoother::ItVertexMap" ></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"> typedef TVertexMap::iterator <a class="el" href="a03735.html#NL3D_1_1CZoneCornerSmoothery1">NL3D::CZoneCornerSmoother::ItVertexMap</a><code> [private]</code>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
<p>
Definition at line <a class="el" href="a06765.html#l00092">92</a> of file <a class="el" href="a06765.html">zone_corner_smoother.h</a>. </td>
</tr>
</table>
<a class="anchor" name="NL3D_1_1CZoneCornerSmoothery2" doxytag="NL3D::CZoneCornerSmoother::TIdVertexMap" ></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"> typedef std::map<const <a class="el" href="a03482.html">CTessVertex</a> *, <a class="el" href="a04558.html#a14">sint</a>> <a class="el" href="a03735.html#NL3D_1_1CZoneCornerSmoothery2">NL3D::CZoneCornerSmoother::TIdVertexMap</a><code> [private]</code>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
<p>
Definition at line <a class="el" href="a06765.html#l00094">94</a> of file <a class="el" href="a06765.html">zone_corner_smoother.h</a>. </td>
</tr>
</table>
<a class="anchor" name="NL3D_1_1CZoneCornerSmoothery3" doxytag="NL3D::CZoneCornerSmoother::TVertexMap" ></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"> typedef std::map<<a class="el" href="a04558.html#a14">sint</a>, <a class="el" href="a03736.html">CVertexSmoothInfo</a>> <a class="el" href="a03735.html#NL3D_1_1CZoneCornerSmoothery3">NL3D::CZoneCornerSmoother::TVertexMap</a><code> [private]</code>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
<p>
Definition at line <a class="el" href="a06765.html#l00091">91</a> of file <a class="el" href="a06765.html">zone_corner_smoother.h</a>. </td>
</tr>
</table>
<hr><h2>Constructor & Destructor Documentation</h2>
<a class="anchor" name="NL3D_1_1CZoneCornerSmoothera1" doxytag="NL3D::CZoneCornerSmoother::CZoneCornerSmoother" ></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::CZoneCornerSmoother::CZoneCornerSmoother </td>
<td class="md" valign="top">( </td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Constructor.
<p>
<p>
Definition at line <a class="el" href="a06764.html#l00036">36</a> of file <a class="el" href="a06764.html">zone_corner_smoother.cpp</a>.
<p>
<div class="fragment"><pre>00037 {
00038 }
</pre></div> </td>
</tr>
</table>
<hr><h2>Member Function Documentation</h2>
<a class="anchor" name="NL3D_1_1CZoneCornerSmootherd0" doxytag="NL3D::CZoneCornerSmoother::buildPatchBindInfo" ></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::CZoneCornerSmoother::buildPatchBindInfo </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top"><a class="el" href="a03057.html">CPatch</a> & </td>
<td class="mdname" nowrap> <em>pa</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td></td>
<td class="md" nowrap>const <a class="el" href="a03731.html">CZone::CPatchConnect</a> & </td>
<td class="mdname" nowrap> <em>pc</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td></td>
<td class="md" nowrap>bool </td>
<td class="mdname" nowrap> <em>smoothEdge</em>[4], </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td></td>
<td class="md" nowrap>bool </td>
<td class="mdname" nowrap> <em>cornerOnBind</em>[4]</td>
</tr>
<tr>
<td></td>
<td class="md">) </td>
<td class="md" colspan="2"><code> [private]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
<p>
Definition at line <a class="el" href="a06764.html#l00042">42</a> of file <a class="el" href="a06764.html">zone_corner_smoother.cpp</a>.
<p>
References <a class="el" href="a06165.html#l00038">NL3D::CPatchUVLocator::build()</a>, <a class="el" href="a06155.html#l02213">NL3D::CPatch::getBindNeighbor()</a>, <a class="el" href="a06156.html#l00579">NL3D::CPatch::getSmoothFlag()</a>, <a class="el" href="a06156.html#l00318">NL3D::CPatch::CBindInfo::MultipleBindId</a>, <a class="el" href="a06156.html#l00316">NL3D::CPatch::CBindInfo::MultipleBindNum</a>, <a class="el" href="a06166.html#l00066">NL3D::CPatchUVLocator::sameEdgeOrder()</a>, <a class="el" href="a05981.html#l00105">uint</a>, and <a class="el" href="a06156.html#l00309">NL3D::CPatch::CBindInfo::Zone</a>.
<p>
Referenced by <a class="el" href="a06764.html#l00134">computeAllCornerSmoothFlags()</a>.
<p>
<div class="fragment"><pre>00043 {
00044 <a class="code" href="a04558.html#a15">uint</a> edge, corner;
00045
00046 <span class="comment">/*</span>
00047 <span class="comment"> Some terminology here: an edge is supposed going from Corner=edge, to corner=(edge+1)&3.</span>
00048 <span class="comment"> eg: edge 0 goes from corner0 to corner1.</span>
00049 <span class="comment"> */</span>
00050
00051 <span class="keywordflow">for</span>(corner=0; corner<4; corner++)
00052 cornerOnBind[corner]= <span class="keyword">false</span>;
00053
00054 <span class="comment">// for 4 edges.</span>
00055 <span class="keywordflow">for</span>(edge=0; edge<4; edge++)
00056 {
00057 <span class="comment">// Is this edge smoothed??</span>
00058 smoothEdge[edge]= pa.getSmoothFlag(edge);
00059
00060 <span class="comment">// build bindInfo.</span>
00061 CPatch::CBindInfo bindInfo;
00062 CPatchUVLocator patchUvLocator;
00063 pa.getBindNeighbor(edge, bindInfo);
00064 <span class="comment">// if neighbor(s) is present.</span>
00065 <span class="keywordflow">if</span>(bindInfo.Zone)
00066 {
00067 patchUvLocator.build(&pa, edge, bindInfo);
00068 <span class="comment">// if not sameEdgeOnOrder (NB: all special cases of bind 1/X X/1 managed :) ), not smoothed!</span>
00069 <span class="keywordflow">if</span>( !patchUvLocator.sameEdgeOrder() )
00070 smoothEdge[edge]= <span class="keyword">false</span>;
00071
00072 <span class="comment">// Manage bind 1/4 for the 2 patchs on the center of the bind.</span>
00073 <span class="keywordflow">if</span>(bindInfo.MultipleBindNum==4 && (bindInfo.MultipleBindId==1 || bindInfo.MultipleBindId==2) )
00074 {
00075 <span class="comment">// easy, this edge starts and ends on a bind...</span>
00076 cornerOnBind[edge]= <span class="keyword">true</span>;
00077 cornerOnBind[(edge+1)&3]= <span class="keyword">true</span>;
00078 }
00079 <span class="comment">// else for case bind 1/2, and for case of patch 0 and patch 3 of the bind 1/4.</span>
00080 <span class="keywordflow">else</span> <span class="keywordflow">if</span>(bindInfo.MultipleBindNum>=2)
00081 {
00082 <span class="comment">// Beware of the mirroring!! (make a draw...)</span>
00083 <span class="comment">/*</span>
00084 <span class="comment"> ----------|-----------</span>
00085 <span class="comment"> | </span>
00086 <span class="comment"> | | </span>
00087 <span class="comment"> 1 | | </span>
00088 <span class="comment"> ^ | v </span>
00089 <span class="comment"> | | </span>
00090 <span class="comment"> | *-----------</span>
00091 <span class="comment"> | | </span>
00092 <span class="comment"> | | | </span>
00093 <span class="comment"> 0 | | </span>
00094 <span class="comment"> | v </span>
00095 <span class="comment"> | </span>
00096 <span class="comment"> ----------|-----------</span>
00097 <span class="comment"> */</span>
00098 <span class="comment">// If we are the patch0 on the neighbor, then we start on a bind, else we ends.</span>
00099 <span class="keywordflow">if</span>(bindInfo.MultipleBindId==0)
00100 cornerOnBind[edge]= <span class="keyword">true</span>;
00101 <span class="keywordflow">else</span>
00102 cornerOnBind[(edge+1)&3]= <span class="keyword">true</span>;
00103 }
00104
00105 }
00106 }
00107 }
</pre></div> </td>
</tr>
</table>
<a class="anchor" name="NL3D_1_1CZoneCornerSmoothera0" doxytag="NL3D::CZoneCornerSmoother::computeAllCornerSmoothFlags" ></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::CZoneCornerSmoother::computeAllCornerSmoothFlags </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top"><a class="el" href="a03730.html">CZone</a> * </td>
<td class="mdname" nowrap> <em>zone</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td></td>
<td class="md" nowrap>std::vector< <a class="el" href="a03730.html">CZone</a> * > </td>
<td class="mdname" nowrap> <em>neighborZones</em></td>
</tr>
<tr>
<td></td>
<td class="md">) </td>
<td class="md" colspan="2"></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
the doit method. this Zone and his 8 neighbors should be added into a landscape. this method call setCornerSmoothFlag() on all <a class="el" href="a03057.html">CPatch</a> of the zone. All corner smooth are set to false but if:<ul>
<li>the corner is a vertex on a bind 1/X OR the vertex has exaclty 4 patch around him. AND</li><li>All edges sharing this corner must be smoothed getSmoothFlag()==true. AND</li><li>All edges sharing this corner must be "SameEdgeOrder", ie the patchs sharing this edge must have same number of tiles along this edge.</li></ul>
<p>
This is important for noise computing, and lighting.
<p>
Definition at line <a class="el" href="a06764.html#l00134">134</a> of file <a class="el" href="a06764.html">zone_corner_smoother.cpp</a>.
<p>
References <a class="el" href="a06760.html#l00306">NL3D::CZone::CPatchConnect::BaseVertices</a>, <a class="el" href="a06764.html#l00042">buildPatchBindInfo()</a>, <a class="el" href="a06156.html#l00659">NL3D::CPatch::getCornerVertex()</a>, <a class="el" href="a06760.html#l00489">NL3D::CZone::getNumPatchs()</a>, <a class="el" href="a06760.html#l00507">NL3D::CZone::getPatchConnect()</a>, <a class="el" href="a06765.html#l00100">IdVertexMap</a>, <a class="el" href="a06765.html#l00095">ItIdVertexMap</a>, <a class="el" href="a05622.html#l00290">nlassert</a>, <a class="el" href="a06765.html#l00077">NL3D::CZoneCornerSmoother::CVertexSmoothInfo::NPatchShared</a>, <a class="el" href="a06158.html#l00951">NL3D::CPatch::setCornerSmoothFlag()</a>, <a class="el" href="a05981.html#l00104">sint</a>, <a class="el" href="a06765.html#l00079">NL3D::CZoneCornerSmoother::CVertexSmoothInfo::Smoothed</a>, <a class="el" href="a05981.html#l00105">uint</a>, <a class="el" href="a06764.html#l00111">updateVertex()</a>, <a class="el" href="a06765.html#l00099">VertexMap</a>, and <a class="el" href="a06765.html#l00078">NL3D::CZoneCornerSmoother::CVertexSmoothInfo::VertexOnBind</a>.
<p>
<div class="fragment"><pre>00135 {
00136 <a class="code" href="a04199.html#a6">nlassert</a>(zone);
00137 <a class="code" href="a04558.html#a14">sint</a> npatchs= zone->getNumPatchs();
00138 <a class="code" href="a04558.html#a14">sint</a> i;
00139
00140 <a class="code" href="a03735.html#NL3D_1_1CZoneCornerSmootherr1">VertexMap</a>.clear();
00141 <a class="code" href="a03735.html#NL3D_1_1CZoneCornerSmootherr0">IdVertexMap</a>.clear();
00142
00143 <span class="comment">// for all patchs of the center zone, build the vertexMap.</span>
00144 <span class="comment">//==================</span>
00145 <span class="keywordflow">for</span>(i=0; i<npatchs; i++)
00146 {
00147 CPatch &pa= (CPatch&)*(((<span class="keyword">const</span> CZone*)zone)->getPatch(i));
00148 <span class="keyword">const</span> CZone::CPatchConnect &pc= *(zone->getPatchConnect(i));
00149 <a class="code" href="a04558.html#a15">uint</a> corner;
00150
00151 <span class="comment">// build bind info for 4 edges and 4 vertices.</span>
00152 <span class="keywordtype">bool</span> smoothEdge[4];
00153 <span class="keywordtype">bool</span> cornerOnBind[4];
00154 <a class="code" href="a03735.html#NL3D_1_1CZoneCornerSmootherd0">buildPatchBindInfo</a>(pa, pc, smoothEdge, cornerOnBind);
00155
00156 <span class="comment">// for 4 corners.</span>
00157 <span class="keywordflow">for</span>(corner=0; corner<4; corner++)
00158 {
00159 <span class="comment">// get the vertex id for this patch.</span>
00160 <a class="code" href="a04558.html#a15">uint</a> idVert= pc.BaseVertices[corner];
00161
00162 <span class="comment">// update this vertex smooth info.</span>
00163 <a class="code" href="a03735.html#NL3D_1_1CZoneCornerSmootherd1">updateVertex</a>(idVert, corner, smoothEdge, cornerOnBind);
00164
00165 <span class="comment">// for Bind with neighbor zones, must insert it in the map CTessVertex* -> VertexId.</span>
00166 <a class="code" href="a03735.html#NL3D_1_1CZoneCornerSmootherr0">IdVertexMap</a>[pa.getCornerVertex(corner)]= idVert;
00167 }
00168 }
00169
00170
00171 <span class="comment">// for all patchs of all neigbhors zone, update for vertices that are connected to the centerZone.</span>
00172 <span class="comment">//==================</span>
00173 <span class="keywordflow">for</span>(<a class="code" href="a04558.html#a15">uint</a> nbZone=0; nbZone<neighborZones.size(); nbZone++)
00174 {
00175 CZone *neighborZone= neighborZones[nbZone];
00176 <a class="code" href="a04199.html#a6">nlassert</a>(neighborZone);
00177 <span class="keywordflow">for</span>(i=0; i<neighborZone->getNumPatchs(); i++)
00178 {
00179 CPatch &pa= (CPatch&)*(((<span class="keyword">const</span> CZone*)neighborZone)->getPatch(i));
00180 <span class="keyword">const</span> CZone::CPatchConnect &pc= *(neighborZone->getPatchConnect(i));
00181 <a class="code" href="a04558.html#a15">uint</a> corner;
00182
00183 <span class="comment">// build bind info for 4 edges and 4 vertices.</span>
00184 <span class="keywordtype">bool</span> smoothEdge[4];
00185 <span class="keywordtype">bool</span> cornerOnBind[4];
00186 <a class="code" href="a03735.html#NL3D_1_1CZoneCornerSmootherd0">buildPatchBindInfo</a>(pa, pc, smoothEdge, cornerOnBind);
00187
00188 <span class="comment">// for 4 corners.</span>
00189 <span class="keywordflow">for</span>(corner=0; corner<4; corner++)
00190 {
00191 <span class="comment">// try to find the vertex of the centerZone binded to this corner.</span>
00192 <a class="code" href="a03735.html#NL3D_1_1CZoneCornerSmoothery0">ItIdVertexMap</a> it= <a class="code" href="a03735.html#NL3D_1_1CZoneCornerSmootherr0">IdVertexMap</a>.find(pa.getCornerVertex(corner));
00193
00194 <span class="comment">// If this patch is binded on a vertex of the centerZone, must update this vertex.</span>
00195 <span class="keywordflow">if</span>(it != <a class="code" href="a03735.html#NL3D_1_1CZoneCornerSmootherr0">IdVertexMap</a>.end())
00196 {
00197 <span class="comment">// get the vertex id for this patch.</span>
00198 <a class="code" href="a04558.html#a15">uint</a> idVert= it->second;
00199
00200 <span class="comment">// update this vertex smooth info.</span>
00201 <a class="code" href="a03735.html#NL3D_1_1CZoneCornerSmootherd1">updateVertex</a>(idVert, corner, smoothEdge, cornerOnBind);
00202 }
00203
00204 }
00205 }
00206 }
00207
00208
00209 <span class="comment">// for all patchs of the center zone, build the finalSmooth.</span>
00210 <span class="comment">//==================</span>
00211 <span class="keywordflow">for</span>(i=0; i<npatchs; i++)
00212 {
00213 CPatch &pa= (CPatch&)*(((<span class="keyword">const</span> CZone*)zone)->getPatch(i));
00214 <span class="keyword">const</span> CZone::CPatchConnect &pc= *(zone->getPatchConnect(i));
00215 <a class="code" href="a04558.html#a15">uint</a> corner;
00216
00217 <span class="comment">// for 4 corners.</span>
00218 <span class="keywordflow">for</span>(corner=0; corner<4; corner++)
00219 {
00220 <a class="code" href="a04558.html#a15">uint</a> idVert= pc.BaseVertices[corner];
00221 <span class="comment">// get from map.</span>
00222 CVertexSmoothInfo &vert= <a class="code" href="a03735.html#NL3D_1_1CZoneCornerSmootherr1">VertexMap</a>[idVert];
00223
00224 <span class="comment">// the vertex is smoothed if all edges around him are smoothed, AND</span>
00225 <span class="comment">// if it has 4 patchs around him or if it is a bind.</span>
00226 <span class="keywordtype">bool</span> finalSmooth;
00227 finalSmooth= vert.Smoothed && (vert.VertexOnBind || vert.NPatchShared==4);
00228
00229 <span class="comment">// update the patch.</span>
00230 pa.setCornerSmoothFlag(corner, finalSmooth);
00231 }
00232
00233 }
00234
00235
00236 }
</pre></div> </td>
</tr>
</table>
<a class="anchor" name="NL3D_1_1CZoneCornerSmootherd1" doxytag="NL3D::CZoneCornerSmoother::updateVertex" ></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::CZoneCornerSmoother::updateVertex </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top"><a class="el" href="a04558.html#a15">uint</a> </td>
<td class="mdname" nowrap> <em>idVert</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> </td>
<td class="mdname" nowrap> <em>corner</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td></td>
<td class="md" nowrap>bool </td>
<td class="mdname" nowrap> <em>smoothEdge</em>[4], </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td></td>
<td class="md" nowrap>bool </td>
<td class="mdname" nowrap> <em>cornerOnBind</em>[4]</td>
</tr>
<tr>
<td></td>
<td class="md">) </td>
<td class="md" colspan="2"><code> [private]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
<p>
Definition at line <a class="el" href="a06764.html#l00111">111</a> of file <a class="el" href="a06764.html">zone_corner_smoother.cpp</a>.
<p>
References <a class="el" href="a06765.html#l00077">NL3D::CZoneCornerSmoother::CVertexSmoothInfo::NPatchShared</a>, <a class="el" href="a06765.html#l00079">NL3D::CZoneCornerSmoother::CVertexSmoothInfo::Smoothed</a>, <a class="el" href="a05981.html#l00105">uint</a>, <a class="el" href="a06765.html#l00099">VertexMap</a>, and <a class="el" href="a06765.html#l00078">NL3D::CZoneCornerSmoother::CVertexSmoothInfo::VertexOnBind</a>.
<p>
Referenced by <a class="el" href="a06764.html#l00134">computeAllCornerSmoothFlags()</a>.
<p>
<div class="fragment"><pre>00112 {
00113 <span class="comment">// get or insert into map (with default).</span>
00114 CVertexSmoothInfo &vert= <a class="code" href="a03735.html#NL3D_1_1CZoneCornerSmootherr1">VertexMap</a>[idVert];
00115
00116 <span class="comment">// inc the number of patch binded to this point.</span>
00117 vert.NPatchShared++;
00118
00119 <span class="comment">// get the smooth flag of edge before and after this corner.</span>
00120 <a class="code" href="a04558.html#a15">uint</a> e0= (4+corner-1)&3;
00121 <a class="code" href="a04558.html#a15">uint</a> e1= corner;
00122 <span class="comment">// if any one of those edge is not smoothed, then this vertex is not smoothed.</span>
00123 <span class="keywordflow">if</span>( !smoothEdge[e0] || !smoothEdge[e1] )
00124 vert.Smoothed= <span class="keyword">false</span>;
00125
00126
00127 <span class="comment">// Are we a vertex on a bind??</span>
00128 <span class="keywordflow">if</span>(cornerOnBind[corner])
00129 vert.VertexOnBind= <span class="keyword">true</span>;
00130 }
</pre></div> </td>
</tr>
</table>
<hr><h2>Field Documentation</h2>
<a class="anchor" name="NL3D_1_1CZoneCornerSmootherr0" doxytag="NL3D::CZoneCornerSmoother::IdVertexMap" ></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="a03735.html#NL3D_1_1CZoneCornerSmoothery2">TIdVertexMap</a> <a class="el" href="a03735.html#NL3D_1_1CZoneCornerSmootherr0">NL3D::CZoneCornerSmoother::IdVertexMap</a><code> [private]</code>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
<p>
Definition at line <a class="el" href="a06765.html#l00100">100</a> of file <a class="el" href="a06765.html">zone_corner_smoother.h</a>.
<p>
Referenced by <a class="el" href="a06764.html#l00134">computeAllCornerSmoothFlags()</a>. </td>
</tr>
</table>
<a class="anchor" name="NL3D_1_1CZoneCornerSmootherr1" doxytag="NL3D::CZoneCornerSmoother::VertexMap" ></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="a03735.html#NL3D_1_1CZoneCornerSmoothery3">TVertexMap</a> <a class="el" href="a03735.html#NL3D_1_1CZoneCornerSmootherr1">NL3D::CZoneCornerSmoother::VertexMap</a><code> [private]</code>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
<p>
Definition at line <a class="el" href="a06765.html#l00099">99</a> of file <a class="el" href="a06765.html">zone_corner_smoother.h</a>.
<p>
Referenced by <a class="el" href="a06764.html#l00134">computeAllCornerSmoothFlags()</a>, and <a class="el" href="a06764.html#l00111">updateVertex()</a>. </td>
</tr>
</table>
<hr>The documentation for this class was generated from the following files:<ul>
<li><a class="el" href="a06765.html">zone_corner_smoother.h</a><li><a class="el" href="a06764.html">zone_corner_smoother.cpp</a></ul>
<hr size="1"><address style="align: right;"><small>Generated on Tue Mar 16 08:34:16 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>
|