aboutsummaryrefslogtreecommitdiff
path: root/docs/doxygen/nel/a03117.html
blob: 041ce47574af8978acb6942fc50ce5dbaa031e6a (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
<!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: NLLIGO::CPrimitives 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>NLLIGO::CPrimitives Class Reference</h1><code>#include &lt;<a class="el" href="a06196.html">primitive.h</a>&gt;</code>
<p>
<hr><a name="_details"></a><h2>Detailed Description</h2>
This class is a ligo primitives set 
<p>

<p>
Definition at line <a class="el" href="a06196.html#l00520">520</a> of file <a class="el" href="a06196.html">primitive.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&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a03117.html#NLLIGO_1_1CPrimitivesa0">convert</a> (const <a class="el" href="a03126.html">CPrimRegion</a> &amp;region)</td></tr>

<tr><td class="memItemLeft" nowrap align=right valign=top>&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a03117.html#NLLIGO_1_1CPrimitivesa1">CPrimitives</a> (const <a class="el" href="a03117.html">CPrimitives</a> &amp;other)</td></tr>

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

<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a03117.html">CPrimitives</a> &amp;&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a03117.html#NLLIGO_1_1CPrimitivesa3">operator=</a> (const <a class="el" href="a03117.html">CPrimitives</a> &amp;other)</td></tr>

<tr><td class="memItemLeft" nowrap align=right valign=top>bool&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a03117.html#NLLIGO_1_1CPrimitivesa4">read</a> (xmlNodePtr xmlNode, const char *<a class="el" href="a04560.html#a1">filename</a>, <a class="el" href="a02756.html">CLigoConfig</a> &amp;config)</td></tr>

<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a03117.html#NLLIGO_1_1CPrimitivesa5">write</a> (xmlNodePtr root, const char *<a class="el" href="a04560.html#a1">filename</a>) const </td></tr>

<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a03117.html#NLLIGO_1_1CPrimitivesa6">write</a> (xmlDocPtr xmlNode, const char *<a class="el" href="a04560.html#a1">filename</a>) const </td></tr>

<tr><td class="memItemLeft" nowrap align=right valign=top>&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a03117.html#NLLIGO_1_1CPrimitivesa7">~CPrimitives</a> ()</td></tr>

<tr><td colspan=2><br><h2>Data Fields</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a03122.html">CPrimNode</a> *&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a03117.html#NLLIGO_1_1CPrimitiveso0">RootNode</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&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a03117.html#NLLIGO_1_1CPrimitivesd0">convertAddPrimitive</a> (<a class="el" href="a03123.html">IPrimitive</a> *child, const <a class="el" href="a03123.html">IPrimitive</a> *prim, bool hidden)</td></tr>

<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a03117.html#NLLIGO_1_1CPrimitivesd1">convertPrimitive</a> (const <a class="el" href="a03123.html">IPrimitive</a> *prim, bool hidden)</td></tr>

</table>
<hr><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" name="NLLIGO_1_1CPrimitivesa2" doxytag="NLLIGO::CPrimitives::CPrimitives" ></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"> NLLIGO::CPrimitives::CPrimitives </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>

<p>
Definition at line <a class="el" href="a06195.html#l01730">1730</a> of file <a class="el" href="a06195.html">primitive.cpp</a>.
<p>
<div class="fragment"><pre>01731 {
01732         <a class="code" href="a03117.html#NLLIGO_1_1CPrimitiveso0">RootNode</a> = static_cast&lt;CPrimNode *&gt; (CClassRegistry::create (<span class="stringliteral">"CPrimNode"</span>));
01733 }
</pre></div>    </td>
  </tr>
</table>
<a class="anchor" name="NLLIGO_1_1CPrimitivesa1" doxytag="NLLIGO::CPrimitives::CPrimitives" ></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"> NLLIGO::CPrimitives::CPrimitives </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">const <a class="el" href="a03117.html">CPrimitives</a> &amp;&nbsp;</td>
          <td class="mdname1" valign="top" nowrap> <em>other</em>          </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>

<p>
Definition at line <a class="el" href="a06195.html#l01737">1737</a> of file <a class="el" href="a06195.html">primitive.cpp</a>.
<p>
References <a class="el" href="a06196.html#l00535">RootNode</a>.
<p>
<div class="fragment"><pre>01738 {
01739         <a class="code" href="a03117.html#NLLIGO_1_1CPrimitiveso0">RootNode</a> = static_cast&lt;CPrimNode *&gt; (((IPrimitive*)other.RootNode)-&gt;copy ());
01740 }
</pre></div>    </td>
  </tr>
</table>
<a class="anchor" name="NLLIGO_1_1CPrimitivesa7" doxytag="NLLIGO::CPrimitives::~CPrimitives" ></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"> NLLIGO::CPrimitives::~<a class="el" href="a03117.html">CPrimitives</a> </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>

<p>
Definition at line <a class="el" href="a06195.html#l01744">1744</a> of file <a class="el" href="a06195.html">primitive.cpp</a>.
<p>
<div class="fragment"><pre>01745 {
01746         <span class="keyword">delete</span> <a class="code" href="a03117.html#NLLIGO_1_1CPrimitiveso0">RootNode</a>;
01747 }
</pre></div>    </td>
  </tr>
</table>
<hr><h2>Member Function Documentation</h2>
<a class="anchor" name="NLLIGO_1_1CPrimitivesa0" doxytag="NLLIGO::CPrimitives::convert" ></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 NLLIGO::CPrimitives::convert </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">const <a class="el" href="a03126.html">CPrimRegion</a> &amp;&nbsp;</td>
          <td class="mdname1" valign="top" nowrap> <em>region</em>          </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>

<p>
Definition at line <a class="el" href="a06195.html#l01959">1959</a> of file <a class="el" href="a06195.html">primitive.cpp</a>.
<p>
References <a class="el" href="a06195.html#l01910">convertPrimitive()</a>, <a class="el" href="a06195.html#l01337">NLLIGO::IPrimitive::removeChildren()</a>, <a class="el" href="a06195.html#l01274">NLLIGO::IPrimitive::removeProperties()</a>, <a class="el" href="a05981.html#l00105">uint</a>, <a class="el" href="a06196.html#l00508">NLLIGO::CPrimRegion::VHidePaths</a>, <a class="el" href="a06196.html#l00506">NLLIGO::CPrimRegion::VHidePoints</a>, <a class="el" href="a06196.html#l00507">NLLIGO::CPrimRegion::VHideZones</a>, <a class="el" href="a06196.html#l00504">NLLIGO::CPrimRegion::VPaths</a>, <a class="el" href="a06196.html#l00502">NLLIGO::CPrimRegion::VPoints</a>, and <a class="el" href="a06196.html#l00503">NLLIGO::CPrimRegion::VZones</a>.
<p>
<div class="fragment"><pre>01960 {
01961         <span class="comment">// Delete</span>
01962         <a class="code" href="a03117.html#NLLIGO_1_1CPrimitiveso0">RootNode</a>-&gt;removeChildren ();
01963         <a class="code" href="a03117.html#NLLIGO_1_1CPrimitiveso0">RootNode</a>-&gt;removeProperties ();
01964 
01965         <span class="comment">// For each primitives</span>
01966         <a class="code" href="a04558.html#a15">uint</a> i;
01967         <span class="keywordflow">for</span> (i=0; i&lt;region.VPoints.size (); i++)
01968         {
01969                 <a class="code" href="a03117.html#NLLIGO_1_1CPrimitivesd1">convertPrimitive</a> (&amp;(region.VPoints[i]), region.VHidePoints[i]);
01970         }
01971         <span class="keywordflow">for</span> (i=0; i&lt;region.VPaths.size (); i++)
01972         {
01973                 <a class="code" href="a03117.html#NLLIGO_1_1CPrimitivesd1">convertPrimitive</a> (&amp;(region.VPaths[i]), region.VHidePaths[i]);
01974         }
01975         <span class="keywordflow">for</span> (i=0; i&lt;region.VZones.size (); i++)
01976         {
01977                 <a class="code" href="a03117.html#NLLIGO_1_1CPrimitivesd1">convertPrimitive</a> (&amp;(region.VZones[i]), region.VHideZones[i]);
01978         }
01979 }
</pre></div>    </td>
  </tr>
</table>
<a class="anchor" name="NLLIGO_1_1CPrimitivesd0" doxytag="NLLIGO::CPrimitives::convertAddPrimitive" ></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 NLLIGO::CPrimitives::convertAddPrimitive </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top"><a class="el" href="a03123.html">IPrimitive</a> *&nbsp;</td>
          <td class="mdname" nowrap> <em>child</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td></td>
          <td class="md" nowrap>const <a class="el" href="a03123.html">IPrimitive</a> *&nbsp;</td>
          <td class="mdname" nowrap> <em>prim</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>hidden</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="a06195.html#l01839">1839</a> of file <a class="el" href="a06195.html">primitive.cpp</a>.
<p>
References <a class="el" href="a06195.html#l01384">NLLIGO::IPrimitive::addPropertyByName()</a>, <a class="el" href="a06195.html#l01349">NLLIGO::IPrimitive::insertChild()</a>, <a class="el" href="a06196.html#l00160">NLLIGO::IPrimitive::Name</a>, and <a class="el" href="a06196.html#l00088">NLLIGO::CPropertyString::String</a>.
<p>
Referenced by <a class="el" href="a06195.html#l01910">convertPrimitive()</a>.
<p>
<div class="fragment"><pre>01840 {
01841         <span class="comment">// The primitve</span>
01842         IPrimitive *primitive = NULL;
01843 
01844         <span class="comment">// What kind of primitive ?</span>
01845         <span class="keyword">const</span> CPrimPoint *oldPoint = dynamic_cast&lt;const CPrimPoint *&gt;(prim);
01846         <span class="keywordflow">if</span> (oldPoint)
01847         {
01848                 <span class="comment">// Create a primitive</span>
01849                 CPrimPoint *point = static_cast&lt;CPrimPoint *&gt; (CClassRegistry::create (<span class="stringliteral">"CPrimPoint"</span>));
01850                 primitive = point;
01851 
01852                 <span class="comment">// Copy it</span>
01853                 *point = *oldPoint;
01854         }
01855         <span class="keywordflow">else</span>
01856         {
01857                 <span class="comment">// Path ?</span>
01858                 <span class="keyword">const</span> CPrimPath *oldPath = dynamic_cast&lt;const CPrimPath *&gt;(prim);
01859                 <span class="keywordflow">if</span> (oldPath)
01860                 {
01861                         <span class="comment">// Create a primitive</span>
01862                         CPrimPath *path = static_cast&lt;CPrimPath *&gt; (CClassRegistry::create (<span class="stringliteral">"CPrimPath"</span>));
01863                         primitive = path;
01864 
01865                         <span class="comment">// Copy it</span>
01866                         *path = *oldPath;
01867                 }
01868                 <span class="keywordflow">else</span>
01869                 {
01870                         <span class="keyword">const</span> CPrimZone *oldZone = safe_cast&lt;const CPrimZone *&gt;(prim);
01871                         <span class="keywordflow">if</span> (oldZone)
01872                         {
01873                                 <span class="comment">// Create a primitive</span>
01874                                 CPrimZone *zone = static_cast&lt;CPrimZone *&gt; (CClassRegistry::create (<span class="stringliteral">"CPrimZone"</span>));
01875                                 primitive = zone;
01876 
01877                                 <span class="comment">// Copy it</span>
01878                                 *zone = *oldZone;
01879                         }
01880                 }
01881         }
01882 
01883         <span class="comment">// Primitive has been created ?</span>
01884         <span class="keywordflow">if</span> (primitive)
01885         {
01886                 <span class="comment">// Create a property for the name</span>
01887                 <a class="code" href="a03132.html">CPropertyString</a> *nameProp = <span class="keyword">new</span> <a class="code" href="a03132.html">CPropertyString</a>;
01888                 nameProp-&gt;<a class="code" href="a03132.html#NLLIGO_1_1CPropertyStringo1">String</a> = prim-&gt;Name;
01889 
01890                 <span class="comment">// Add the property</span>
01891                 primitive-&gt;addPropertyByName (<span class="stringliteral">"name"</span>, nameProp);
01892 
01893                 <span class="comment">// The primitive is hidden ?</span>
01894                 <span class="keywordflow">if</span> (hidden)
01895                 {
01896                         <span class="comment">// Create a property for hidden</span>
01897                         nameProp = <span class="keyword">new</span> CPropertyString;
01898 
01899                         <span class="comment">// Add the property</span>
01900                         primitive-&gt;addPropertyByName (<span class="stringliteral">"hidden"</span>, nameProp);
01901                 }
01902 
01903                 <span class="comment">// Add the child</span>
01904                 child-&gt;insertChild (primitive);
01905         }
01906 }
</pre></div>    </td>
  </tr>
</table>
<a class="anchor" name="NLLIGO_1_1CPrimitivesd1" doxytag="NLLIGO::CPrimitives::convertPrimitive" ></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 NLLIGO::CPrimitives::convertPrimitive </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">const <a class="el" href="a03123.html">IPrimitive</a> *&nbsp;</td>
          <td class="mdname" nowrap> <em>prim</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>hidden</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="a06195.html#l01910">1910</a> of file <a class="el" href="a06195.html">primitive.cpp</a>.
<p>
References <a class="el" href="a06195.html#l01384">NLLIGO::IPrimitive::addPropertyByName()</a>, <a class="el" href="a06195.html#l01839">convertAddPrimitive()</a>, <a class="el" href="a06195.html#l01287">NLLIGO::IPrimitive::getChild()</a>, <a class="el" href="a06196.html#l00183">NLLIGO::IPrimitive::getNumChildren()</a>, <a class="el" href="a06195.html#l01102">NLLIGO::IPrimitive::getPropertyByName()</a>, <a class="el" href="a06195.html#l01349">NLLIGO::IPrimitive::insertChild()</a>, <a class="el" href="a06196.html#l00159">NLLIGO::IPrimitive::Layer</a>, <a class="el" href="a05622.html#l00355">nlverify</a>, <a class="el" href="a06196.html#l00088">NLLIGO::CPropertyString::String</a>, and <a class="el" href="a05981.html#l00105">uint</a>.
<p>
Referenced by <a class="el" href="a06195.html#l01959">convert()</a>.
<p>
<div class="fragment"><pre>01911 {
01912         <span class="comment">// Look for the group</span>
01913         <a class="code" href="a04558.html#a15">uint</a> numChildren = <a class="code" href="a03117.html#NLLIGO_1_1CPrimitiveso0">RootNode</a>-&gt;getNumChildren ();
01914         <a class="code" href="a04558.html#a15">uint</a> j;
01915         <span class="keywordflow">for</span> (j=0; j&lt;numChildren; j++)
01916         {
01917                 IPrimitive *child;
01918                 <a class="code" href="a04199.html#a9">nlverify</a> (<a class="code" href="a03117.html#NLLIGO_1_1CPrimitiveso0">RootNode</a>-&gt;getChild (child, j));
01919                 <span class="keyword">const</span> <a class="code" href="a03131.html">IProperty</a> *prop;
01920                 <span class="keywordflow">if</span> (child-&gt;getPropertyByName (<span class="stringliteral">"name"</span>, prop))
01921                 {
01922                         <span class="comment">// Prop string</span>
01923                         <span class="keyword">const</span> <a class="code" href="a03132.html">CPropertyString</a> *name = dynamic_cast&lt;const CPropertyString *&gt;(prop);
01924                         <span class="keywordflow">if</span> (name)
01925                         {
01926                                 <span class="comment">// This one ?</span>
01927                                 <span class="keywordflow">if</span> (name-&gt;<a class="code" href="a03132.html#NLLIGO_1_1CPropertyStringo1">String</a> == prim-&gt;Layer)
01928                                 {
01929                                         <a class="code" href="a03117.html#NLLIGO_1_1CPrimitivesd0">convertAddPrimitive</a> (child, prim, hidden);
01930                                         <span class="keywordflow">break</span>;
01931                                 }
01932                         }
01933                 }
01934         }
01935 
01936         <span class="comment">// Not found ?</span>
01937         <span class="keywordflow">if</span> (j==numChildren)
01938         {
01939                 <span class="comment">// Create a node</span>
01940                 CPrimNode *primNode = static_cast&lt;CPrimNode *&gt; (CClassRegistry::create (<span class="stringliteral">"CPrimNode"</span>));
01941         
01942                 <span class="comment">// Create a property for the layer</span>
01943                 <a class="code" href="a03132.html">CPropertyString</a> *nameProp = <span class="keyword">new</span> <a class="code" href="a03132.html">CPropertyString</a>;
01944                 nameProp-&gt;<a class="code" href="a03132.html#NLLIGO_1_1CPropertyStringo1">String</a> = prim-&gt;Layer;
01945 
01946                 <span class="comment">// Add the property</span>
01947                 primNode-&gt;addPropertyByName (<span class="stringliteral">"name"</span>, nameProp);
01948 
01949                 <span class="comment">// Add the child</span>
01950                 <a class="code" href="a03117.html#NLLIGO_1_1CPrimitiveso0">RootNode</a>-&gt;insertChild (primNode);
01951 
01952                 <span class="comment">// Add the primitive</span>
01953                 <a class="code" href="a03117.html#NLLIGO_1_1CPrimitivesd0">convertAddPrimitive</a> (primNode, prim, hidden);
01954         }
01955 }
</pre></div>    </td>
  </tr>
</table>
<a class="anchor" name="NLLIGO_1_1CPrimitivesa3" doxytag="NLLIGO::CPrimitives::operator=" ></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="a03117.html">CPrimitives</a> &amp; NLLIGO::CPrimitives::operator= </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">const <a class="el" href="a03117.html">CPrimitives</a> &amp;&nbsp;</td>
          <td class="mdname1" valign="top" nowrap> <em>other</em>          </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>

<p>
Definition at line <a class="el" href="a06195.html#l01751">1751</a> of file <a class="el" href="a06195.html">primitive.cpp</a>.
<p>
References <a class="el" href="a06196.html#l00535">RootNode</a>.
<p>
<div class="fragment"><pre>01752 {
01753         <a class="code" href="a03117.html#NLLIGO_1_1CPrimitiveso0">RootNode</a> = static_cast&lt;CPrimNode *&gt; (((IPrimitive*)other.RootNode)-&gt;copy ());
01754         <span class="keywordflow">return</span> *<span class="keyword">this</span>;
01755 }
</pre></div>    </td>
  </tr>
</table>
<a class="anchor" name="NLLIGO_1_1CPrimitivesa4" doxytag="NLLIGO::CPrimitives::read" ></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 NLLIGO::CPrimitives::read </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">xmlNodePtr&nbsp;</td>
          <td class="mdname" nowrap> <em>xmlNode</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td></td>
          <td class="md" nowrap>const char *&nbsp;</td>
          <td class="mdname" nowrap> <em>filename</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td></td>
          <td class="md" nowrap><a class="el" href="a02756.html">CLigoConfig</a> &amp;&nbsp;</td>
          <td class="mdname" nowrap> <em>config</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>

<p>
Definition at line <a class="el" href="a06195.html#l01759">1759</a> of file <a class="el" href="a06195.html">primitive.cpp</a>.
<p>
References <a class="el" href="a06195.html#l00044">NLLIGO::Error()</a>, <a class="el" href="a06195.html#l00071">NLLIGO::GetFirstChildNode()</a>, <a class="el" href="a06195.html#l00089">NLLIGO::GetPropertyString()</a>, <a class="el" href="a05622.html#l00290">nlassert</a>, <a class="el" href="a06195.html#l00035">NLLIGO_PRIMITVE_VERSION</a>, <a class="el" href="a06195.html#l01337">NLLIGO::IPrimitive::removeChildren()</a>, <a class="el" href="a06195.html#l01274">NLLIGO::IPrimitive::removeProperties()</a>, <a class="el" href="a05981.html#l00105">uint</a>, and <a class="el" href="a06195.html#l00057">NLLIGO::XMLError()</a>.
<p>
Referenced by <a class="el" href="a05471.html#l00618">NLSOUND::CBackgroundSoundManager::load()</a>.
<p>
<div class="fragment"><pre>01760 {
01761         <a class="code" href="a04199.html#a6">nlassert</a> (xmlNode);
01762 
01763         <span class="comment">// Clear the primitives</span>
01764         <a class="code" href="a03117.html#NLLIGO_1_1CPrimitiveso0">RootNode</a>-&gt;removeChildren ();
01765         <a class="code" href="a03117.html#NLLIGO_1_1CPrimitiveso0">RootNode</a>-&gt;removeProperties ();
01766 
01767         <span class="comment">// Get the name</span>
01768         <span class="keywordflow">if</span> (strcmp ((<span class="keyword">const</span> <span class="keywordtype">char</span>*)xmlNode-&gt;name, <span class="stringliteral">"PRIMITIVES"</span>) == 0)
01769         {
01770                 <span class="comment">// Get the version</span>
01771                 string versionName = <span class="stringliteral">"0"</span>;
01772                 <span class="keywordflow">if</span> (<a class="code" href="a05375.html#a5">GetPropertyString</a> (versionName, filename, xmlNode, <span class="stringliteral">"VERSION"</span>))
01773                 {
01774                         <span class="comment">// Get the version</span>
01775                         <a class="code" href="a04558.html#a15">uint</a> version = atoi (versionName.c_str ());
01776 
01777                         <span class="comment">// Check the version</span>
01778                         <span class="keywordflow">if</span> (version &lt;= <a class="code" href="a04772.html#a0">NLLIGO_PRIMITVE_VERSION</a>)
01779                         {
01780                                 <span class="comment">// Read the primitives</span>
01781                                 xmlNode = <a class="code" href="a05375.html#a4">GetFirstChildNode</a> (xmlNode, filename, <span class="stringliteral">"ROOT_PRIMITIVE"</span>);
01782                                 <span class="keywordflow">if</span> (xmlNode)
01783                                 {
01784                                         <span class="comment">// Read the primitive tree</span>
01785                                         ((IPrimitive*)<a class="code" href="a03117.html#NLLIGO_1_1CPrimitiveso0">RootNode</a>)-&gt;read (xmlNode, filename, version, config);
01786                                 }
01787                         }
01788                         <span class="keywordflow">else</span>
01789                         {
01790                                 <a class="code" href="a05375.html#a2">Error</a> (filename, <span class="stringliteral">"CPrimitives::read : Unknown file version (%d)"</span>, version);
01791                                 <span class="keywordflow">return</span> <span class="keyword">false</span>;
01792                         }
01793                 }
01794                 <span class="keywordflow">else</span>
01795                 {
01796                         <span class="keywordflow">return</span> <span class="keyword">false</span>;
01797                 }
01798         }
01799         <span class="keywordflow">else</span>
01800         {
01801                 <a class="code" href="a05375.html#a3">XMLError</a> (xmlNode, filename, <span class="stringliteral">"This XML document is not a NeL primitive file"</span>);
01802                 <span class="keywordflow">return</span> <span class="keyword">false</span>;
01803         }
01804 
01805         <span class="keywordflow">return</span> <span class="keyword">true</span>;
01806 }
</pre></div>    </td>
  </tr>
</table>
<a class="anchor" name="NLLIGO_1_1CPrimitivesa5" doxytag="NLLIGO::CPrimitives::write" ></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 NLLIGO::CPrimitives::write </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">xmlNodePtr&nbsp;</td>
          <td class="mdname" nowrap> <em>root</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td></td>
          <td class="md" nowrap>const char *&nbsp;</td>
          <td class="mdname" nowrap> <em>filename</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>

<p>
Definition at line <a class="el" href="a06195.html#l01823">1823</a> of file <a class="el" href="a06195.html">primitive.cpp</a>.
<p>
References <a class="el" href="a05622.html#l00290">nlassert</a>, <a class="el" href="a06195.html#l00035">NLLIGO_PRIMITVE_VERSION</a>, and <a class="el" href="a06229.html#l02652">NLMISC::toString()</a>.
<p>
<div class="fragment"><pre>01824 {
01825         <a class="code" href="a04199.html#a6">nlassert</a> (root);
01826 
01827         <span class="comment">// Version node</span>
01828         xmlSetProp (root, (<span class="keyword">const</span> xmlChar*)<span class="stringliteral">"VERSION"</span>, (<span class="keyword">const</span> xmlChar*)toString (NLLIGO_PRIMITVE_VERSION).c_str ());
01829 
01830         <span class="comment">// The primitive root node</span>
01831         xmlNodePtr nameNode = xmlNewChild ( root, NULL, (<span class="keyword">const</span> xmlChar*)<span class="stringliteral">"ROOT_PRIMITIVE"</span>, NULL);
01832 
01833         <span class="comment">// Write the primitive tree</span>
01834         ((IPrimitive*)<a class="code" href="a03117.html#NLLIGO_1_1CPrimitiveso0">RootNode</a>)-&gt;write (nameNode, filename);
01835 }
</pre></div>    </td>
  </tr>
</table>
<a class="anchor" name="NLLIGO_1_1CPrimitivesa6" doxytag="NLLIGO::CPrimitives::write" ></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 NLLIGO::CPrimitives::write </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">xmlDocPtr&nbsp;</td>
          <td class="mdname" nowrap> <em>xmlNode</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td></td>
          <td class="md" nowrap>const char *&nbsp;</td>
          <td class="mdname" nowrap> <em>filename</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>

<p>
Definition at line <a class="el" href="a06195.html#l01810">1810</a> of file <a class="el" href="a06195.html">primitive.cpp</a>.
<p>
References <a class="el" href="a05622.html#l00290">nlassert</a>.
<p>
<div class="fragment"><pre>01811 {
01812         <a class="code" href="a04199.html#a6">nlassert</a> (doc);
01813 
01814         <span class="comment">// Primitive node</span>
01815         xmlNodePtr primNode = xmlNewDocNode (doc, NULL, (<span class="keyword">const</span> xmlChar*)<span class="stringliteral">"PRIMITIVES"</span>, NULL);
01816         xmlDocSetRootElement (doc, primNode);
01817 
01818         <a class="code" href="a03117.html#NLLIGO_1_1CPrimitivesa6">write</a> (primNode, filename);
01819 }
</pre></div>    </td>
  </tr>
</table>
<hr><h2>Field Documentation</h2>
<a class="anchor" name="NLLIGO_1_1CPrimitiveso0" doxytag="NLLIGO::CPrimitives::RootNode" ></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="a03122.html">CPrimNode</a>* <a class="el" href="a03117.html#NLLIGO_1_1CPrimitiveso0">NLLIGO::CPrimitives::RootNode</a>
      </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="a06196.html#l00535">535</a> of file <a class="el" href="a06196.html">primitive.h</a>.
<p>
Referenced by <a class="el" href="a06195.html#l01737">CPrimitives()</a>, <a class="el" href="a05471.html#l00618">NLSOUND::CBackgroundSoundManager::load()</a>, and <a class="el" href="a06195.html#l01751">operator=()</a>.    </td>
  </tr>
</table>
<hr>The documentation for this class was generated from the following files:<ul>
<li><a class="el" href="a06196.html">primitive.h</a><li><a class="el" href="a06195.html">primitive.cpp</a></ul>
<hr size="1"><address style="align: right;"><small>Generated on Tue Mar 16 12:48:50 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>