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
|
<!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: TemplateNL3D::CStaticQuadGrid< T > 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::CStaticQuadGrid< T > Class Template Reference</h1><code>#include <<a class="el" href="a06436.html">static_quad_grid.h</a>></code>
<p>
<hr><a name="_details"></a><h2>Detailed Description</h2>
<h3>template<class T><br>
class NL3D::CStaticQuadGrid< T ></h3>
This class is builded from a <a class="el" href="a03273.html">CQuadGrid</a>, and is to be used when:<ul>
<li>sizeof(T) is small (ie a pointer)</li><li>no dynamic insertion are made (builded from a <a class="el" href="a03273.html">CQuadGrid</a>)</li><li>selection is made with a point, not a BBox.</li></ul>
<p>
Because elements are duplicated all over cells and only one cell can be selected at a time.<p>
<dl compact><dt><b>Author:</b></dt><dd>Lionel Berenguier <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="a06436.html#l00051">51</a> of file <a class="el" href="a06436.html">static_quad_grid.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> </td><td class="memItemRight" valign=bottom><a class="el" href="a03439.html#NL3D_1_1CStaticQuadGrida0">CStaticQuadGrid</a> ()</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Constructor. <a href="#NL3D_1_1CStaticQuadGrida0"></a><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top> </td><td class="memItemRight" valign=bottom><a class="el" href="a03439.html#NL3D_1_1CStaticQuadGrida1">~CStaticQuadGrid</a> ()</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">dtor. <a href="#NL3D_1_1CStaticQuadGrida1"></a><br><br></td></tr>
<tr><td colspan="2"><div class="groupHeader">Initialization</div></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a03439.html#NL3D_1_1CStaticQuadGridz962_0">build</a> (<a class="el" href="a03273.html">CQuadGrid</a>< T > &quadGrid)</td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a03439.html#NL3D_1_1CStaticQuadGridz962_1">clear</a> ()</td></tr>
<tr><td colspan="2"><div class="groupHeader">Selection</div></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>const T * </td><td class="memItemRight" valign=bottom><a class="el" href="a03439.html#NL3D_1_1CStaticQuadGridz964_0">select</a> (const <a class="el" href="a03128.html">NLMISC::CVector</a> &point, <a class="el" href="a04558.html#a15">uint</a> &numElts)</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="a03439.html#NL3D_1_1CStaticQuadGridd0">selectPoint</a> (<a class="el" href="a03128.html">CVector</a> point, <a class="el" href="a04558.html#a14">sint</a> &x0, <a class="el" href="a04558.html#a14">sint</a> &y0)</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="a02851.html">NLMISC::CMatrix</a> </td><td class="memItemRight" valign=bottom><a class="el" href="a03439.html#NL3D_1_1CStaticQuadGridr0">_ChangeBasis</a></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>std::vector< T > </td><td class="memItemRight" valign=bottom><a class="el" href="a03439.html#NL3D_1_1CStaticQuadGridr1">_Elements</a></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>float </td><td class="memItemRight" valign=bottom><a class="el" href="a03439.html#NL3D_1_1CStaticQuadGridr2">_EltSize</a></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>std::vector< <a class="el" href="a03440.html">CQuadNode</a> > </td><td class="memItemRight" valign=bottom><a class="el" href="a03439.html#NL3D_1_1CStaticQuadGridr3">_Grid</a></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a04558.html#a14">sint</a> </td><td class="memItemRight" valign=bottom><a class="el" href="a03439.html#NL3D_1_1CStaticQuadGridr4">_Size</a></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a04558.html#a14">sint</a> </td><td class="memItemRight" valign=bottom><a class="el" href="a03439.html#NL3D_1_1CStaticQuadGridr5">_SizePower</a></td></tr>
</table>
<hr><h2>Constructor & Destructor Documentation</h2>
<a class="anchor" name="NL3D_1_1CStaticQuadGrida0" doxytag="NL3D::CStaticQuadGrid::CStaticQuadGrid" ></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" colspan="4">
template<class T> </td>
</tr>
<tr>
<td class="md" nowrap valign="top"> <a class="el" href="a03439.html">NL3D::CStaticQuadGrid</a>< T >::<a class="el" href="a03439.html">CStaticQuadGrid</a> </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="a06436.html#l00146">146</a> of file <a class="el" href="a06436.html">static_quad_grid.h</a>.
<p>
References <a class="el" href="a05972.html#l00200">NLMISC::CMatrix::identity()</a>.
<p>
<div class="fragment"><pre>00147 {
00148 <a class="code" href="a03439.html#NL3D_1_1CStaticQuadGridr5">_SizePower</a>=4;
00149 <a class="code" href="a03439.html#NL3D_1_1CStaticQuadGridr4">_Size</a>=1<<<a class="code" href="a03439.html#NL3D_1_1CStaticQuadGridr5">_SizePower</a>;
00150 <a class="code" href="a03439.html#NL3D_1_1CStaticQuadGridr2">_EltSize</a>=1;
00151 <a class="code" href="a03439.html#NL3D_1_1CStaticQuadGridr0">_ChangeBasis</a>.<a class="code" href="a02851.html#NLMISC_1_1CMatrixz1961_0">identity</a>();
00152 <a class="code" href="a03439.html#NL3D_1_1CStaticQuadGridr3">_Grid</a>.resize(_Size * _Size);
00153 }
</pre></div> </td>
</tr>
</table>
<a class="anchor" name="NL3D_1_1CStaticQuadGrida1" doxytag="NL3D::CStaticQuadGrid::~CStaticQuadGrid" ></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" colspan="4">
template<class T> </td>
</tr>
<tr>
<td class="md" nowrap valign="top"> <a class="el" href="a03439.html">NL3D::CStaticQuadGrid</a>< T >::~<a class="el" href="a03439.html">CStaticQuadGrid</a> </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>
dtor.
<p>
<p>
Definition at line <a class="el" href="a06436.html#l00156">156</a> of file <a class="el" href="a06436.html">static_quad_grid.h</a>.
<p>
References <a class="el" href="a06436.html#l00164">NL3D::CStaticQuadGrid< T >::clear()</a>.
<p>
<div class="fragment"><pre>00157 {
00158 <a class="code" href="a03439.html#NL3D_1_1CStaticQuadGridz962_1">clear</a>();
00159 }
</pre></div> </td>
</tr>
</table>
<hr><h2>Member Function Documentation</h2>
<a class="anchor" name="NL3D_1_1CStaticQuadGridz962_0" doxytag="NL3D::CStaticQuadGrid::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" colspan="4">
template<class T> </td>
</tr>
<tr>
<td class="md" nowrap valign="top"> void <a class="el" href="a03439.html">NL3D::CStaticQuadGrid</a>< T >::build </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top"><a class="el" href="a03273.html">CQuadGrid</a>< T > & </td>
<td class="mdname1" valign="top" nowrap> <em>quadGrid</em> </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>
build from a <a class="el" href="a03273.html">CQuadGrid</a>. Elements are copied, not referenced Elements may be duplicated in all cells they lie into. quadGrid selection is cleared
<p>
Definition at line <a class="el" href="a06436.html#l00181">181</a> of file <a class="el" href="a06436.html">static_quad_grid.h</a>.
<p>
References <a class="el" href="a06300.html#l00641">NL3D::CQuadGrid< T >::begin()</a>, <a class="el" href="a06436.html#l00164">NL3D::CStaticQuadGrid< T >::clear()</a>, <a class="el" href="a06300.html#l00567">NL3D::CQuadGrid< T >::clearSelection()</a>, <a class="el" href="a06300.html#l00646">NL3D::CQuadGrid< T >::end()</a>, <a class="el" href="a06300.html#l00119">NL3D::CQuadGrid< T >::getBasis()</a>, <a class="el" href="a06300.html#l00121">NL3D::CQuadGrid< T >::getEltSize()</a>, <a class="el" href="a05586.html#l00358">NLMISC::getPowerOf2()</a>, <a class="el" href="a06300.html#l00120">NL3D::CQuadGrid< T >::getSize()</a>, <a class="el" href="a05972.html#l01090">NLMISC::CMatrix::inverted()</a>, <a class="el" href="a06300.html#l00613">NL3D::CQuadGrid< T >::select()</a>, <a class="el" href="a05981.html#l00104">sint</a>, <a class="el" href="a05981.html#l00105">uint</a>, <a class="el" href="a06673.html#l00051">NLMISC::CVector::x</a>, <a class="el" href="a05646.html#l00236">x</a>, <a class="el" href="a06673.html#l00051">NLMISC::CVector::y</a>, <a class="el" href="a05646.html#l00236">y</a>, and <a class="el" href="a06673.html#l00051">NLMISC::CVector::z</a>.
<p>
<div class="fragment"><pre>00182 {
00183 <a class="code" href="a03439.html#NL3D_1_1CStaticQuadGridz962_1">clear</a>();
00184 <a class="code" href="a05378.html#a381">contReset</a>(_Grid);
00185
00186 <span class="comment">// Copy from quadGrid, and init quads</span>
00187 <a class="code" href="a03439.html#NL3D_1_1CStaticQuadGridr4">_Size</a>= quadGrid.getSize();
00188 <a class="code" href="a03439.html#NL3D_1_1CStaticQuadGridr5">_SizePower</a>= <a class="code" href="a05378.html#a263">getPowerOf2</a>(_Size);
00189 <a class="code" href="a03439.html#NL3D_1_1CStaticQuadGridr2">_EltSize</a>= quadGrid.getEltSize();
00190 <a class="code" href="a03439.html#NL3D_1_1CStaticQuadGridr0">_ChangeBasis</a>= quadGrid.getBasis();
00191 <a class="code" href="a03439.html#NL3D_1_1CStaticQuadGridr3">_Grid</a>.resize(_Size * _Size);
00192
00193 <a class="code" href="a02851.html">NLMISC::CMatrix</a> invBasis= <a class="code" href="a03439.html#NL3D_1_1CStaticQuadGridr0">_ChangeBasis</a>.<a class="code" href="a02851.html#NLMISC_1_1CMatrixz1967_1">inverted</a>();
00194
00195 <span class="comment">// Count number of elements per cell, and total copies of elements</span>
00196 <a class="code" href="a04558.html#a15">uint</a> totalDupElt= 0;
00197 <a class="code" href="a04558.html#a14">sint</a> <a class="code" href="a04223.html#a572">x</a>,<a class="code" href="a04223.html#a573">y</a>;
00198 <span class="keywordflow">for</span>(<a class="code" href="a04223.html#a573">y</a>=0; <a class="code" href="a04223.html#a573">y</a><<a class="code" href="a03439.html#NL3D_1_1CStaticQuadGridr4">_Size</a>; <a class="code" href="a04223.html#a573">y</a>++)
00199 {
00200 <span class="keywordflow">for</span>(<a class="code" href="a04223.html#a572">x</a>=0; <a class="code" href="a04223.html#a572">x</a><_Size; <a class="code" href="a04223.html#a572">x</a>++)
00201 {
00202 <span class="comment">// Select the center of the case</span>
00203 CVector pos;
00204 pos.x= (<a class="code" href="a04223.html#a572">x</a>+0.5f)*<a class="code" href="a03439.html#NL3D_1_1CStaticQuadGridr2">_EltSize</a>;
00205 pos.y= (<a class="code" href="a04223.html#a573">y</a>+0.5f)*<a class="code" href="a03439.html#NL3D_1_1CStaticQuadGridr2">_EltSize</a>;
00206 pos.z= 0.f;
00207 <span class="comment">// mul by invBasis</span>
00208 pos= invBasis * pos;
00209 quadGrid.select(pos, pos);
00210
00211 <span class="comment">// Count elements.</span>
00212 <a class="code" href="a04558.html#a15">uint</a> n= 0;
00213 <span class="keyword">typename</span> CQuadGrid<T>::CIterator it;
00214 <span class="keywordflow">for</span>(it= quadGrid.begin(); it!=quadGrid.end(); it++)
00215 {
00216 n++;
00217 }
00218
00219 <span class="comment">// store.</span>
00220 <a class="code" href="a03439.html#NL3D_1_1CStaticQuadGridr3">_Grid</a>[<a class="code" href="a04223.html#a573">y</a>*_Size + <a class="code" href="a04223.html#a572">x</a>].NumNodes= n;
00221 totalDupElt+= n;
00222 }
00223 }
00224
00225 <span class="comment">// Resize array copy.</span>
00226 <a class="code" href="a03439.html#NL3D_1_1CStaticQuadGridr1">_Elements</a>.resize(totalDupElt);
00227
00228
00229 <span class="comment">// Then reparse all array, filling _Elements and setup quadNodes ptr.</span>
00230 <a class="code" href="a04558.html#a15">uint</a> curDupElt= 0;
00231 <span class="keywordflow">for</span>(<a class="code" href="a04223.html#a573">y</a>=0; <a class="code" href="a04223.html#a573">y</a><_Size; <a class="code" href="a04223.html#a573">y</a>++)
00232 {
00233 <span class="keywordflow">for</span>(<a class="code" href="a04223.html#a572">x</a>=0; <a class="code" href="a04223.html#a572">x</a><_Size; <a class="code" href="a04223.html#a572">x</a>++)
00234 {
00235 <span class="comment">// Select the center of the case</span>
00236 CVector pos;
00237 pos.x= (<a class="code" href="a04223.html#a572">x</a>+0.5f)*<a class="code" href="a03439.html#NL3D_1_1CStaticQuadGridr2">_EltSize</a>;
00238 pos.y= (<a class="code" href="a04223.html#a573">y</a>+0.5f)*<a class="code" href="a03439.html#NL3D_1_1CStaticQuadGridr2">_EltSize</a>;
00239 pos.z= 0.f;
00240 <span class="comment">// mul by invBasis</span>
00241 pos= invBasis * pos;
00242 quadGrid.select(pos, pos);
00243
00244 <span class="comment">// Setup quadNode ptr.</span>
00245 <span class="keywordflow">if</span> (curDupElt < <a class="code" href="a03439.html#NL3D_1_1CStaticQuadGridr1">_Elements</a>.size())
00246 <a class="code" href="a03439.html#NL3D_1_1CStaticQuadGridr3">_Grid</a>[<a class="code" href="a04223.html#a573">y</a>*_Size + <a class="code" href="a04223.html#a572">x</a>].Nodes= &<a class="code" href="a03439.html#NL3D_1_1CStaticQuadGridr1">_Elements</a>[curDupElt];
00247
00248 <span class="comment">// For all elements.</span>
00249 <span class="keyword">typename</span> CQuadGrid<T>::CIterator it;
00250 <span class="keywordflow">for</span>(it= quadGrid.begin(); it!=quadGrid.end(); it++)
00251 {
00252 <span class="comment">// Copy elt in array.</span>
00253 <a class="code" href="a03439.html#NL3D_1_1CStaticQuadGridr1">_Elements</a>[curDupElt]= *it;
00254
00255 <span class="comment">// Next elt in array.</span>
00256 curDupElt++;
00257 }
00258 }
00259 }
00260
00261
00262 <span class="comment">// clean up.</span>
00263 quadGrid.clearSelection();
00264 }
</pre></div> </td>
</tr>
</table>
<a class="anchor" name="NL3D_1_1CStaticQuadGridz962_1" doxytag="NL3D::CStaticQuadGrid::clear" ></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" colspan="4">
template<class T> </td>
</tr>
<tr>
<td class="md" nowrap valign="top"> void <a class="el" href="a03439.html">NL3D::CStaticQuadGrid</a>< T >::clear </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>
Clear all the container. Elements are deleted, and the quadgrid is erased.
<p>
Definition at line <a class="el" href="a06436.html#l00164">164</a> of file <a class="el" href="a06436.html">static_quad_grid.h</a>.
<p>
References <a class="el" href="a05972.html#l00200">NLMISC::CMatrix::identity()</a>.
<p>
Referenced by <a class="el" href="a06436.html#l00181">NL3D::CStaticQuadGrid< T >::build()</a>, and <a class="el" href="a06436.html#l00156">NL3D::CStaticQuadGrid< T >::~CStaticQuadGrid()</a>.
<p>
<div class="fragment"><pre>00165 {
00166 <span class="comment">// Just clear all vectors</span>
00167 <a class="code" href="a03439.html#NL3D_1_1CStaticQuadGridr1">_Elements</a>.clear();
00168 <a class="code" href="a03439.html#NL3D_1_1CStaticQuadGridr3">_Grid</a>.clear();
00169
00170 <span class="comment">// reset</span>
00171 <a class="code" href="a03439.html#NL3D_1_1CStaticQuadGridr5">_SizePower</a>=4;
00172 <a class="code" href="a03439.html#NL3D_1_1CStaticQuadGridr4">_Size</a>=1<<<a class="code" href="a03439.html#NL3D_1_1CStaticQuadGridr5">_SizePower</a>;
00173 <a class="code" href="a03439.html#NL3D_1_1CStaticQuadGridr2">_EltSize</a>=1;
00174 <a class="code" href="a03439.html#NL3D_1_1CStaticQuadGridr0">_ChangeBasis</a>.<a class="code" href="a02851.html#NLMISC_1_1CMatrixz1961_0">identity</a>();
00175 <a class="code" href="a03439.html#NL3D_1_1CStaticQuadGridr3">_Grid</a>.resize(_Size * _Size);
00176 }
</pre></div> </td>
</tr>
</table>
<a class="anchor" name="NL3D_1_1CStaticQuadGridz964_0" doxytag="NL3D::CStaticQuadGrid::select" ></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" colspan="4">
template<class T> </td>
</tr>
<tr>
<td class="md" nowrap valign="top"> const T * <a class="el" href="a03439.html">NL3D::CStaticQuadGrid</a>< T >::select </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">const <a class="el" href="a03128.html">NLMISC::CVector</a> & </td>
<td class="mdname" nowrap> <em>point</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>numElts</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>
Select elements at a given point Speed is in O(1), because the array of the cell is returned. NULL if size==0.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign=top><em>point</em> </td><td>is the point used to select </td></tr>
<tr><td valign=top><em>numElts</em> </td><td>number of elements returned </td></tr>
</table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>a ptr on array of elements</dd></dl>
<p>
Definition at line <a class="el" href="a06436.html#l00269">269</a> of file <a class="el" href="a06436.html">static_quad_grid.h</a>.
<p>
References <a class="el" href="a06436.html#l00094">NL3D::CStaticQuadGrid< T >::CQuadNode::Nodes</a>, <a class="el" href="a06436.html#l00095">NL3D::CStaticQuadGrid< T >::CQuadNode::NumNodes</a>, <a class="el" href="a06436.html#l00114">NL3D::CStaticQuadGrid< T >::selectPoint()</a>, <a class="el" href="a05981.html#l00104">sint</a>, <a class="el" href="a05981.html#l00105">uint</a>, <a class="el" href="a05646.html#l00236">x</a>, and <a class="el" href="a05646.html#l00236">y</a>.
<p>
<div class="fragment"><pre>00270 {
00271 CVector point= <a class="code" href="a03439.html#NL3D_1_1CStaticQuadGridr0">_ChangeBasis</a> * pointIn;
00272
00273 <span class="comment">// Select the case.</span>
00274 <a class="code" href="a04558.html#a14">sint</a> <a class="code" href="a04223.html#a572">x</a>, <a class="code" href="a04223.html#a573">y</a>;
00275 <a class="code" href="a03439.html#NL3D_1_1CStaticQuadGridd0">selectPoint</a>(point, x, y);
00276
00277 <span class="comment">// get ref on the selection</span>
00278 CQuadNode &quadNode= <a class="code" href="a03439.html#NL3D_1_1CStaticQuadGridr3">_Grid</a>[<a class="code" href="a04223.html#a573">y</a>*<a class="code" href="a03439.html#NL3D_1_1CStaticQuadGridr4">_Size</a> + <a class="code" href="a04223.html#a572">x</a>];
00279 numElts= quadNode.NumNodes;
00280
00281 <span class="keywordflow">return</span> quadNode.Nodes;
00282 }
</pre></div> </td>
</tr>
</table>
<a class="anchor" name="NL3D_1_1CStaticQuadGridd0" doxytag="NL3D::CStaticQuadGrid::selectPoint" ></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" colspan="4">
template<class T> </td>
</tr>
<tr>
<td class="md" nowrap valign="top"> void <a class="el" href="a03439.html">NL3D::CStaticQuadGrid</a>< T >::selectPoint </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top"><a class="el" href="a03128.html">CVector</a> </td>
<td class="mdname" nowrap> <em>point</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td></td>
<td class="md" nowrap><a class="el" href="a04558.html#a14">sint</a> & </td>
<td class="mdname" nowrap> <em>x0</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td></td>
<td class="md" nowrap><a class="el" href="a04558.html#a14">sint</a> & </td>
<td class="mdname" nowrap> <em>y0</em></td>
</tr>
<tr>
<td></td>
<td class="md">) </td>
<td class="md" colspan="2"><code> [inline, 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="a06436.html#l00114">114</a> of file <a class="el" href="a06436.html">static_quad_grid.h</a>.
<p>
Referenced by <a class="el" href="a06436.html#l00269">NL3D::CStaticQuadGrid< T >::select()</a>.
<p>
<div class="fragment"><pre>00115 {
00116 point/= <a class="code" href="a03439.html#NL3D_1_1CStaticQuadGridr2">_EltSize</a>;
00117 x0= (<a class="code" href="a04558.html#a14">sint</a>)(floor(point.x));
00118 y0= (<a class="code" href="a04558.html#a14">sint</a>)(floor(point.y));
00119
00120 x0&= <a class="code" href="a03439.html#NL3D_1_1CStaticQuadGridr4">_Size</a>-1;
00121 y0&= <a class="code" href="a03439.html#NL3D_1_1CStaticQuadGridr4">_Size</a>-1;
00122 }
</pre></div> </td>
</tr>
</table>
<hr><h2>Field Documentation</h2>
<a class="anchor" name="NL3D_1_1CStaticQuadGridr0" doxytag="NL3D::CStaticQuadGrid::_ChangeBasis" ></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" colspan="4">
template<class T> </td>
</tr>
<tr>
<td class="md" nowrap valign="top"> <a class="el" href="a02851.html">NLMISC::CMatrix</a> <a class="el" href="a03439.html">NL3D::CStaticQuadGrid</a>< T >::<a class="el" href="a03439.html#NL3D_1_1CStaticQuadGridr0">_ChangeBasis</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="a06436.html#l00110">110</a> of file <a class="el" href="a06436.html">static_quad_grid.h</a>. </td>
</tr>
</table>
<a class="anchor" name="NL3D_1_1CStaticQuadGridr1" doxytag="NL3D::CStaticQuadGrid::_Elements" ></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" colspan="4">
template<class T> </td>
</tr>
<tr>
<td class="md" nowrap valign="top"> std::vector<T> <a class="el" href="a03439.html">NL3D::CStaticQuadGrid</a>< T >::<a class="el" href="a03439.html#NL3D_1_1CStaticQuadGridr1">_Elements</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="a06436.html#l00105">105</a> of file <a class="el" href="a06436.html">static_quad_grid.h</a>. </td>
</tr>
</table>
<a class="anchor" name="NL3D_1_1CStaticQuadGridr2" doxytag="NL3D::CStaticQuadGrid::_EltSize" ></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" colspan="4">
template<class T> </td>
</tr>
<tr>
<td class="md" nowrap valign="top"> float <a class="el" href="a03439.html">NL3D::CStaticQuadGrid</a>< T >::<a class="el" href="a03439.html#NL3D_1_1CStaticQuadGridr2">_EltSize</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="a06436.html#l00109">109</a> of file <a class="el" href="a06436.html">static_quad_grid.h</a>. </td>
</tr>
</table>
<a class="anchor" name="NL3D_1_1CStaticQuadGridr3" doxytag="NL3D::CStaticQuadGrid::_Grid" ></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" colspan="4">
template<class T> </td>
</tr>
<tr>
<td class="md" nowrap valign="top"> std::vector<<a class="el" href="a03440.html">CQuadNode</a>> <a class="el" href="a03439.html">NL3D::CStaticQuadGrid</a>< T >::<a class="el" href="a03439.html#NL3D_1_1CStaticQuadGridr3">_Grid</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="a06436.html#l00106">106</a> of file <a class="el" href="a06436.html">static_quad_grid.h</a>. </td>
</tr>
</table>
<a class="anchor" name="NL3D_1_1CStaticQuadGridr4" doxytag="NL3D::CStaticQuadGrid::_Size" ></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" colspan="4">
template<class T> </td>
</tr>
<tr>
<td class="md" nowrap valign="top"> <a class="el" href="a04558.html#a14">sint</a> <a class="el" href="a03439.html">NL3D::CStaticQuadGrid</a>< T >::<a class="el" href="a03439.html#NL3D_1_1CStaticQuadGridr4">_Size</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="a06436.html#l00107">107</a> of file <a class="el" href="a06436.html">static_quad_grid.h</a>. </td>
</tr>
</table>
<a class="anchor" name="NL3D_1_1CStaticQuadGridr5" doxytag="NL3D::CStaticQuadGrid::_SizePower" ></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" colspan="4">
template<class T> </td>
</tr>
<tr>
<td class="md" nowrap valign="top"> <a class="el" href="a04558.html#a14">sint</a> <a class="el" href="a03439.html">NL3D::CStaticQuadGrid</a>< T >::<a class="el" href="a03439.html#NL3D_1_1CStaticQuadGridr5">_SizePower</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="a06436.html#l00108">108</a> of file <a class="el" href="a06436.html">static_quad_grid.h</a>. </td>
</tr>
</table>
<hr>The documentation for this class was generated from the following file:<ul>
<li><a class="el" href="a06436.html">static_quad_grid.h</a></ul>
<hr size="1"><address style="align: right;"><small>Generated on Tue Mar 16 07:47:26 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>
|