~ubuntu-branches/ubuntu/warty/aqsis/warty

« back to all changes in this revision

Viewing changes to render/ri_cache.inl

  • Committer: Bazaar Package Importer
  • Author(s): LaMont Jones
  • Date: 2004-08-24 07:25:04 UTC
  • Revision ID: james.westby@ubuntu.com-20040824072504-zf993vnevvisdsvb
Tags: upstream-0.9.1
ImportĀ upstreamĀ versionĀ 0.9.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
class RiDeclareCache : public RiCacheBase
 
2
{
 
3
public:
 
4
        RiDeclareCache(RtString name, RtString declaration) : RiCacheBase()
 
5
        {
 
6
                int __name_length = strlen(name);
 
7
                m_name = new char[ __name_length + 1 ];
 
8
                strcpy(m_name, name);
 
9
                int __declaration_length = strlen(declaration);
 
10
                m_declaration = new char[ __declaration_length + 1 ];
 
11
                strcpy(m_declaration, declaration);
 
12
        }
 
13
        virtual ~RiDeclareCache()
 
14
        {
 
15
                delete[](m_name);
 
16
                delete[](m_declaration);
 
17
        }
 
18
        virtual void ReCall()
 
19
        {
 
20
                RiDeclare(m_name, m_declaration);
 
21
        }
 
22
 
 
23
private:
 
24
        RtString m_name;
 
25
        RtString m_declaration;
 
26
};
 
27
 
 
28
class RiFrameBeginCache : public RiCacheBase
 
29
{
 
30
public:
 
31
        RiFrameBeginCache(RtInt number) : RiCacheBase()
 
32
        {
 
33
                m_number = number;
 
34
        }
 
35
        virtual ~RiFrameBeginCache()
 
36
        {
 
37
        }
 
38
        virtual void ReCall()
 
39
        {
 
40
                RiFrameBegin(m_number);
 
41
        }
 
42
 
 
43
private:
 
44
        RtInt m_number;
 
45
};
 
46
 
 
47
class RiFrameEndCache : public RiCacheBase
 
48
{
 
49
public:
 
50
        RiFrameEndCache() : RiCacheBase()
 
51
        {
 
52
        }
 
53
        virtual ~RiFrameEndCache()
 
54
        {
 
55
        }
 
56
        virtual void ReCall()
 
57
        {
 
58
                RiFrameEnd();
 
59
        }
 
60
 
 
61
private:
 
62
};
 
63
 
 
64
class RiWorldBeginCache : public RiCacheBase
 
65
{
 
66
public:
 
67
        RiWorldBeginCache() : RiCacheBase()
 
68
        {
 
69
        }
 
70
        virtual ~RiWorldBeginCache()
 
71
        {
 
72
        }
 
73
        virtual void ReCall()
 
74
        {
 
75
                RiWorldBegin();
 
76
        }
 
77
 
 
78
private:
 
79
};
 
80
 
 
81
class RiWorldEndCache : public RiCacheBase
 
82
{
 
83
public:
 
84
        RiWorldEndCache() : RiCacheBase()
 
85
        {
 
86
        }
 
87
        virtual ~RiWorldEndCache()
 
88
        {
 
89
        }
 
90
        virtual void ReCall()
 
91
        {
 
92
                RiWorldEnd();
 
93
        }
 
94
 
 
95
private:
 
96
};
 
97
 
 
98
class RiFormatCache : public RiCacheBase
 
99
{
 
100
public:
 
101
        RiFormatCache(RtInt xresolution, RtInt yresolution, RtFloat pixelaspectratio) : RiCacheBase()
 
102
        {
 
103
                m_xresolution = xresolution;
 
104
                m_yresolution = yresolution;
 
105
                m_pixelaspectratio = pixelaspectratio;
 
106
        }
 
107
        virtual ~RiFormatCache()
 
108
        {
 
109
        }
 
110
        virtual void ReCall()
 
111
        {
 
112
                RiFormat(m_xresolution, m_yresolution, m_pixelaspectratio);
 
113
        }
 
114
 
 
115
private:
 
116
        RtInt m_xresolution;
 
117
        RtInt m_yresolution;
 
118
        RtFloat m_pixelaspectratio;
 
119
};
 
120
 
 
121
class RiFrameAspectRatioCache : public RiCacheBase
 
122
{
 
123
public:
 
124
        RiFrameAspectRatioCache(RtFloat frameratio) : RiCacheBase()
 
125
        {
 
126
                m_frameratio = frameratio;
 
127
        }
 
128
        virtual ~RiFrameAspectRatioCache()
 
129
        {
 
130
        }
 
131
        virtual void ReCall()
 
132
        {
 
133
                RiFrameAspectRatio(m_frameratio);
 
134
        }
 
135
 
 
136
private:
 
137
        RtFloat m_frameratio;
 
138
};
 
139
 
 
140
class RiScreenWindowCache : public RiCacheBase
 
141
{
 
142
public:
 
143
        RiScreenWindowCache(RtFloat left, RtFloat right, RtFloat bottom, RtFloat top) : RiCacheBase()
 
144
        {
 
145
                m_left = left;
 
146
                m_right = right;
 
147
                m_bottom = bottom;
 
148
                m_top = top;
 
149
        }
 
150
        virtual ~RiScreenWindowCache()
 
151
        {
 
152
        }
 
153
        virtual void ReCall()
 
154
        {
 
155
                RiScreenWindow(m_left, m_right, m_bottom, m_top);
 
156
        }
 
157
 
 
158
private:
 
159
        RtFloat m_left;
 
160
        RtFloat m_right;
 
161
        RtFloat m_bottom;
 
162
        RtFloat m_top;
 
163
};
 
164
 
 
165
class RiCropWindowCache : public RiCacheBase
 
166
{
 
167
public:
 
168
        RiCropWindowCache(RtFloat left, RtFloat right, RtFloat top, RtFloat bottom) : RiCacheBase()
 
169
        {
 
170
                m_left = left;
 
171
                m_right = right;
 
172
                m_top = top;
 
173
                m_bottom = bottom;
 
174
        }
 
175
        virtual ~RiCropWindowCache()
 
176
        {
 
177
        }
 
178
        virtual void ReCall()
 
179
        {
 
180
                RiCropWindow(m_left, m_right, m_top, m_bottom);
 
181
        }
 
182
 
 
183
private:
 
184
        RtFloat m_left;
 
185
        RtFloat m_right;
 
186
        RtFloat m_top;
 
187
        RtFloat m_bottom;
 
188
};
 
189
 
 
190
class RiProjectionCache : public RiCacheBase
 
191
{
 
192
public:
 
193
        RiProjectionCache(RtToken name, RtInt count, RtToken tokens[], RtPointer values[]) : RiCacheBase()
 
194
        {
 
195
                int __name_length = strlen(name);
 
196
                m_name = new char[ __name_length + 1 ];
 
197
                strcpy(m_name, name);
 
198
                // Copy the plist here.
 
199
                int constant_size = 1;
 
200
                int uniform_size = 1;
 
201
                int varying_size = 1;
 
202
                int vertex_size = 1;
 
203
                int facevarying_size = 1;
 
204
                CachePlist(count, tokens, values, constant_size, uniform_size, varying_size, vertex_size, facevarying_size);
 
205
        }
 
206
        virtual ~RiProjectionCache()
 
207
        {
 
208
                delete[](m_name);
 
209
                // plist gets destroyed by the base class.
 
210
        }
 
211
        virtual void ReCall()
 
212
        {
 
213
                RiProjectionV(m_name, m_count, m_tokens, m_values);
 
214
        }
 
215
 
 
216
private:
 
217
        RtToken m_name;
 
218
        // plist information is stored in the base class.
 
219
};
 
220
 
 
221
class RiClippingCache : public RiCacheBase
 
222
{
 
223
public:
 
224
        RiClippingCache(RtFloat cnear, RtFloat cfar) : RiCacheBase()
 
225
        {
 
226
                m_cnear = cnear;
 
227
                m_cfar = cfar;
 
228
        }
 
229
        virtual ~RiClippingCache()
 
230
        {
 
231
        }
 
232
        virtual void ReCall()
 
233
        {
 
234
                RiClipping(m_cnear, m_cfar);
 
235
        }
 
236
 
 
237
private:
 
238
        RtFloat m_cnear;
 
239
        RtFloat m_cfar;
 
240
};
 
241
 
 
242
class RiDepthOfFieldCache : public RiCacheBase
 
243
{
 
244
public:
 
245
        RiDepthOfFieldCache(RtFloat fstop, RtFloat focallength, RtFloat focaldistance) : RiCacheBase()
 
246
        {
 
247
                m_fstop = fstop;
 
248
                m_focallength = focallength;
 
249
                m_focaldistance = focaldistance;
 
250
        }
 
251
        virtual ~RiDepthOfFieldCache()
 
252
        {
 
253
        }
 
254
        virtual void ReCall()
 
255
        {
 
256
                RiDepthOfField(m_fstop, m_focallength, m_focaldistance);
 
257
        }
 
258
 
 
259
private:
 
260
        RtFloat m_fstop;
 
261
        RtFloat m_focallength;
 
262
        RtFloat m_focaldistance;
 
263
};
 
264
 
 
265
class RiShutterCache : public RiCacheBase
 
266
{
 
267
public:
 
268
        RiShutterCache(RtFloat opentime, RtFloat closetime) : RiCacheBase()
 
269
        {
 
270
                m_opentime = opentime;
 
271
                m_closetime = closetime;
 
272
        }
 
273
        virtual ~RiShutterCache()
 
274
        {
 
275
        }
 
276
        virtual void ReCall()
 
277
        {
 
278
                RiShutter(m_opentime, m_closetime);
 
279
        }
 
280
 
 
281
private:
 
282
        RtFloat m_opentime;
 
283
        RtFloat m_closetime;
 
284
};
 
285
 
 
286
class RiPixelVarianceCache : public RiCacheBase
 
287
{
 
288
public:
 
289
        RiPixelVarianceCache(RtFloat variance) : RiCacheBase()
 
290
        {
 
291
                m_variance = variance;
 
292
        }
 
293
        virtual ~RiPixelVarianceCache()
 
294
        {
 
295
        }
 
296
        virtual void ReCall()
 
297
        {
 
298
                RiPixelVariance(m_variance);
 
299
        }
 
300
 
 
301
private:
 
302
        RtFloat m_variance;
 
303
};
 
304
 
 
305
class RiPixelSamplesCache : public RiCacheBase
 
306
{
 
307
public:
 
308
        RiPixelSamplesCache(RtFloat xsamples, RtFloat ysamples) : RiCacheBase()
 
309
        {
 
310
                m_xsamples = xsamples;
 
311
                m_ysamples = ysamples;
 
312
        }
 
313
        virtual ~RiPixelSamplesCache()
 
314
        {
 
315
        }
 
316
        virtual void ReCall()
 
317
        {
 
318
                RiPixelSamples(m_xsamples, m_ysamples);
 
319
        }
 
320
 
 
321
private:
 
322
        RtFloat m_xsamples;
 
323
        RtFloat m_ysamples;
 
324
};
 
325
 
 
326
class RiPixelFilterCache : public RiCacheBase
 
327
{
 
328
public:
 
329
        RiPixelFilterCache(RtFilterFunc function, RtFloat xwidth, RtFloat ywidth) : RiCacheBase()
 
330
        {
 
331
                m_function = function;
 
332
                m_xwidth = xwidth;
 
333
                m_ywidth = ywidth;
 
334
        }
 
335
        virtual ~RiPixelFilterCache()
 
336
        {
 
337
        }
 
338
        virtual void ReCall()
 
339
        {
 
340
                RiPixelFilter(m_function, m_xwidth, m_ywidth);
 
341
        }
 
342
 
 
343
private:
 
344
        RtFilterFunc m_function;
 
345
        RtFloat m_xwidth;
 
346
        RtFloat m_ywidth;
 
347
};
 
348
 
 
349
class RiExposureCache : public RiCacheBase
 
350
{
 
351
public:
 
352
        RiExposureCache(RtFloat gain, RtFloat gamma) : RiCacheBase()
 
353
        {
 
354
                m_gain = gain;
 
355
                m_gamma = gamma;
 
356
        }
 
357
        virtual ~RiExposureCache()
 
358
        {
 
359
        }
 
360
        virtual void ReCall()
 
361
        {
 
362
                RiExposure(m_gain, m_gamma);
 
363
        }
 
364
 
 
365
private:
 
366
        RtFloat m_gain;
 
367
        RtFloat m_gamma;
 
368
};
 
369
 
 
370
class RiImagerCache : public RiCacheBase
 
371
{
 
372
public:
 
373
        RiImagerCache(RtToken name, RtInt count, RtToken tokens[], RtPointer values[]) : RiCacheBase()
 
374
        {
 
375
                int __name_length = strlen(name);
 
376
                m_name = new char[ __name_length + 1 ];
 
377
                strcpy(m_name, name);
 
378
                // Copy the plist here.
 
379
                int constant_size = 1;
 
380
                int uniform_size = 1;
 
381
                int varying_size = 1;
 
382
                int vertex_size = 1;
 
383
                int facevarying_size = 1;
 
384
                CachePlist(count, tokens, values, constant_size, uniform_size, varying_size, vertex_size, facevarying_size);
 
385
        }
 
386
        virtual ~RiImagerCache()
 
387
        {
 
388
                delete[](m_name);
 
389
                // plist gets destroyed by the base class.
 
390
        }
 
391
        virtual void ReCall()
 
392
        {
 
393
                RiImagerV(m_name, m_count, m_tokens, m_values);
 
394
        }
 
395
 
 
396
private:
 
397
        RtToken m_name;
 
398
        // plist information is stored in the base class.
 
399
};
 
400
 
 
401
class RiQuantizeCache : public RiCacheBase
 
402
{
 
403
public:
 
404
        RiQuantizeCache(RtToken type, RtInt one, RtInt min, RtInt max, RtFloat ditheramplitude) : RiCacheBase()
 
405
        {
 
406
                int __type_length = strlen(type);
 
407
                m_type = new char[ __type_length + 1 ];
 
408
                strcpy(m_type, type);
 
409
                m_one = one;
 
410
                m_min = min;
 
411
                m_max = max;
 
412
                m_ditheramplitude = ditheramplitude;
 
413
        }
 
414
        virtual ~RiQuantizeCache()
 
415
        {
 
416
                delete[](m_type);
 
417
        }
 
418
        virtual void ReCall()
 
419
        {
 
420
                RiQuantize(m_type, m_one, m_min, m_max, m_ditheramplitude);
 
421
        }
 
422
 
 
423
private:
 
424
        RtToken m_type;
 
425
        RtInt m_one;
 
426
        RtInt m_min;
 
427
        RtInt m_max;
 
428
        RtFloat m_ditheramplitude;
 
429
};
 
430
 
 
431
class RiDisplayCache : public RiCacheBase
 
432
{
 
433
public:
 
434
        RiDisplayCache(RtToken name, RtToken type, RtToken mode, RtInt count, RtToken tokens[], RtPointer values[]) : RiCacheBase()
 
435
        {
 
436
                int __name_length = strlen(name);
 
437
                m_name = new char[ __name_length + 1 ];
 
438
                strcpy(m_name, name);
 
439
                int __type_length = strlen(type);
 
440
                m_type = new char[ __type_length + 1 ];
 
441
                strcpy(m_type, type);
 
442
                int __mode_length = strlen(mode);
 
443
                m_mode = new char[ __mode_length + 1 ];
 
444
                strcpy(m_mode, mode);
 
445
                // Copy the plist here.
 
446
                int constant_size = 1;
 
447
                int uniform_size = 1;
 
448
                int varying_size = 1;
 
449
                int vertex_size = 1;
 
450
                int facevarying_size = 1;
 
451
                CachePlist(count, tokens, values, constant_size, uniform_size, varying_size, vertex_size, facevarying_size);
 
452
        }
 
453
        virtual ~RiDisplayCache()
 
454
        {
 
455
                delete[](m_name);
 
456
                delete[](m_type);
 
457
                delete[](m_mode);
 
458
                // plist gets destroyed by the base class.
 
459
        }
 
460
        virtual void ReCall()
 
461
        {
 
462
                RiDisplayV(m_name, m_type, m_mode, m_count, m_tokens, m_values);
 
463
        }
 
464
 
 
465
private:
 
466
        RtToken m_name;
 
467
        RtToken m_type;
 
468
        RtToken m_mode;
 
469
        // plist information is stored in the base class.
 
470
};
 
471
 
 
472
class RiHiderCache : public RiCacheBase
 
473
{
 
474
public:
 
475
        RiHiderCache(RtToken name, RtInt count, RtToken tokens[], RtPointer values[]) : RiCacheBase()
 
476
        {
 
477
                int __name_length = strlen(name);
 
478
                m_name = new char[ __name_length + 1 ];
 
479
                strcpy(m_name, name);
 
480
                // Copy the plist here.
 
481
                int constant_size = 1;
 
482
                int uniform_size = 1;
 
483
                int varying_size = 1;
 
484
                int vertex_size = 1;
 
485
                int facevarying_size = 1;
 
486
                CachePlist(count, tokens, values, constant_size, uniform_size, varying_size, vertex_size, facevarying_size);
 
487
        }
 
488
        virtual ~RiHiderCache()
 
489
        {
 
490
                delete[](m_name);
 
491
                // plist gets destroyed by the base class.
 
492
        }
 
493
        virtual void ReCall()
 
494
        {
 
495
                RiHiderV(m_name, m_count, m_tokens, m_values);
 
496
        }
 
497
 
 
498
private:
 
499
        RtToken m_name;
 
500
        // plist information is stored in the base class.
 
501
};
 
502
 
 
503
class RiColorSamplesCache : public RiCacheBase
 
504
{
 
505
public:
 
506
        RiColorSamplesCache(RtInt N, RtFloat nRGB[], RtFloat RGBn[]) : RiCacheBase()
 
507
        {
 
508
                m_N = N;
 
509
                int __nRGB_length = N;
 
510
                m_nRGB = new RtFloat[__nRGB_length];
 
511
                int __nRGB_index;
 
512
                for(__nRGB_index = 0; __nRGB_index<__nRGB_length; __nRGB_index++)
 
513
                {
 
514
                        m_nRGB[__nRGB_index] = nRGB[__nRGB_index];
 
515
                }
 
516
                int __RGBn_length = N;
 
517
                m_RGBn = new RtFloat[__RGBn_length];
 
518
                int __RGBn_index;
 
519
                for(__RGBn_index = 0; __RGBn_index<__RGBn_length; __RGBn_index++)
 
520
                {
 
521
                        m_RGBn[__RGBn_index] = RGBn[__RGBn_index];
 
522
                }
 
523
        }
 
524
        virtual ~RiColorSamplesCache()
 
525
        {
 
526
                delete[](m_nRGB);
 
527
                delete[](m_RGBn);
 
528
        }
 
529
        virtual void ReCall()
 
530
        {
 
531
                RiColorSamples(m_N, m_nRGB, m_RGBn);
 
532
        }
 
533
 
 
534
private:
 
535
        RtInt m_N;
 
536
        RtFloat* m_nRGB;
 
537
        RtFloat* m_RGBn;
 
538
};
 
539
 
 
540
class RiRelativeDetailCache : public RiCacheBase
 
541
{
 
542
public:
 
543
        RiRelativeDetailCache(RtFloat relativedetail) : RiCacheBase()
 
544
        {
 
545
                m_relativedetail = relativedetail;
 
546
        }
 
547
        virtual ~RiRelativeDetailCache()
 
548
        {
 
549
        }
 
550
        virtual void ReCall()
 
551
        {
 
552
                RiRelativeDetail(m_relativedetail);
 
553
        }
 
554
 
 
555
private:
 
556
        RtFloat m_relativedetail;
 
557
};
 
558
 
 
559
class RiOptionCache : public RiCacheBase
 
560
{
 
561
public:
 
562
        RiOptionCache(RtToken name, RtInt count, RtToken tokens[], RtPointer values[]) : RiCacheBase()
 
563
        {
 
564
                int __name_length = strlen(name);
 
565
                m_name = new char[ __name_length + 1 ];
 
566
                strcpy(m_name, name);
 
567
                // Copy the plist here.
 
568
                int constant_size = 1;
 
569
                int uniform_size = 1;
 
570
                int varying_size = 1;
 
571
                int vertex_size = 1;
 
572
                int facevarying_size = 1;
 
573
                CachePlist(count, tokens, values, constant_size, uniform_size, varying_size, vertex_size, facevarying_size);
 
574
        }
 
575
        virtual ~RiOptionCache()
 
576
        {
 
577
                delete[](m_name);
 
578
                // plist gets destroyed by the base class.
 
579
        }
 
580
        virtual void ReCall()
 
581
        {
 
582
                RiOptionV(m_name, m_count, m_tokens, m_values);
 
583
        }
 
584
 
 
585
private:
 
586
        RtToken m_name;
 
587
        // plist information is stored in the base class.
 
588
};
 
589
 
 
590
class RiAttributeBeginCache : public RiCacheBase
 
591
{
 
592
public:
 
593
        RiAttributeBeginCache() : RiCacheBase()
 
594
        {
 
595
        }
 
596
        virtual ~RiAttributeBeginCache()
 
597
        {
 
598
        }
 
599
        virtual void ReCall()
 
600
        {
 
601
                RiAttributeBegin();
 
602
        }
 
603
 
 
604
private:
 
605
};
 
606
 
 
607
class RiAttributeEndCache : public RiCacheBase
 
608
{
 
609
public:
 
610
        RiAttributeEndCache() : RiCacheBase()
 
611
        {
 
612
        }
 
613
        virtual ~RiAttributeEndCache()
 
614
        {
 
615
        }
 
616
        virtual void ReCall()
 
617
        {
 
618
                RiAttributeEnd();
 
619
        }
 
620
 
 
621
private:
 
622
};
 
623
 
 
624
class RiColorCache : public RiCacheBase
 
625
{
 
626
public:
 
627
        RiColorCache(RtColor Cq) : RiCacheBase()
 
628
        {
 
629
                m_Cq[0] = Cq[0];
 
630
                m_Cq[1] = Cq[1];
 
631
                m_Cq[2] = Cq[2];
 
632
        }
 
633
        virtual ~RiColorCache()
 
634
        {
 
635
        }
 
636
        virtual void ReCall()
 
637
        {
 
638
                RiColor(m_Cq);
 
639
        }
 
640
 
 
641
private:
 
642
        RtColor m_Cq;
 
643
};
 
644
 
 
645
class RiOpacityCache : public RiCacheBase
 
646
{
 
647
public:
 
648
        RiOpacityCache(RtColor Os) : RiCacheBase()
 
649
        {
 
650
                m_Os[0] = Os[0];
 
651
                m_Os[1] = Os[1];
 
652
                m_Os[2] = Os[2];
 
653
        }
 
654
        virtual ~RiOpacityCache()
 
655
        {
 
656
        }
 
657
        virtual void ReCall()
 
658
        {
 
659
                RiOpacity(m_Os);
 
660
        }
 
661
 
 
662
private:
 
663
        RtColor m_Os;
 
664
};
 
665
 
 
666
class RiTextureCoordinatesCache : public RiCacheBase
 
667
{
 
668
public:
 
669
        RiTextureCoordinatesCache(RtFloat s1, RtFloat t1, RtFloat s2, RtFloat t2, RtFloat s3, RtFloat t3, RtFloat s4, RtFloat t4) : RiCacheBase()
 
670
        {
 
671
                m_s1 = s1;
 
672
                m_t1 = t1;
 
673
                m_s2 = s2;
 
674
                m_t2 = t2;
 
675
                m_s3 = s3;
 
676
                m_t3 = t3;
 
677
                m_s4 = s4;
 
678
                m_t4 = t4;
 
679
        }
 
680
        virtual ~RiTextureCoordinatesCache()
 
681
        {
 
682
        }
 
683
        virtual void ReCall()
 
684
        {
 
685
                RiTextureCoordinates(m_s1, m_t1, m_s2, m_t2, m_s3, m_t3, m_s4, m_t4);
 
686
        }
 
687
 
 
688
private:
 
689
        RtFloat m_s1;
 
690
        RtFloat m_t1;
 
691
        RtFloat m_s2;
 
692
        RtFloat m_t2;
 
693
        RtFloat m_s3;
 
694
        RtFloat m_t3;
 
695
        RtFloat m_s4;
 
696
        RtFloat m_t4;
 
697
};
 
698
 
 
699
class RiLightSourceCache : public RiCacheBase
 
700
{
 
701
public:
 
702
        RiLightSourceCache(RtToken name, RtInt count, RtToken tokens[], RtPointer values[]) : RiCacheBase()
 
703
        {
 
704
                int __name_length = strlen(name);
 
705
                m_name = new char[ __name_length + 1 ];
 
706
                strcpy(m_name, name);
 
707
                // Copy the plist here.
 
708
                int constant_size = 1;
 
709
                int uniform_size = 1;
 
710
                int varying_size = 1;
 
711
                int vertex_size = 1;
 
712
                int facevarying_size = 1;
 
713
                CachePlist(count, tokens, values, constant_size, uniform_size, varying_size, vertex_size, facevarying_size);
 
714
        }
 
715
        virtual ~RiLightSourceCache()
 
716
        {
 
717
                delete[](m_name);
 
718
                // plist gets destroyed by the base class.
 
719
        }
 
720
        virtual void ReCall()
 
721
        {
 
722
                RiLightSourceV(m_name, m_count, m_tokens, m_values);
 
723
        }
 
724
 
 
725
private:
 
726
        RtToken m_name;
 
727
        // plist information is stored in the base class.
 
728
};
 
729
 
 
730
class RiAreaLightSourceCache : public RiCacheBase
 
731
{
 
732
public:
 
733
        RiAreaLightSourceCache(RtToken name, RtInt count, RtToken tokens[], RtPointer values[]) : RiCacheBase()
 
734
        {
 
735
                int __name_length = strlen(name);
 
736
                m_name = new char[ __name_length + 1 ];
 
737
                strcpy(m_name, name);
 
738
                // Copy the plist here.
 
739
                int constant_size = 1;
 
740
                int uniform_size = 1;
 
741
                int varying_size = 1;
 
742
                int vertex_size = 1;
 
743
                int facevarying_size = 1;
 
744
                CachePlist(count, tokens, values, constant_size, uniform_size, varying_size, vertex_size, facevarying_size);
 
745
        }
 
746
        virtual ~RiAreaLightSourceCache()
 
747
        {
 
748
                delete[](m_name);
 
749
                // plist gets destroyed by the base class.
 
750
        }
 
751
        virtual void ReCall()
 
752
        {
 
753
                RiAreaLightSourceV(m_name, m_count, m_tokens, m_values);
 
754
        }
 
755
 
 
756
private:
 
757
        RtToken m_name;
 
758
        // plist information is stored in the base class.
 
759
};
 
760
 
 
761
class RiIlluminateCache : public RiCacheBase
 
762
{
 
763
public:
 
764
        RiIlluminateCache(RtLightHandle light, RtBoolean onoff) : RiCacheBase()
 
765
        {
 
766
                m_light = light;
 
767
                m_onoff = onoff;
 
768
        }
 
769
        virtual ~RiIlluminateCache()
 
770
        {
 
771
        }
 
772
        virtual void ReCall()
 
773
        {
 
774
                RiIlluminate(m_light, m_onoff);
 
775
        }
 
776
 
 
777
private:
 
778
        RtLightHandle m_light;
 
779
        RtBoolean m_onoff;
 
780
};
 
781
 
 
782
class RiSurfaceCache : public RiCacheBase
 
783
{
 
784
public:
 
785
        RiSurfaceCache(RtToken name, RtInt count, RtToken tokens[], RtPointer values[]) : RiCacheBase()
 
786
        {
 
787
                int __name_length = strlen(name);
 
788
                m_name = new char[ __name_length + 1 ];
 
789
                strcpy(m_name, name);
 
790
                // Copy the plist here.
 
791
                int constant_size = 1;
 
792
                int uniform_size = 1;
 
793
                int varying_size = 1;
 
794
                int vertex_size = 1;
 
795
                int facevarying_size = 1;
 
796
                CachePlist(count, tokens, values, constant_size, uniform_size, varying_size, vertex_size, facevarying_size);
 
797
        }
 
798
        virtual ~RiSurfaceCache()
 
799
        {
 
800
                delete[](m_name);
 
801
                // plist gets destroyed by the base class.
 
802
        }
 
803
        virtual void ReCall()
 
804
        {
 
805
                RiSurfaceV(m_name, m_count, m_tokens, m_values);
 
806
        }
 
807
 
 
808
private:
 
809
        RtToken m_name;
 
810
        // plist information is stored in the base class.
 
811
};
 
812
 
 
813
class RiAtmosphereCache : public RiCacheBase
 
814
{
 
815
public:
 
816
        RiAtmosphereCache(RtToken name, RtInt count, RtToken tokens[], RtPointer values[]) : RiCacheBase()
 
817
        {
 
818
                int __name_length = strlen(name);
 
819
                m_name = new char[ __name_length + 1 ];
 
820
                strcpy(m_name, name);
 
821
                // Copy the plist here.
 
822
                int constant_size = 1;
 
823
                int uniform_size = 1;
 
824
                int varying_size = 1;
 
825
                int vertex_size = 1;
 
826
                int facevarying_size = 1;
 
827
                CachePlist(count, tokens, values, constant_size, uniform_size, varying_size, vertex_size, facevarying_size);
 
828
        }
 
829
        virtual ~RiAtmosphereCache()
 
830
        {
 
831
                delete[](m_name);
 
832
                // plist gets destroyed by the base class.
 
833
        }
 
834
        virtual void ReCall()
 
835
        {
 
836
                RiAtmosphereV(m_name, m_count, m_tokens, m_values);
 
837
        }
 
838
 
 
839
private:
 
840
        RtToken m_name;
 
841
        // plist information is stored in the base class.
 
842
};
 
843
 
 
844
class RiInteriorCache : public RiCacheBase
 
845
{
 
846
public:
 
847
        RiInteriorCache(RtToken name, RtInt count, RtToken tokens[], RtPointer values[]) : RiCacheBase()
 
848
        {
 
849
                int __name_length = strlen(name);
 
850
                m_name = new char[ __name_length + 1 ];
 
851
                strcpy(m_name, name);
 
852
                // Copy the plist here.
 
853
                int constant_size = 1;
 
854
                int uniform_size = 1;
 
855
                int varying_size = 1;
 
856
                int vertex_size = 1;
 
857
                int facevarying_size = 1;
 
858
                CachePlist(count, tokens, values, constant_size, uniform_size, varying_size, vertex_size, facevarying_size);
 
859
        }
 
860
        virtual ~RiInteriorCache()
 
861
        {
 
862
                delete[](m_name);
 
863
                // plist gets destroyed by the base class.
 
864
        }
 
865
        virtual void ReCall()
 
866
        {
 
867
                RiInteriorV(m_name, m_count, m_tokens, m_values);
 
868
        }
 
869
 
 
870
private:
 
871
        RtToken m_name;
 
872
        // plist information is stored in the base class.
 
873
};
 
874
 
 
875
class RiExteriorCache : public RiCacheBase
 
876
{
 
877
public:
 
878
        RiExteriorCache(RtToken name, RtInt count, RtToken tokens[], RtPointer values[]) : RiCacheBase()
 
879
        {
 
880
                int __name_length = strlen(name);
 
881
                m_name = new char[ __name_length + 1 ];
 
882
                strcpy(m_name, name);
 
883
                // Copy the plist here.
 
884
                int constant_size = 1;
 
885
                int uniform_size = 1;
 
886
                int varying_size = 1;
 
887
                int vertex_size = 1;
 
888
                int facevarying_size = 1;
 
889
                CachePlist(count, tokens, values, constant_size, uniform_size, varying_size, vertex_size, facevarying_size);
 
890
        }
 
891
        virtual ~RiExteriorCache()
 
892
        {
 
893
                delete[](m_name);
 
894
                // plist gets destroyed by the base class.
 
895
        }
 
896
        virtual void ReCall()
 
897
        {
 
898
                RiExteriorV(m_name, m_count, m_tokens, m_values);
 
899
        }
 
900
 
 
901
private:
 
902
        RtToken m_name;
 
903
        // plist information is stored in the base class.
 
904
};
 
905
 
 
906
class RiShadingRateCache : public RiCacheBase
 
907
{
 
908
public:
 
909
        RiShadingRateCache(RtFloat size) : RiCacheBase()
 
910
        {
 
911
                m_size = size;
 
912
        }
 
913
        virtual ~RiShadingRateCache()
 
914
        {
 
915
        }
 
916
        virtual void ReCall()
 
917
        {
 
918
                RiShadingRate(m_size);
 
919
        }
 
920
 
 
921
private:
 
922
        RtFloat m_size;
 
923
};
 
924
 
 
925
class RiShadingInterpolationCache : public RiCacheBase
 
926
{
 
927
public:
 
928
        RiShadingInterpolationCache(RtToken type) : RiCacheBase()
 
929
        {
 
930
                int __type_length = strlen(type);
 
931
                m_type = new char[ __type_length + 1 ];
 
932
                strcpy(m_type, type);
 
933
        }
 
934
        virtual ~RiShadingInterpolationCache()
 
935
        {
 
936
                delete[](m_type);
 
937
        }
 
938
        virtual void ReCall()
 
939
        {
 
940
                RiShadingInterpolation(m_type);
 
941
        }
 
942
 
 
943
private:
 
944
        RtToken m_type;
 
945
};
 
946
 
 
947
class RiMatteCache : public RiCacheBase
 
948
{
 
949
public:
 
950
        RiMatteCache(RtBoolean onoff) : RiCacheBase()
 
951
        {
 
952
                m_onoff = onoff;
 
953
        }
 
954
        virtual ~RiMatteCache()
 
955
        {
 
956
        }
 
957
        virtual void ReCall()
 
958
        {
 
959
                RiMatte(m_onoff);
 
960
        }
 
961
 
 
962
private:
 
963
        RtBoolean m_onoff;
 
964
};
 
965
 
 
966
class RiBoundCache : public RiCacheBase
 
967
{
 
968
public:
 
969
        RiBoundCache(RtBound bound) : RiCacheBase()
 
970
        {
 
971
                m_bound[0] = bound[0];
 
972
                m_bound[1] = bound[1];
 
973
                m_bound[2] = bound[2];
 
974
                m_bound[3] = bound[3];
 
975
                m_bound[4] = bound[4];
 
976
                m_bound[5] = bound[5];
 
977
        }
 
978
        virtual ~RiBoundCache()
 
979
        {
 
980
        }
 
981
        virtual void ReCall()
 
982
        {
 
983
                RiBound(m_bound);
 
984
        }
 
985
 
 
986
private:
 
987
        RtBound m_bound;
 
988
};
 
989
 
 
990
class RiDetailCache : public RiCacheBase
 
991
{
 
992
public:
 
993
        RiDetailCache(RtBound bound) : RiCacheBase()
 
994
        {
 
995
                m_bound[0] = bound[0];
 
996
                m_bound[1] = bound[1];
 
997
                m_bound[2] = bound[2];
 
998
                m_bound[3] = bound[3];
 
999
                m_bound[4] = bound[4];
 
1000
                m_bound[5] = bound[5];
 
1001
        }
 
1002
        virtual ~RiDetailCache()
 
1003
        {
 
1004
        }
 
1005
        virtual void ReCall()
 
1006
        {
 
1007
                RiDetail(m_bound);
 
1008
        }
 
1009
 
 
1010
private:
 
1011
        RtBound m_bound;
 
1012
};
 
1013
 
 
1014
class RiDetailRangeCache : public RiCacheBase
 
1015
{
 
1016
public:
 
1017
        RiDetailRangeCache(RtFloat offlow, RtFloat onlow, RtFloat onhigh, RtFloat offhigh) : RiCacheBase()
 
1018
        {
 
1019
                m_offlow = offlow;
 
1020
                m_onlow = onlow;
 
1021
                m_onhigh = onhigh;
 
1022
                m_offhigh = offhigh;
 
1023
        }
 
1024
        virtual ~RiDetailRangeCache()
 
1025
        {
 
1026
        }
 
1027
        virtual void ReCall()
 
1028
        {
 
1029
                RiDetailRange(m_offlow, m_onlow, m_onhigh, m_offhigh);
 
1030
        }
 
1031
 
 
1032
private:
 
1033
        RtFloat m_offlow;
 
1034
        RtFloat m_onlow;
 
1035
        RtFloat m_onhigh;
 
1036
        RtFloat m_offhigh;
 
1037
};
 
1038
 
 
1039
class RiGeometricApproximationCache : public RiCacheBase
 
1040
{
 
1041
public:
 
1042
        RiGeometricApproximationCache(RtToken type, RtFloat value) : RiCacheBase()
 
1043
        {
 
1044
                int __type_length = strlen(type);
 
1045
                m_type = new char[ __type_length + 1 ];
 
1046
                strcpy(m_type, type);
 
1047
                m_value = value;
 
1048
        }
 
1049
        virtual ~RiGeometricApproximationCache()
 
1050
        {
 
1051
                delete[](m_type);
 
1052
        }
 
1053
        virtual void ReCall()
 
1054
        {
 
1055
                RiGeometricApproximation(m_type, m_value);
 
1056
        }
 
1057
 
 
1058
private:
 
1059
        RtToken m_type;
 
1060
        RtFloat m_value;
 
1061
};
 
1062
 
 
1063
class RiOrientationCache : public RiCacheBase
 
1064
{
 
1065
public:
 
1066
        RiOrientationCache(RtToken orientation) : RiCacheBase()
 
1067
        {
 
1068
                int __orientation_length = strlen(orientation);
 
1069
                m_orientation = new char[ __orientation_length + 1 ];
 
1070
                strcpy(m_orientation, orientation);
 
1071
        }
 
1072
        virtual ~RiOrientationCache()
 
1073
        {
 
1074
                delete[](m_orientation);
 
1075
        }
 
1076
        virtual void ReCall()
 
1077
        {
 
1078
                RiOrientation(m_orientation);
 
1079
        }
 
1080
 
 
1081
private:
 
1082
        RtToken m_orientation;
 
1083
};
 
1084
 
 
1085
class RiReverseOrientationCache : public RiCacheBase
 
1086
{
 
1087
public:
 
1088
        RiReverseOrientationCache() : RiCacheBase()
 
1089
        {
 
1090
        }
 
1091
        virtual ~RiReverseOrientationCache()
 
1092
        {
 
1093
        }
 
1094
        virtual void ReCall()
 
1095
        {
 
1096
                RiReverseOrientation();
 
1097
        }
 
1098
 
 
1099
private:
 
1100
};
 
1101
 
 
1102
class RiSidesCache : public RiCacheBase
 
1103
{
 
1104
public:
 
1105
        RiSidesCache(RtInt nsides) : RiCacheBase()
 
1106
        {
 
1107
                m_nsides = nsides;
 
1108
        }
 
1109
        virtual ~RiSidesCache()
 
1110
        {
 
1111
        }
 
1112
        virtual void ReCall()
 
1113
        {
 
1114
                RiSides(m_nsides);
 
1115
        }
 
1116
 
 
1117
private:
 
1118
        RtInt m_nsides;
 
1119
};
 
1120
 
 
1121
class RiIdentityCache : public RiCacheBase
 
1122
{
 
1123
public:
 
1124
        RiIdentityCache() : RiCacheBase()
 
1125
        {
 
1126
        }
 
1127
        virtual ~RiIdentityCache()
 
1128
        {
 
1129
        }
 
1130
        virtual void ReCall()
 
1131
        {
 
1132
                RiIdentity();
 
1133
        }
 
1134
 
 
1135
private:
 
1136
};
 
1137
 
 
1138
class RiTransformCache : public RiCacheBase
 
1139
{
 
1140
public:
 
1141
        RiTransformCache(RtMatrix transform) : RiCacheBase()
 
1142
        {
 
1143
                int __transform_i, __transform_j;
 
1144
                for(__transform_j = 0; __transform_j<4; __transform_j++)
 
1145
                        for(__transform_i = 0; __transform_i<4; __transform_i++)
 
1146
                                m_transform[__transform_j][__transform_i] = transform[__transform_j][__transform_i];
 
1147
        }
 
1148
        virtual ~RiTransformCache()
 
1149
        {
 
1150
        }
 
1151
        virtual void ReCall()
 
1152
        {
 
1153
                RiTransform(m_transform);
 
1154
        }
 
1155
 
 
1156
private:
 
1157
        RtMatrix m_transform;
 
1158
};
 
1159
 
 
1160
class RiConcatTransformCache : public RiCacheBase
 
1161
{
 
1162
public:
 
1163
        RiConcatTransformCache(RtMatrix transform) : RiCacheBase()
 
1164
        {
 
1165
                int __transform_i, __transform_j;
 
1166
                for(__transform_j = 0; __transform_j<4; __transform_j++)
 
1167
                        for(__transform_i = 0; __transform_i<4; __transform_i++)
 
1168
                                m_transform[__transform_j][__transform_i] = transform[__transform_j][__transform_i];
 
1169
        }
 
1170
        virtual ~RiConcatTransformCache()
 
1171
        {
 
1172
        }
 
1173
        virtual void ReCall()
 
1174
        {
 
1175
                RiConcatTransform(m_transform);
 
1176
        }
 
1177
 
 
1178
private:
 
1179
        RtMatrix m_transform;
 
1180
};
 
1181
 
 
1182
class RiPerspectiveCache : public RiCacheBase
 
1183
{
 
1184
public:
 
1185
        RiPerspectiveCache(RtFloat fov) : RiCacheBase()
 
1186
        {
 
1187
                m_fov = fov;
 
1188
        }
 
1189
        virtual ~RiPerspectiveCache()
 
1190
        {
 
1191
        }
 
1192
        virtual void ReCall()
 
1193
        {
 
1194
                RiPerspective(m_fov);
 
1195
        }
 
1196
 
 
1197
private:
 
1198
        RtFloat m_fov;
 
1199
};
 
1200
 
 
1201
class RiTranslateCache : public RiCacheBase
 
1202
{
 
1203
public:
 
1204
        RiTranslateCache(RtFloat dx, RtFloat dy, RtFloat dz) : RiCacheBase()
 
1205
        {
 
1206
                m_dx = dx;
 
1207
                m_dy = dy;
 
1208
                m_dz = dz;
 
1209
        }
 
1210
        virtual ~RiTranslateCache()
 
1211
        {
 
1212
        }
 
1213
        virtual void ReCall()
 
1214
        {
 
1215
                RiTranslate(m_dx, m_dy, m_dz);
 
1216
        }
 
1217
 
 
1218
private:
 
1219
        RtFloat m_dx;
 
1220
        RtFloat m_dy;
 
1221
        RtFloat m_dz;
 
1222
};
 
1223
 
 
1224
class RiRotateCache : public RiCacheBase
 
1225
{
 
1226
public:
 
1227
        RiRotateCache(RtFloat angle, RtFloat dx, RtFloat dy, RtFloat dz) : RiCacheBase()
 
1228
        {
 
1229
                m_angle = angle;
 
1230
                m_dx = dx;
 
1231
                m_dy = dy;
 
1232
                m_dz = dz;
 
1233
        }
 
1234
        virtual ~RiRotateCache()
 
1235
        {
 
1236
        }
 
1237
        virtual void ReCall()
 
1238
        {
 
1239
                RiRotate(m_angle, m_dx, m_dy, m_dz);
 
1240
        }
 
1241
 
 
1242
private:
 
1243
        RtFloat m_angle;
 
1244
        RtFloat m_dx;
 
1245
        RtFloat m_dy;
 
1246
        RtFloat m_dz;
 
1247
};
 
1248
 
 
1249
class RiScaleCache : public RiCacheBase
 
1250
{
 
1251
public:
 
1252
        RiScaleCache(RtFloat sx, RtFloat sy, RtFloat sz) : RiCacheBase()
 
1253
        {
 
1254
                m_sx = sx;
 
1255
                m_sy = sy;
 
1256
                m_sz = sz;
 
1257
        }
 
1258
        virtual ~RiScaleCache()
 
1259
        {
 
1260
        }
 
1261
        virtual void ReCall()
 
1262
        {
 
1263
                RiScale(m_sx, m_sy, m_sz);
 
1264
        }
 
1265
 
 
1266
private:
 
1267
        RtFloat m_sx;
 
1268
        RtFloat m_sy;
 
1269
        RtFloat m_sz;
 
1270
};
 
1271
 
 
1272
class RiSkewCache : public RiCacheBase
 
1273
{
 
1274
public:
 
1275
        RiSkewCache(RtFloat angle, RtFloat dx1, RtFloat dy1, RtFloat dz1, RtFloat dx2, RtFloat dy2, RtFloat dz2) : RiCacheBase()
 
1276
        {
 
1277
                m_angle = angle;
 
1278
                m_dx1 = dx1;
 
1279
                m_dy1 = dy1;
 
1280
                m_dz1 = dz1;
 
1281
                m_dx2 = dx2;
 
1282
                m_dy2 = dy2;
 
1283
                m_dz2 = dz2;
 
1284
        }
 
1285
        virtual ~RiSkewCache()
 
1286
        {
 
1287
        }
 
1288
        virtual void ReCall()
 
1289
        {
 
1290
                RiSkew(m_angle, m_dx1, m_dy1, m_dz1, m_dx2, m_dy2, m_dz2);
 
1291
        }
 
1292
 
 
1293
private:
 
1294
        RtFloat m_angle;
 
1295
        RtFloat m_dx1;
 
1296
        RtFloat m_dy1;
 
1297
        RtFloat m_dz1;
 
1298
        RtFloat m_dx2;
 
1299
        RtFloat m_dy2;
 
1300
        RtFloat m_dz2;
 
1301
};
 
1302
 
 
1303
class RiDeformationCache : public RiCacheBase
 
1304
{
 
1305
public:
 
1306
        RiDeformationCache(RtToken name, RtInt count, RtToken tokens[], RtPointer values[]) : RiCacheBase()
 
1307
        {
 
1308
                int __name_length = strlen(name);
 
1309
                m_name = new char[ __name_length + 1 ];
 
1310
                strcpy(m_name, name);
 
1311
                // Copy the plist here.
 
1312
                int constant_size = 1;
 
1313
                int uniform_size = 1;
 
1314
                int varying_size = 1;
 
1315
                int vertex_size = 1;
 
1316
                int facevarying_size = 1;
 
1317
                CachePlist(count, tokens, values, constant_size, uniform_size, varying_size, vertex_size, facevarying_size);
 
1318
        }
 
1319
        virtual ~RiDeformationCache()
 
1320
        {
 
1321
                delete[](m_name);
 
1322
                // plist gets destroyed by the base class.
 
1323
        }
 
1324
        virtual void ReCall()
 
1325
        {
 
1326
                RiDeformationV(m_name, m_count, m_tokens, m_values);
 
1327
        }
 
1328
 
 
1329
private:
 
1330
        RtToken m_name;
 
1331
        // plist information is stored in the base class.
 
1332
};
 
1333
 
 
1334
class RiDisplacementCache : public RiCacheBase
 
1335
{
 
1336
public:
 
1337
        RiDisplacementCache(RtToken name, RtInt count, RtToken tokens[], RtPointer values[]) : RiCacheBase()
 
1338
        {
 
1339
                int __name_length = strlen(name);
 
1340
                m_name = new char[ __name_length + 1 ];
 
1341
                strcpy(m_name, name);
 
1342
                // Copy the plist here.
 
1343
                int constant_size = 1;
 
1344
                int uniform_size = 1;
 
1345
                int varying_size = 1;
 
1346
                int vertex_size = 1;
 
1347
                int facevarying_size = 1;
 
1348
                CachePlist(count, tokens, values, constant_size, uniform_size, varying_size, vertex_size, facevarying_size);
 
1349
        }
 
1350
        virtual ~RiDisplacementCache()
 
1351
        {
 
1352
                delete[](m_name);
 
1353
                // plist gets destroyed by the base class.
 
1354
        }
 
1355
        virtual void ReCall()
 
1356
        {
 
1357
                RiDisplacementV(m_name, m_count, m_tokens, m_values);
 
1358
        }
 
1359
 
 
1360
private:
 
1361
        RtToken m_name;
 
1362
        // plist information is stored in the base class.
 
1363
};
 
1364
 
 
1365
class RiCoordinateSystemCache : public RiCacheBase
 
1366
{
 
1367
public:
 
1368
        RiCoordinateSystemCache(RtToken space) : RiCacheBase()
 
1369
        {
 
1370
                int __space_length = strlen(space);
 
1371
                m_space = new char[ __space_length + 1 ];
 
1372
                strcpy(m_space, space);
 
1373
        }
 
1374
        virtual ~RiCoordinateSystemCache()
 
1375
        {
 
1376
                delete[](m_space);
 
1377
        }
 
1378
        virtual void ReCall()
 
1379
        {
 
1380
                RiCoordinateSystem(m_space);
 
1381
        }
 
1382
 
 
1383
private:
 
1384
        RtToken m_space;
 
1385
};
 
1386
 
 
1387
class RiTransformPointsCache : public RiCacheBase
 
1388
{
 
1389
public:
 
1390
        RiTransformPointsCache(RtToken fromspace, RtToken tospace, RtInt npoints, RtPoint points[]) : RiCacheBase()
 
1391
        {
 
1392
                int __fromspace_length = strlen(fromspace);
 
1393
                m_fromspace = new char[ __fromspace_length + 1 ];
 
1394
                strcpy(m_fromspace, fromspace);
 
1395
                int __tospace_length = strlen(tospace);
 
1396
                m_tospace = new char[ __tospace_length + 1 ];
 
1397
                strcpy(m_tospace, tospace);
 
1398
                m_npoints = npoints;
 
1399
                int __points_length = npoints;
 
1400
                m_points = new RtPoint[__points_length];
 
1401
                int __points_index;
 
1402
                for(__points_index = 0; __points_index<__points_length; __points_index++)
 
1403
                {
 
1404
                        m_points[__points_index][0] = points[__points_index][0];
 
1405
                        m_points[__points_index][1] = points[__points_index][1];
 
1406
                        m_points[__points_index][2] = points[__points_index][2];
 
1407
                }
 
1408
        }
 
1409
        virtual ~RiTransformPointsCache()
 
1410
        {
 
1411
                delete[](m_fromspace);
 
1412
                delete[](m_tospace);
 
1413
                delete[](m_points);
 
1414
        }
 
1415
        virtual void ReCall()
 
1416
        {
 
1417
                RiTransformPoints(m_fromspace, m_tospace, m_npoints, m_points);
 
1418
        }
 
1419
 
 
1420
private:
 
1421
        RtToken m_fromspace;
 
1422
        RtToken m_tospace;
 
1423
        RtInt m_npoints;
 
1424
        RtPoint* m_points;
 
1425
};
 
1426
 
 
1427
class RiTransformBeginCache : public RiCacheBase
 
1428
{
 
1429
public:
 
1430
        RiTransformBeginCache() : RiCacheBase()
 
1431
        {
 
1432
        }
 
1433
        virtual ~RiTransformBeginCache()
 
1434
        {
 
1435
        }
 
1436
        virtual void ReCall()
 
1437
        {
 
1438
                RiTransformBegin();
 
1439
        }
 
1440
 
 
1441
private:
 
1442
};
 
1443
 
 
1444
class RiTransformEndCache : public RiCacheBase
 
1445
{
 
1446
public:
 
1447
        RiTransformEndCache() : RiCacheBase()
 
1448
        {
 
1449
        }
 
1450
        virtual ~RiTransformEndCache()
 
1451
        {
 
1452
        }
 
1453
        virtual void ReCall()
 
1454
        {
 
1455
                RiTransformEnd();
 
1456
        }
 
1457
 
 
1458
private:
 
1459
};
 
1460
 
 
1461
class RiAttributeCache : public RiCacheBase
 
1462
{
 
1463
public:
 
1464
        RiAttributeCache(RtToken name, RtInt count, RtToken tokens[], RtPointer values[]) : RiCacheBase()
 
1465
        {
 
1466
                int __name_length = strlen(name);
 
1467
                m_name = new char[ __name_length + 1 ];
 
1468
                strcpy(m_name, name);
 
1469
                // Copy the plist here.
 
1470
                int constant_size = 1;
 
1471
                int uniform_size = 1;
 
1472
                int varying_size = 1;
 
1473
                int vertex_size = 1;
 
1474
                int facevarying_size = 1;
 
1475
                CachePlist(count, tokens, values, constant_size, uniform_size, varying_size, vertex_size, facevarying_size);
 
1476
        }
 
1477
        virtual ~RiAttributeCache()
 
1478
        {
 
1479
                delete[](m_name);
 
1480
                // plist gets destroyed by the base class.
 
1481
        }
 
1482
        virtual void ReCall()
 
1483
        {
 
1484
                RiAttributeV(m_name, m_count, m_tokens, m_values);
 
1485
        }
 
1486
 
 
1487
private:
 
1488
        RtToken m_name;
 
1489
        // plist information is stored in the base class.
 
1490
};
 
1491
 
 
1492
class RiPolygonCache : public RiCacheBase
 
1493
{
 
1494
public:
 
1495
        RiPolygonCache(RtInt nvertices, RtInt count, RtToken tokens[], RtPointer values[]) : RiCacheBase()
 
1496
        {
 
1497
                m_nvertices = nvertices;
 
1498
                // Copy the plist here.
 
1499
                int constant_size = 1;
 
1500
                int uniform_size = 1;
 
1501
                int varying_size = 1;
 
1502
                int vertex_size = 1;
 
1503
                int facevarying_size = 1;
 
1504
                varying_size = nvertices;
 
1505
                vertex_size = nvertices;
 
1506
                facevarying_size = nvertices;
 
1507
                CachePlist(count, tokens, values, constant_size, uniform_size, varying_size, vertex_size, facevarying_size);
 
1508
        }
 
1509
        virtual ~RiPolygonCache()
 
1510
        {
 
1511
                // plist gets destroyed by the base class.
 
1512
        }
 
1513
        virtual void ReCall()
 
1514
        {
 
1515
                RiPolygonV(m_nvertices, m_count, m_tokens, m_values);
 
1516
        }
 
1517
 
 
1518
private:
 
1519
        RtInt m_nvertices;
 
1520
        // plist information is stored in the base class.
 
1521
};
 
1522
 
 
1523
class RiGeneralPolygonCache : public RiCacheBase
 
1524
{
 
1525
public:
 
1526
        RiGeneralPolygonCache(RtInt nloops, RtInt nverts[], RtInt count, RtToken tokens[], RtPointer values[]) : RiCacheBase()
 
1527
        {
 
1528
                m_nloops = nloops;
 
1529
                int __nverts_length = nloops;
 
1530
                m_nverts = new RtInt[__nverts_length];
 
1531
                int __nverts_index;
 
1532
                for(__nverts_index = 0; __nverts_index<__nverts_length; __nverts_index++)
 
1533
                {
 
1534
                        m_nverts[__nverts_index] = nverts[__nverts_index];
 
1535
                }
 
1536
                // Copy the plist here.
 
1537
                int constant_size = 1;
 
1538
                int uniform_size = 1;
 
1539
                int varying_size = 1;
 
1540
                int vertex_size = 1;
 
1541
                int facevarying_size = 1;
 
1542
                varying_size = 0;
 
1543
                {
 
1544
                        int __i;
 
1545
                        for(__i=0;__i<nloops;__i++)
 
1546
                                varying_size+=nverts[__i];
 
1547
                }
 
1548
                vertex_size = varying_size;
 
1549
                facevarying_size = varying_size;
 
1550
                CachePlist(count, tokens, values, constant_size, uniform_size, varying_size, vertex_size, facevarying_size);
 
1551
        }
 
1552
        virtual ~RiGeneralPolygonCache()
 
1553
        {
 
1554
                delete[](m_nverts);
 
1555
                // plist gets destroyed by the base class.
 
1556
        }
 
1557
        virtual void ReCall()
 
1558
        {
 
1559
                RiGeneralPolygonV(m_nloops, m_nverts, m_count, m_tokens, m_values);
 
1560
        }
 
1561
 
 
1562
private:
 
1563
        RtInt m_nloops;
 
1564
        RtInt* m_nverts;
 
1565
        // plist information is stored in the base class.
 
1566
};
 
1567
 
 
1568
class RiPointsPolygonsCache : public RiCacheBase
 
1569
{
 
1570
public:
 
1571
        RiPointsPolygonsCache(RtInt npolys, RtInt nverts[], RtInt verts[], RtInt count, RtToken tokens[], RtPointer values[]) : RiCacheBase()
 
1572
        {
 
1573
                m_npolys = npolys;
 
1574
                int __nverts_length = npolys;
 
1575
                m_nverts = new RtInt[__nverts_length];
 
1576
                int __nverts_index;
 
1577
                for(__nverts_index = 0; __nverts_index<__nverts_length; __nverts_index++)
 
1578
                {
 
1579
                        m_nverts[__nverts_index] = nverts[__nverts_index];
 
1580
                }
 
1581
                int __verts_length = 0;
 
1582
                {
 
1583
                        int __i;
 
1584
                        for(__i=0; __i<npolys; __i++)
 
1585
                                __verts_length+=nverts[__i];
 
1586
                }
 
1587
                m_verts = new RtInt[__verts_length];
 
1588
                int __verts_index;
 
1589
                for(__verts_index = 0; __verts_index<__verts_length; __verts_index++)
 
1590
                {
 
1591
                        m_verts[__verts_index] = verts[__verts_index];
 
1592
                }
 
1593
                // Copy the plist here.
 
1594
                int constant_size = 1;
 
1595
                int uniform_size = 1;
 
1596
                int varying_size = 1;
 
1597
                int vertex_size = 1;
 
1598
                int facevarying_size = 1;
 
1599
                varying_size=0;
 
1600
                {
 
1601
                        int __i;
 
1602
                        for(__i=0; __i<__verts_length; __i++)
 
1603
                                if(verts[__i]>varying_size)
 
1604
                                        varying_size=verts[__i];
 
1605
                }
 
1606
                varying_size+=1;
 
1607
                vertex_size=varying_size;
 
1608
                facevarying_size=0;
 
1609
                {
 
1610
                        int __i;
 
1611
                        for(__i=0; __i<npolys; __i++)
 
1612
                                facevarying_size+=nverts[__i];
 
1613
                }
 
1614
                CachePlist(count, tokens, values, constant_size, uniform_size, varying_size, vertex_size, facevarying_size);
 
1615
        }
 
1616
        virtual ~RiPointsPolygonsCache()
 
1617
        {
 
1618
                delete[](m_nverts);
 
1619
                delete[](m_verts);
 
1620
                // plist gets destroyed by the base class.
 
1621
        }
 
1622
        virtual void ReCall()
 
1623
        {
 
1624
                RiPointsPolygonsV(m_npolys, m_nverts, m_verts, m_count, m_tokens, m_values);
 
1625
        }
 
1626
 
 
1627
private:
 
1628
        RtInt m_npolys;
 
1629
        RtInt* m_nverts;
 
1630
        RtInt* m_verts;
 
1631
        // plist information is stored in the base class.
 
1632
};
 
1633
 
 
1634
class RiPointsGeneralPolygonsCache : public RiCacheBase
 
1635
{
 
1636
public:
 
1637
        RiPointsGeneralPolygonsCache(RtInt npolys, RtInt nloops[], RtInt nverts[], RtInt verts[], RtInt count, RtToken tokens[], RtPointer values[]) : RiCacheBase()
 
1638
        {
 
1639
                m_npolys = npolys;
 
1640
                int __nloops_length = npolys;
 
1641
                m_nloops = new RtInt[__nloops_length];
 
1642
                int __nloops_index;
 
1643
                for(__nloops_index = 0; __nloops_index<__nloops_length; __nloops_index++)
 
1644
                {
 
1645
                        m_nloops[__nloops_index] = nloops[__nloops_index];
 
1646
                }
 
1647
                int __nverts_length = 0;
 
1648
                {
 
1649
                        int __i;
 
1650
                        for(__i=0; __i<npolys; __i++)
 
1651
                                __nverts_length+=nloops[__i];
 
1652
                }
 
1653
                m_nverts = new RtInt[__nverts_length];
 
1654
                int __nverts_index;
 
1655
                for(__nverts_index = 0; __nverts_index<__nverts_length; __nverts_index++)
 
1656
                {
 
1657
                        m_nverts[__nverts_index] = nverts[__nverts_index];
 
1658
                }
 
1659
                int __verts_length = 0;
 
1660
                {
 
1661
                        int __i;
 
1662
                        for(__i=0; __i<__nverts_length; __i++)
 
1663
                                __verts_length+=nverts[__i];
 
1664
                }
 
1665
                m_verts = new RtInt[__verts_length];
 
1666
                int __verts_index;
 
1667
                for(__verts_index = 0; __verts_index<__verts_length; __verts_index++)
 
1668
                {
 
1669
                        m_verts[__verts_index] = verts[__verts_index];
 
1670
                }
 
1671
                // Copy the plist here.
 
1672
                int constant_size = 1;
 
1673
                int uniform_size = 1;
 
1674
                int varying_size = 1;
 
1675
                int vertex_size = 1;
 
1676
                int facevarying_size = 1;
 
1677
                varying_size=0;
 
1678
                {
 
1679
                        int __i;
 
1680
                        for(__i=0; __i<__verts_length; __i++)
 
1681
                                if(verts[__i]>varying_size)
 
1682
                                        varying_size=verts[__i];
 
1683
                }
 
1684
                varying_size+=1;
 
1685
                vertex_size=varying_size;
 
1686
                facevarying_size=0;
 
1687
                {
 
1688
                        int __i;
 
1689
                        for(__i=0; __i<npolys; __i++)
 
1690
                                facevarying_size+=nverts[__i];
 
1691
                }
 
1692
                CachePlist(count, tokens, values, constant_size, uniform_size, varying_size, vertex_size, facevarying_size);
 
1693
        }
 
1694
        virtual ~RiPointsGeneralPolygonsCache()
 
1695
        {
 
1696
                delete[](m_nloops);
 
1697
                delete[](m_nverts);
 
1698
                delete[](m_verts);
 
1699
                // plist gets destroyed by the base class.
 
1700
        }
 
1701
        virtual void ReCall()
 
1702
        {
 
1703
                RiPointsGeneralPolygonsV(m_npolys, m_nloops, m_nverts, m_verts, m_count, m_tokens, m_values);
 
1704
        }
 
1705
 
 
1706
private:
 
1707
        RtInt m_npolys;
 
1708
        RtInt* m_nloops;
 
1709
        RtInt* m_nverts;
 
1710
        RtInt* m_verts;
 
1711
        // plist information is stored in the base class.
 
1712
};
 
1713
 
 
1714
class RiBasisCache : public RiCacheBase
 
1715
{
 
1716
public:
 
1717
        RiBasisCache(RtBasis ubasis, RtInt ustep, RtBasis vbasis, RtInt vstep) : RiCacheBase()
 
1718
        {
 
1719
                int __ubasis_i, __ubasis_j;
 
1720
                for(__ubasis_j = 0; __ubasis_j<4; __ubasis_j++)
 
1721
                        for(__ubasis_i = 0; __ubasis_i<4; __ubasis_i++)
 
1722
                                m_ubasis[__ubasis_j][__ubasis_i] = ubasis[__ubasis_j][__ubasis_i];
 
1723
                m_ustep = ustep;
 
1724
                int __vbasis_i, __vbasis_j;
 
1725
                for(__vbasis_j = 0; __vbasis_j<4; __vbasis_j++)
 
1726
                        for(__vbasis_i = 0; __vbasis_i<4; __vbasis_i++)
 
1727
                                m_vbasis[__vbasis_j][__vbasis_i] = vbasis[__vbasis_j][__vbasis_i];
 
1728
                m_vstep = vstep;
 
1729
        }
 
1730
        virtual ~RiBasisCache()
 
1731
        {
 
1732
        }
 
1733
        virtual void ReCall()
 
1734
        {
 
1735
                RiBasis(m_ubasis, m_ustep, m_vbasis, m_vstep);
 
1736
        }
 
1737
 
 
1738
private:
 
1739
        RtBasis m_ubasis;
 
1740
        RtInt m_ustep;
 
1741
        RtBasis m_vbasis;
 
1742
        RtInt m_vstep;
 
1743
};
 
1744
 
 
1745
class RiPatchCache : public RiCacheBase
 
1746
{
 
1747
public:
 
1748
        RiPatchCache(RtToken type, RtInt count, RtToken tokens[], RtPointer values[]) : RiCacheBase()
 
1749
        {
 
1750
                int __type_length = strlen(type);
 
1751
                m_type = new char[ __type_length + 1 ];
 
1752
                strcpy(m_type, type);
 
1753
                // Copy the plist here.
 
1754
                int constant_size = 1;
 
1755
                int uniform_size = 1;
 
1756
                int varying_size = 1;
 
1757
                int vertex_size = 1;
 
1758
                int facevarying_size = 1;
 
1759
                varying_size = 4;
 
1760
                vertex_size = 4;
 
1761
                if(strcmp(type, "bicubic")==0)
 
1762
                        vertex_size=16;
 
1763
                facevarying_size = varying_size;
 
1764
                CachePlist(count, tokens, values, constant_size, uniform_size, varying_size, vertex_size, facevarying_size);
 
1765
        }
 
1766
        virtual ~RiPatchCache()
 
1767
        {
 
1768
                delete[](m_type);
 
1769
                // plist gets destroyed by the base class.
 
1770
        }
 
1771
        virtual void ReCall()
 
1772
        {
 
1773
                RiPatchV(m_type, m_count, m_tokens, m_values);
 
1774
        }
 
1775
 
 
1776
private:
 
1777
        RtToken m_type;
 
1778
        // plist information is stored in the base class.
 
1779
};
 
1780
 
 
1781
class RiPatchMeshCache : public RiCacheBase
 
1782
{
 
1783
public:
 
1784
        RiPatchMeshCache(RtToken type, RtInt nu, RtToken uwrap, RtInt nv, RtToken vwrap, RtInt count, RtToken tokens[], RtPointer values[]) : RiCacheBase()
 
1785
        {
 
1786
                int __type_length = strlen(type);
 
1787
                m_type = new char[ __type_length + 1 ];
 
1788
                strcpy(m_type, type);
 
1789
                m_nu = nu;
 
1790
                int __uwrap_length = strlen(uwrap);
 
1791
                m_uwrap = new char[ __uwrap_length + 1 ];
 
1792
                strcpy(m_uwrap, uwrap);
 
1793
                m_nv = nv;
 
1794
                int __vwrap_length = strlen(vwrap);
 
1795
                m_vwrap = new char[ __vwrap_length + 1 ];
 
1796
                strcpy(m_vwrap, vwrap);
 
1797
                // Copy the plist here.
 
1798
                int constant_size = 1;
 
1799
                int uniform_size = 1;
 
1800
                int varying_size = 1;
 
1801
                int vertex_size = 1;
 
1802
                int facevarying_size = 1;
 
1803
 
 
1804
                if(strcmp(type, "bilinear")==0)
 
1805
                {
 
1806
                        if(strcmp(uwrap, "periodic")==0)
 
1807
                                uniform_size = nu;
 
1808
                        else
 
1809
                                uniform_size = nu-1;
 
1810
                        if(strcmp(vwrap, "periodic")==0)
 
1811
                                uniform_size *= nv;
 
1812
                        else
 
1813
                                uniform_size *= nv-1;
 
1814
                }
 
1815
                else
 
1816
                {
 
1817
                        int ustep = QGetRenderContext() ->pattrCurrent()->GetIntegerAttribute( "System", "BasisStep" ) [ 0 ];
 
1818
                        int vstep = QGetRenderContext() ->pattrCurrent()->GetIntegerAttribute( "System", "BasisStep" ) [ 1 ];
 
1819
                        if(strcmp(uwrap, "periodic")==0)
 
1820
                                uniform_size = nu/ustep;
 
1821
                        else
 
1822
                                uniform_size = (nu-4)/ustep;
 
1823
                        if(strcmp(vwrap, "periodic")==0)
 
1824
                                uniform_size *= nv/vstep;
 
1825
                        else
 
1826
                                uniform_size *= (nv-4)/vstep;
 
1827
                }
 
1828
 
 
1829
                if(strcmp(type, "bilinear")==0)
 
1830
                        varying_size = nu*nv;
 
1831
                else
 
1832
                {
 
1833
                        int ustep = QGetRenderContext() ->pattrCurrent()->GetIntegerAttribute( "System", "BasisStep" ) [ 0 ];
 
1834
                        int vstep = QGetRenderContext() ->pattrCurrent()->GetIntegerAttribute( "System", "BasisStep" ) [ 1 ];
 
1835
                        varying_size = (nu/ustep)*(nv/vstep);
 
1836
                }
 
1837
                vertex_size=nu*nv;
 
1838
                CachePlist(count, tokens, values, constant_size, uniform_size, varying_size, vertex_size, facevarying_size);
 
1839
        }
 
1840
        virtual ~RiPatchMeshCache()
 
1841
        {
 
1842
                delete[](m_type);
 
1843
                delete[](m_uwrap);
 
1844
                delete[](m_vwrap);
 
1845
                // plist gets destroyed by the base class.
 
1846
        }
 
1847
        virtual void ReCall()
 
1848
        {
 
1849
                RiPatchMeshV(m_type, m_nu, m_uwrap, m_nv, m_vwrap, m_count, m_tokens, m_values);
 
1850
        }
 
1851
 
 
1852
private:
 
1853
        RtToken m_type;
 
1854
        RtInt m_nu;
 
1855
        RtToken m_uwrap;
 
1856
        RtInt m_nv;
 
1857
        RtToken m_vwrap;
 
1858
        // plist information is stored in the base class.
 
1859
};
 
1860
 
 
1861
class RiNuPatchCache : public RiCacheBase
 
1862
{
 
1863
public:
 
1864
        RiNuPatchCache(RtInt nu, RtInt uorder, RtFloat uknot[], RtFloat umin, RtFloat umax, RtInt nv, RtInt vorder, RtFloat vknot[], RtFloat vmin, RtFloat vmax, RtInt count, RtToken tokens[], RtPointer values[]) : RiCacheBase()
 
1865
        {
 
1866
                m_nu = nu;
 
1867
                m_uorder = uorder;
 
1868
                int __uknot_length = nu + uorder;
 
1869
                m_uknot = new RtFloat[__uknot_length];
 
1870
                int __uknot_index;
 
1871
                for(__uknot_index = 0; __uknot_index<__uknot_length; __uknot_index++)
 
1872
                {
 
1873
                        m_uknot[__uknot_index] = uknot[__uknot_index];
 
1874
                }
 
1875
                m_umin = umin;
 
1876
                m_umax = umax;
 
1877
                m_nv = nv;
 
1878
                m_vorder = vorder;
 
1879
                int __vknot_length = nv + vorder;
 
1880
                m_vknot = new RtFloat[__vknot_length];
 
1881
                int __vknot_index;
 
1882
                for(__vknot_index = 0; __vknot_index<__vknot_length; __vknot_index++)
 
1883
                {
 
1884
                        m_vknot[__vknot_index] = vknot[__vknot_index];
 
1885
                }
 
1886
                m_vmin = vmin;
 
1887
                m_vmax = vmax;
 
1888
                // Copy the plist here.
 
1889
                int constant_size = 1;
 
1890
                int uniform_size = 1;
 
1891
                int varying_size = 1;
 
1892
                int vertex_size = 1;
 
1893
                int facevarying_size = 1;
 
1894
                uniform_size=(1+nu-uorder+1)*(1+nv-vorder+1);
 
1895
                varying_size=(1+nu-uorder+1)*(1+nv-vorder+1);
 
1896
                vertex_size=nu*nv;
 
1897
                CachePlist(count, tokens, values, constant_size, uniform_size, varying_size, vertex_size, facevarying_size);
 
1898
        }
 
1899
        virtual ~RiNuPatchCache()
 
1900
        {
 
1901
                delete[](m_uknot);
 
1902
                delete[](m_vknot);
 
1903
                // plist gets destroyed by the base class.
 
1904
        }
 
1905
        virtual void ReCall()
 
1906
        {
 
1907
                RiNuPatchV(m_nu, m_uorder, m_uknot, m_umin, m_umax, m_nv, m_vorder, m_vknot, m_vmin, m_vmax, m_count, m_tokens, m_values);
 
1908
        }
 
1909
 
 
1910
private:
 
1911
        RtInt m_nu;
 
1912
        RtInt m_uorder;
 
1913
        RtFloat* m_uknot;
 
1914
        RtFloat m_umin;
 
1915
        RtFloat m_umax;
 
1916
        RtInt m_nv;
 
1917
        RtInt m_vorder;
 
1918
        RtFloat* m_vknot;
 
1919
        RtFloat m_vmin;
 
1920
        RtFloat m_vmax;
 
1921
        // plist information is stored in the base class.
 
1922
};
 
1923
 
 
1924
class RiTrimCurveCache : public RiCacheBase
 
1925
{
 
1926
public:
 
1927
        RiTrimCurveCache(RtInt nloops, RtInt ncurves[], RtInt order[], RtFloat knot[], RtFloat min[], RtFloat max[], RtInt n[], RtFloat u[], RtFloat v[], RtFloat w[]) : RiCacheBase()
 
1928
        {
 
1929
                m_nloops = nloops;
 
1930
                int __ncurves_length = nloops;
 
1931
                m_ncurves = new RtInt[__ncurves_length];
 
1932
                int __ncurves_index;
 
1933
                for(__ncurves_index = 0; __ncurves_index<__ncurves_length; __ncurves_index++)
 
1934
                {
 
1935
                        m_ncurves[__ncurves_index] = ncurves[__ncurves_index];
 
1936
                }
 
1937
                int __order_length = 0;
 
1938
                {
 
1939
                        int __i;
 
1940
                        for(__i=0; __i<nloops; __i++)
 
1941
                                __order_length+=ncurves[__i];
 
1942
                }
 
1943
                m_order = new RtInt[__order_length];
 
1944
                int __order_index;
 
1945
                for(__order_index = 0; __order_index<__order_length; __order_index++)
 
1946
                {
 
1947
                        m_order[__order_index] = order[__order_index];
 
1948
                }
 
1949
                int __knot_length = 0;
 
1950
                {
 
1951
                        int __i;
 
1952
                        for(__i=0; __i<__order_length; __i++)
 
1953
                                __knot_length+=order[__i]+n[__i];
 
1954
                }
 
1955
                m_knot = new RtFloat[__knot_length];
 
1956
                int __knot_index;
 
1957
                for(__knot_index = 0; __knot_index<__knot_length; __knot_index++)
 
1958
                {
 
1959
                        m_knot[__knot_index] = knot[__knot_index];
 
1960
                }
 
1961
                int __min_length = __order_length;
 
1962
                m_min = new RtFloat[__min_length];
 
1963
                int __min_index;
 
1964
                for(__min_index = 0; __min_index<__min_length; __min_index++)
 
1965
                {
 
1966
                        m_min[__min_index] = min[__min_index];
 
1967
                }
 
1968
                int __max_length = __order_length;
 
1969
                m_max = new RtFloat[__max_length];
 
1970
                int __max_index;
 
1971
                for(__max_index = 0; __max_index<__max_length; __max_index++)
 
1972
                {
 
1973
                        m_max[__max_index] = max[__max_index];
 
1974
                }
 
1975
                int __n_length = __order_length;
 
1976
                m_n = new RtInt[__n_length];
 
1977
                int __n_index;
 
1978
                for(__n_index = 0; __n_index<__n_length; __n_index++)
 
1979
                {
 
1980
                        m_n[__n_index] = n[__n_index];
 
1981
                }
 
1982
                int __u_length = 0;
 
1983
                {
 
1984
                        int __i;
 
1985
                        for(__i=0; __i<__order_length; __i++)
 
1986
                                __u_length+=n[__i];
 
1987
                }
 
1988
                m_u = new RtFloat[__u_length];
 
1989
                int __u_index;
 
1990
                for(__u_index = 0; __u_index<__u_length; __u_index++)
 
1991
                {
 
1992
                        m_u[__u_index] = u[__u_index];
 
1993
                }
 
1994
                int __v_length = __u_length;
 
1995
                m_v = new RtFloat[__v_length];
 
1996
                int __v_index;
 
1997
                for(__v_index = 0; __v_index<__v_length; __v_index++)
 
1998
                {
 
1999
                        m_v[__v_index] = v[__v_index];
 
2000
                }
 
2001
                int __w_length = __u_length;
 
2002
                m_w = new RtFloat[__w_length];
 
2003
                int __w_index;
 
2004
                for(__w_index = 0; __w_index<__w_length; __w_index++)
 
2005
                {
 
2006
                        m_w[__w_index] = w[__w_index];
 
2007
                }
 
2008
        }
 
2009
        virtual ~RiTrimCurveCache()
 
2010
        {
 
2011
                delete[](m_ncurves);
 
2012
                delete[](m_order);
 
2013
                delete[](m_knot);
 
2014
                delete[](m_min);
 
2015
                delete[](m_max);
 
2016
                delete[](m_n);
 
2017
                delete[](m_u);
 
2018
                delete[](m_v);
 
2019
                delete[](m_w);
 
2020
        }
 
2021
        virtual void ReCall()
 
2022
        {
 
2023
                RiTrimCurve(m_nloops, m_ncurves, m_order, m_knot, m_min, m_max, m_n, m_u, m_v, m_w);
 
2024
        }
 
2025
 
 
2026
private:
 
2027
        RtInt m_nloops;
 
2028
        RtInt* m_ncurves;
 
2029
        RtInt* m_order;
 
2030
        RtFloat* m_knot;
 
2031
        RtFloat* m_min;
 
2032
        RtFloat* m_max;
 
2033
        RtInt* m_n;
 
2034
        RtFloat* m_u;
 
2035
        RtFloat* m_v;
 
2036
        RtFloat* m_w;
 
2037
};
 
2038
 
 
2039
class RiSphereCache : public RiCacheBase
 
2040
{
 
2041
public:
 
2042
        RiSphereCache(RtFloat radius, RtFloat zmin, RtFloat zmax, RtFloat thetamax, RtInt count, RtToken tokens[], RtPointer values[]) : RiCacheBase()
 
2043
        {
 
2044
                m_radius = radius;
 
2045
                m_zmin = zmin;
 
2046
                m_zmax = zmax;
 
2047
                m_thetamax = thetamax;
 
2048
                // Copy the plist here.
 
2049
                int constant_size = 1;
 
2050
                int uniform_size = 1;
 
2051
                int varying_size = 1;
 
2052
                int vertex_size = 1;
 
2053
                int facevarying_size = 1;
 
2054
                varying_size = 4;
 
2055
                vertex_size = 4;
 
2056
                facevarying_size = 4;
 
2057
                CachePlist(count, tokens, values, constant_size, uniform_size, varying_size, vertex_size, facevarying_size);
 
2058
        }
 
2059
        virtual ~RiSphereCache()
 
2060
        {
 
2061
                // plist gets destroyed by the base class.
 
2062
        }
 
2063
        virtual void ReCall()
 
2064
        {
 
2065
                RiSphereV(m_radius, m_zmin, m_zmax, m_thetamax, m_count, m_tokens, m_values);
 
2066
        }
 
2067
 
 
2068
private:
 
2069
        RtFloat m_radius;
 
2070
        RtFloat m_zmin;
 
2071
        RtFloat m_zmax;
 
2072
        RtFloat m_thetamax;
 
2073
        // plist information is stored in the base class.
 
2074
};
 
2075
 
 
2076
class RiConeCache : public RiCacheBase
 
2077
{
 
2078
public:
 
2079
        RiConeCache(RtFloat height, RtFloat radius, RtFloat thetamax, RtInt count, RtToken tokens[], RtPointer values[]) : RiCacheBase()
 
2080
        {
 
2081
                m_height = height;
 
2082
                m_radius = radius;
 
2083
                m_thetamax = thetamax;
 
2084
                // Copy the plist here.
 
2085
                int constant_size = 1;
 
2086
                int uniform_size = 1;
 
2087
                int varying_size = 1;
 
2088
                int vertex_size = 1;
 
2089
                int facevarying_size = 1;
 
2090
                varying_size = 4;
 
2091
                vertex_size = 4;
 
2092
                facevarying_size = 4;
 
2093
                CachePlist(count, tokens, values, constant_size, uniform_size, varying_size, vertex_size, facevarying_size);
 
2094
        }
 
2095
        virtual ~RiConeCache()
 
2096
        {
 
2097
                // plist gets destroyed by the base class.
 
2098
        }
 
2099
        virtual void ReCall()
 
2100
        {
 
2101
                RiConeV(m_height, m_radius, m_thetamax, m_count, m_tokens, m_values);
 
2102
        }
 
2103
 
 
2104
private:
 
2105
        RtFloat m_height;
 
2106
        RtFloat m_radius;
 
2107
        RtFloat m_thetamax;
 
2108
        // plist information is stored in the base class.
 
2109
};
 
2110
 
 
2111
class RiCylinderCache : public RiCacheBase
 
2112
{
 
2113
public:
 
2114
        RiCylinderCache(RtFloat radius, RtFloat zmin, RtFloat zmax, RtFloat thetamax, RtInt count, RtToken tokens[], RtPointer values[]) : RiCacheBase()
 
2115
        {
 
2116
                m_radius = radius;
 
2117
                m_zmin = zmin;
 
2118
                m_zmax = zmax;
 
2119
                m_thetamax = thetamax;
 
2120
                // Copy the plist here.
 
2121
                int constant_size = 1;
 
2122
                int uniform_size = 1;
 
2123
                int varying_size = 1;
 
2124
                int vertex_size = 1;
 
2125
                int facevarying_size = 1;
 
2126
                varying_size = 4;
 
2127
                vertex_size = 4;
 
2128
                facevarying_size = 4;
 
2129
                CachePlist(count, tokens, values, constant_size, uniform_size, varying_size, vertex_size, facevarying_size);
 
2130
        }
 
2131
        virtual ~RiCylinderCache()
 
2132
        {
 
2133
                // plist gets destroyed by the base class.
 
2134
        }
 
2135
        virtual void ReCall()
 
2136
        {
 
2137
                RiCylinderV(m_radius, m_zmin, m_zmax, m_thetamax, m_count, m_tokens, m_values);
 
2138
        }
 
2139
 
 
2140
private:
 
2141
        RtFloat m_radius;
 
2142
        RtFloat m_zmin;
 
2143
        RtFloat m_zmax;
 
2144
        RtFloat m_thetamax;
 
2145
        // plist information is stored in the base class.
 
2146
};
 
2147
 
 
2148
class RiHyperboloidCache : public RiCacheBase
 
2149
{
 
2150
public:
 
2151
        RiHyperboloidCache(RtPoint point1, RtPoint point2, RtFloat thetamax, RtInt count, RtToken tokens[], RtPointer values[]) : RiCacheBase()
 
2152
        {
 
2153
                m_point1[0] = point1[0];
 
2154
                m_point1[1] = point1[1];
 
2155
                m_point1[2] = point1[2];
 
2156
                m_point2[0] = point2[0];
 
2157
                m_point2[1] = point2[1];
 
2158
                m_point2[2] = point2[2];
 
2159
                m_thetamax = thetamax;
 
2160
                // Copy the plist here.
 
2161
                int constant_size = 1;
 
2162
                int uniform_size = 1;
 
2163
                int varying_size = 1;
 
2164
                int vertex_size = 1;
 
2165
                int facevarying_size = 1;
 
2166
                varying_size = 4;
 
2167
                vertex_size = 4;
 
2168
                facevarying_size = 4;
 
2169
                CachePlist(count, tokens, values, constant_size, uniform_size, varying_size, vertex_size, facevarying_size);
 
2170
        }
 
2171
        virtual ~RiHyperboloidCache()
 
2172
        {
 
2173
                // plist gets destroyed by the base class.
 
2174
        }
 
2175
        virtual void ReCall()
 
2176
        {
 
2177
                RiHyperboloidV(m_point1, m_point2, m_thetamax, m_count, m_tokens, m_values);
 
2178
        }
 
2179
 
 
2180
private:
 
2181
        RtPoint m_point1;
 
2182
        RtPoint m_point2;
 
2183
        RtFloat m_thetamax;
 
2184
        // plist information is stored in the base class.
 
2185
};
 
2186
 
 
2187
class RiParaboloidCache : public RiCacheBase
 
2188
{
 
2189
public:
 
2190
        RiParaboloidCache(RtFloat rmax, RtFloat zmin, RtFloat zmax, RtFloat thetamax, RtInt count, RtToken tokens[], RtPointer values[]) : RiCacheBase()
 
2191
        {
 
2192
                m_rmax = rmax;
 
2193
                m_zmin = zmin;
 
2194
                m_zmax = zmax;
 
2195
                m_thetamax = thetamax;
 
2196
                // Copy the plist here.
 
2197
                int constant_size = 1;
 
2198
                int uniform_size = 1;
 
2199
                int varying_size = 1;
 
2200
                int vertex_size = 1;
 
2201
                int facevarying_size = 1;
 
2202
                varying_size = 4;
 
2203
                vertex_size = 4;
 
2204
                facevarying_size = 4;
 
2205
                CachePlist(count, tokens, values, constant_size, uniform_size, varying_size, vertex_size, facevarying_size);
 
2206
        }
 
2207
        virtual ~RiParaboloidCache()
 
2208
        {
 
2209
                // plist gets destroyed by the base class.
 
2210
        }
 
2211
        virtual void ReCall()
 
2212
        {
 
2213
                RiParaboloidV(m_rmax, m_zmin, m_zmax, m_thetamax, m_count, m_tokens, m_values);
 
2214
        }
 
2215
 
 
2216
private:
 
2217
        RtFloat m_rmax;
 
2218
        RtFloat m_zmin;
 
2219
        RtFloat m_zmax;
 
2220
        RtFloat m_thetamax;
 
2221
        // plist information is stored in the base class.
 
2222
};
 
2223
 
 
2224
class RiDiskCache : public RiCacheBase
 
2225
{
 
2226
public:
 
2227
        RiDiskCache(RtFloat height, RtFloat radius, RtFloat thetamax, RtInt count, RtToken tokens[], RtPointer values[]) : RiCacheBase()
 
2228
        {
 
2229
                m_height = height;
 
2230
                m_radius = radius;
 
2231
                m_thetamax = thetamax;
 
2232
                // Copy the plist here.
 
2233
                int constant_size = 1;
 
2234
                int uniform_size = 1;
 
2235
                int varying_size = 1;
 
2236
                int vertex_size = 1;
 
2237
                int facevarying_size = 1;
 
2238
                varying_size = 4;
 
2239
                vertex_size = 4;
 
2240
                facevarying_size = 4;
 
2241
                CachePlist(count, tokens, values, constant_size, uniform_size, varying_size, vertex_size, facevarying_size);
 
2242
        }
 
2243
        virtual ~RiDiskCache()
 
2244
        {
 
2245
                // plist gets destroyed by the base class.
 
2246
        }
 
2247
        virtual void ReCall()
 
2248
        {
 
2249
                RiDiskV(m_height, m_radius, m_thetamax, m_count, m_tokens, m_values);
 
2250
        }
 
2251
 
 
2252
private:
 
2253
        RtFloat m_height;
 
2254
        RtFloat m_radius;
 
2255
        RtFloat m_thetamax;
 
2256
        // plist information is stored in the base class.
 
2257
};
 
2258
 
 
2259
class RiTorusCache : public RiCacheBase
 
2260
{
 
2261
public:
 
2262
        RiTorusCache(RtFloat majorrad, RtFloat minorrad, RtFloat phimin, RtFloat phimax, RtFloat thetamax, RtInt count, RtToken tokens[], RtPointer values[]) : RiCacheBase()
 
2263
        {
 
2264
                m_majorrad = majorrad;
 
2265
                m_minorrad = minorrad;
 
2266
                m_phimin = phimin;
 
2267
                m_phimax = phimax;
 
2268
                m_thetamax = thetamax;
 
2269
                // Copy the plist here.
 
2270
                int constant_size = 1;
 
2271
                int uniform_size = 1;
 
2272
                int varying_size = 1;
 
2273
                int vertex_size = 1;
 
2274
                int facevarying_size = 1;
 
2275
                varying_size = 4;
 
2276
                vertex_size = 4;
 
2277
                facevarying_size = 4;
 
2278
                CachePlist(count, tokens, values, constant_size, uniform_size, varying_size, vertex_size, facevarying_size);
 
2279
        }
 
2280
        virtual ~RiTorusCache()
 
2281
        {
 
2282
                // plist gets destroyed by the base class.
 
2283
        }
 
2284
        virtual void ReCall()
 
2285
        {
 
2286
                RiTorusV(m_majorrad, m_minorrad, m_phimin, m_phimax, m_thetamax, m_count, m_tokens, m_values);
 
2287
        }
 
2288
 
 
2289
private:
 
2290
        RtFloat m_majorrad;
 
2291
        RtFloat m_minorrad;
 
2292
        RtFloat m_phimin;
 
2293
        RtFloat m_phimax;
 
2294
        RtFloat m_thetamax;
 
2295
        // plist information is stored in the base class.
 
2296
};
 
2297
 
 
2298
class RiProceduralCache : public RiCacheBase
 
2299
{
 
2300
public:
 
2301
        RiProceduralCache(RtPointer data, RtBound bound, RtProcSubdivFunc refineproc, RtProcFreeFunc freeproc) : RiCacheBase()
 
2302
        {
 
2303
                m_data = data;
 
2304
                m_bound[0] = bound[0];
 
2305
                m_bound[1] = bound[1];
 
2306
                m_bound[2] = bound[2];
 
2307
                m_bound[3] = bound[3];
 
2308
                m_bound[4] = bound[4];
 
2309
                m_bound[5] = bound[5];
 
2310
                m_refineproc = refineproc;
 
2311
                m_freeproc = freeproc;
 
2312
        }
 
2313
        virtual ~RiProceduralCache()
 
2314
        {
 
2315
        }
 
2316
        virtual void ReCall()
 
2317
        {
 
2318
                RiProcedural(m_data, m_bound, m_refineproc, m_freeproc);
 
2319
        }
 
2320
 
 
2321
private:
 
2322
        RtPointer m_data;
 
2323
        RtBound m_bound;
 
2324
        RtProcSubdivFunc m_refineproc;
 
2325
        RtProcFreeFunc m_freeproc;
 
2326
};
 
2327
 
 
2328
class RiGeometryCache : public RiCacheBase
 
2329
{
 
2330
public:
 
2331
        RiGeometryCache(RtToken type, RtInt count, RtToken tokens[], RtPointer values[]) : RiCacheBase()
 
2332
        {
 
2333
                int __type_length = strlen(type);
 
2334
                m_type = new char[ __type_length + 1 ];
 
2335
                strcpy(m_type, type);
 
2336
                // Copy the plist here.
 
2337
                int constant_size = 1;
 
2338
                int uniform_size = 1;
 
2339
                int varying_size = 1;
 
2340
                int vertex_size = 1;
 
2341
                int facevarying_size = 1;
 
2342
                CachePlist(count, tokens, values, constant_size, uniform_size, varying_size, vertex_size, facevarying_size);
 
2343
        }
 
2344
        virtual ~RiGeometryCache()
 
2345
        {
 
2346
                delete[](m_type);
 
2347
                // plist gets destroyed by the base class.
 
2348
        }
 
2349
        virtual void ReCall()
 
2350
        {
 
2351
                RiGeometryV(m_type, m_count, m_tokens, m_values);
 
2352
        }
 
2353
 
 
2354
private:
 
2355
        RtToken m_type;
 
2356
        // plist information is stored in the base class.
 
2357
};
 
2358
 
 
2359
class RiSolidBeginCache : public RiCacheBase
 
2360
{
 
2361
public:
 
2362
        RiSolidBeginCache(RtToken type) : RiCacheBase()
 
2363
        {
 
2364
                int __type_length = strlen(type);
 
2365
                m_type = new char[ __type_length + 1 ];
 
2366
                strcpy(m_type, type);
 
2367
        }
 
2368
        virtual ~RiSolidBeginCache()
 
2369
        {
 
2370
                delete[](m_type);
 
2371
        }
 
2372
        virtual void ReCall()
 
2373
        {
 
2374
                RiSolidBegin(m_type);
 
2375
        }
 
2376
 
 
2377
private:
 
2378
        RtToken m_type;
 
2379
};
 
2380
 
 
2381
class RiSolidEndCache : public RiCacheBase
 
2382
{
 
2383
public:
 
2384
        RiSolidEndCache() : RiCacheBase()
 
2385
        {
 
2386
        }
 
2387
        virtual ~RiSolidEndCache()
 
2388
        {
 
2389
        }
 
2390
        virtual void ReCall()
 
2391
        {
 
2392
                RiSolidEnd();
 
2393
        }
 
2394
 
 
2395
private:
 
2396
};
 
2397
 
 
2398
class RiObjectBeginCache : public RiCacheBase
 
2399
{
 
2400
public:
 
2401
        RiObjectBeginCache() : RiCacheBase()
 
2402
        {
 
2403
        }
 
2404
        virtual ~RiObjectBeginCache()
 
2405
        {
 
2406
        }
 
2407
        virtual void ReCall()
 
2408
        {
 
2409
                RiObjectBegin();
 
2410
        }
 
2411
 
 
2412
private:
 
2413
};
 
2414
 
 
2415
class RiObjectEndCache : public RiCacheBase
 
2416
{
 
2417
public:
 
2418
        RiObjectEndCache() : RiCacheBase()
 
2419
        {
 
2420
        }
 
2421
        virtual ~RiObjectEndCache()
 
2422
        {
 
2423
        }
 
2424
        virtual void ReCall()
 
2425
        {
 
2426
                RiObjectEnd();
 
2427
        }
 
2428
 
 
2429
private:
 
2430
};
 
2431
 
 
2432
class RiObjectInstanceCache : public RiCacheBase
 
2433
{
 
2434
public:
 
2435
        RiObjectInstanceCache(RtObjectHandle handle) : RiCacheBase()
 
2436
        {
 
2437
                m_handle = handle;
 
2438
        }
 
2439
        virtual ~RiObjectInstanceCache()
 
2440
        {
 
2441
        }
 
2442
        virtual void ReCall()
 
2443
        {
 
2444
                RiObjectInstance(m_handle);
 
2445
        }
 
2446
 
 
2447
private:
 
2448
        RtObjectHandle m_handle;
 
2449
};
 
2450
 
 
2451
class RiMotionBeginVCache : public RiCacheBase
 
2452
{
 
2453
public:
 
2454
        RiMotionBeginVCache(RtInt N, RtFloat times[]) : RiCacheBase()
 
2455
        {
 
2456
                m_N = N;
 
2457
                int __times_length = N;
 
2458
                m_times = new RtFloat[__times_length];
 
2459
                int __times_index;
 
2460
                for(__times_index = 0; __times_index<__times_length; __times_index++)
 
2461
                {
 
2462
                        m_times[__times_index] = times[__times_index];
 
2463
                }
 
2464
        }
 
2465
        virtual ~RiMotionBeginVCache()
 
2466
        {
 
2467
                delete[](m_times);
 
2468
        }
 
2469
        virtual void ReCall()
 
2470
        {
 
2471
                RiMotionBeginV(m_N, m_times);
 
2472
        }
 
2473
 
 
2474
private:
 
2475
        RtInt m_N;
 
2476
        RtFloat* m_times;
 
2477
};
 
2478
 
 
2479
class RiMotionEndCache : public RiCacheBase
 
2480
{
 
2481
public:
 
2482
        RiMotionEndCache() : RiCacheBase()
 
2483
        {
 
2484
        }
 
2485
        virtual ~RiMotionEndCache()
 
2486
        {
 
2487
        }
 
2488
        virtual void ReCall()
 
2489
        {
 
2490
                RiMotionEnd();
 
2491
        }
 
2492
 
 
2493
private:
 
2494
};
 
2495
 
 
2496
class RiMakeTextureCache : public RiCacheBase
 
2497
{
 
2498
public:
 
2499
        RiMakeTextureCache(RtString imagefile, RtString texturefile, RtToken swrap, RtToken twrap, RtFilterFunc filterfunc, RtFloat swidth, RtFloat twidth, RtInt count, RtToken tokens[], RtPointer values[]) : RiCacheBase()
 
2500
        {
 
2501
                int __imagefile_length = strlen(imagefile);
 
2502
                m_imagefile = new char[ __imagefile_length + 1 ];
 
2503
                strcpy(m_imagefile, imagefile);
 
2504
                int __texturefile_length = strlen(texturefile);
 
2505
                m_texturefile = new char[ __texturefile_length + 1 ];
 
2506
                strcpy(m_texturefile, texturefile);
 
2507
                int __swrap_length = strlen(swrap);
 
2508
                m_swrap = new char[ __swrap_length + 1 ];
 
2509
                strcpy(m_swrap, swrap);
 
2510
                int __twrap_length = strlen(twrap);
 
2511
                m_twrap = new char[ __twrap_length + 1 ];
 
2512
                strcpy(m_twrap, twrap);
 
2513
                m_filterfunc = filterfunc;
 
2514
                m_swidth = swidth;
 
2515
                m_twidth = twidth;
 
2516
                // Copy the plist here.
 
2517
                int constant_size = 1;
 
2518
                int uniform_size = 1;
 
2519
                int varying_size = 1;
 
2520
                int vertex_size = 1;
 
2521
                int facevarying_size = 1;
 
2522
                CachePlist(count, tokens, values, constant_size, uniform_size, varying_size, vertex_size, facevarying_size);
 
2523
        }
 
2524
        virtual ~RiMakeTextureCache()
 
2525
        {
 
2526
                delete[](m_imagefile);
 
2527
                delete[](m_texturefile);
 
2528
                delete[](m_swrap);
 
2529
                delete[](m_twrap);
 
2530
                // plist gets destroyed by the base class.
 
2531
        }
 
2532
        virtual void ReCall()
 
2533
        {
 
2534
                RiMakeTextureV(m_imagefile, m_texturefile, m_swrap, m_twrap, m_filterfunc, m_swidth, m_twidth, m_count, m_tokens, m_values);
 
2535
        }
 
2536
 
 
2537
private:
 
2538
        RtString m_imagefile;
 
2539
        RtString m_texturefile;
 
2540
        RtToken m_swrap;
 
2541
        RtToken m_twrap;
 
2542
        RtFilterFunc m_filterfunc;
 
2543
        RtFloat m_swidth;
 
2544
        RtFloat m_twidth;
 
2545
        // plist information is stored in the base class.
 
2546
};
 
2547
 
 
2548
class RiMakeBumpCache : public RiCacheBase
 
2549
{
 
2550
public:
 
2551
        RiMakeBumpCache(RtString imagefile, RtString bumpfile, RtToken swrap, RtToken twrap, RtFilterFunc filterfunc, RtFloat swidth, RtFloat twidth, RtInt count, RtToken tokens[], RtPointer values[]) : RiCacheBase()
 
2552
        {
 
2553
                int __imagefile_length = strlen(imagefile);
 
2554
                m_imagefile = new char[ __imagefile_length + 1 ];
 
2555
                strcpy(m_imagefile, imagefile);
 
2556
                int __bumpfile_length = strlen(bumpfile);
 
2557
                m_bumpfile = new char[ __bumpfile_length + 1 ];
 
2558
                strcpy(m_bumpfile, bumpfile);
 
2559
                int __swrap_length = strlen(swrap);
 
2560
                m_swrap = new char[ __swrap_length + 1 ];
 
2561
                strcpy(m_swrap, swrap);
 
2562
                int __twrap_length = strlen(twrap);
 
2563
                m_twrap = new char[ __twrap_length + 1 ];
 
2564
                strcpy(m_twrap, twrap);
 
2565
                m_filterfunc = filterfunc;
 
2566
                m_swidth = swidth;
 
2567
                m_twidth = twidth;
 
2568
                // Copy the plist here.
 
2569
                int constant_size = 1;
 
2570
                int uniform_size = 1;
 
2571
                int varying_size = 1;
 
2572
                int vertex_size = 1;
 
2573
                int facevarying_size = 1;
 
2574
                CachePlist(count, tokens, values, constant_size, uniform_size, varying_size, vertex_size, facevarying_size);
 
2575
        }
 
2576
        virtual ~RiMakeBumpCache()
 
2577
        {
 
2578
                delete[](m_imagefile);
 
2579
                delete[](m_bumpfile);
 
2580
                delete[](m_swrap);
 
2581
                delete[](m_twrap);
 
2582
                // plist gets destroyed by the base class.
 
2583
        }
 
2584
        virtual void ReCall()
 
2585
        {
 
2586
                RiMakeBumpV(m_imagefile, m_bumpfile, m_swrap, m_twrap, m_filterfunc, m_swidth, m_twidth, m_count, m_tokens, m_values);
 
2587
        }
 
2588
 
 
2589
private:
 
2590
        RtString m_imagefile;
 
2591
        RtString m_bumpfile;
 
2592
        RtToken m_swrap;
 
2593
        RtToken m_twrap;
 
2594
        RtFilterFunc m_filterfunc;
 
2595
        RtFloat m_swidth;
 
2596
        RtFloat m_twidth;
 
2597
        // plist information is stored in the base class.
 
2598
};
 
2599
 
 
2600
class RiMakeLatLongEnvironmentCache : public RiCacheBase
 
2601
{
 
2602
public:
 
2603
        RiMakeLatLongEnvironmentCache(RtString imagefile, RtString reflfile, RtFilterFunc filterfunc, RtFloat swidth, RtFloat twidth, RtInt count, RtToken tokens[], RtPointer values[]) : RiCacheBase()
 
2604
        {
 
2605
                int __imagefile_length = strlen(imagefile);
 
2606
                m_imagefile = new char[ __imagefile_length + 1 ];
 
2607
                strcpy(m_imagefile, imagefile);
 
2608
                int __reflfile_length = strlen(reflfile);
 
2609
                m_reflfile = new char[ __reflfile_length + 1 ];
 
2610
                strcpy(m_reflfile, reflfile);
 
2611
                m_filterfunc = filterfunc;
 
2612
                m_swidth = swidth;
 
2613
                m_twidth = twidth;
 
2614
                // Copy the plist here.
 
2615
                int constant_size = 1;
 
2616
                int uniform_size = 1;
 
2617
                int varying_size = 1;
 
2618
                int vertex_size = 1;
 
2619
                int facevarying_size = 1;
 
2620
                CachePlist(count, tokens, values, constant_size, uniform_size, varying_size, vertex_size, facevarying_size);
 
2621
        }
 
2622
        virtual ~RiMakeLatLongEnvironmentCache()
 
2623
        {
 
2624
                delete[](m_imagefile);
 
2625
                delete[](m_reflfile);
 
2626
                // plist gets destroyed by the base class.
 
2627
        }
 
2628
        virtual void ReCall()
 
2629
        {
 
2630
                RiMakeLatLongEnvironmentV(m_imagefile, m_reflfile, m_filterfunc, m_swidth, m_twidth, m_count, m_tokens, m_values);
 
2631
        }
 
2632
 
 
2633
private:
 
2634
        RtString m_imagefile;
 
2635
        RtString m_reflfile;
 
2636
        RtFilterFunc m_filterfunc;
 
2637
        RtFloat m_swidth;
 
2638
        RtFloat m_twidth;
 
2639
        // plist information is stored in the base class.
 
2640
};
 
2641
 
 
2642
class RiMakeCubeFaceEnvironmentCache : public RiCacheBase
 
2643
{
 
2644
public:
 
2645
        RiMakeCubeFaceEnvironmentCache(RtString px, RtString nx, RtString py, RtString ny, RtString pz, RtString nz, RtString reflfile, RtFloat fov, RtFilterFunc filterfunc, RtFloat swidth, RtFloat twidth, RtInt count, RtToken tokens[], RtPointer values[]) : RiCacheBase()
 
2646
        {
 
2647
                int __px_length = strlen(px);
 
2648
                m_px = new char[ __px_length + 1 ];
 
2649
                strcpy(m_px, px);
 
2650
                int __nx_length = strlen(nx);
 
2651
                m_nx = new char[ __nx_length + 1 ];
 
2652
                strcpy(m_nx, nx);
 
2653
                int __py_length = strlen(py);
 
2654
                m_py = new char[ __py_length + 1 ];
 
2655
                strcpy(m_py, py);
 
2656
                int __ny_length = strlen(ny);
 
2657
                m_ny = new char[ __ny_length + 1 ];
 
2658
                strcpy(m_ny, ny);
 
2659
                int __pz_length = strlen(pz);
 
2660
                m_pz = new char[ __pz_length + 1 ];
 
2661
                strcpy(m_pz, pz);
 
2662
                int __nz_length = strlen(nz);
 
2663
                m_nz = new char[ __nz_length + 1 ];
 
2664
                strcpy(m_nz, nz);
 
2665
                int __reflfile_length = strlen(reflfile);
 
2666
                m_reflfile = new char[ __reflfile_length + 1 ];
 
2667
                strcpy(m_reflfile, reflfile);
 
2668
                m_fov = fov;
 
2669
                m_filterfunc = filterfunc;
 
2670
                m_swidth = swidth;
 
2671
                m_twidth = twidth;
 
2672
                // Copy the plist here.
 
2673
                int constant_size = 1;
 
2674
                int uniform_size = 1;
 
2675
                int varying_size = 1;
 
2676
                int vertex_size = 1;
 
2677
                int facevarying_size = 1;
 
2678
                CachePlist(count, tokens, values, constant_size, uniform_size, varying_size, vertex_size, facevarying_size);
 
2679
        }
 
2680
        virtual ~RiMakeCubeFaceEnvironmentCache()
 
2681
        {
 
2682
                delete[](m_px);
 
2683
                delete[](m_nx);
 
2684
                delete[](m_py);
 
2685
                delete[](m_ny);
 
2686
                delete[](m_pz);
 
2687
                delete[](m_nz);
 
2688
                delete[](m_reflfile);
 
2689
                // plist gets destroyed by the base class.
 
2690
        }
 
2691
        virtual void ReCall()
 
2692
        {
 
2693
                RiMakeCubeFaceEnvironmentV(m_px, m_nx, m_py, m_ny, m_pz, m_nz, m_reflfile, m_fov, m_filterfunc, m_swidth, m_twidth, m_count, m_tokens, m_values);
 
2694
        }
 
2695
 
 
2696
private:
 
2697
        RtString m_px;
 
2698
        RtString m_nx;
 
2699
        RtString m_py;
 
2700
        RtString m_ny;
 
2701
        RtString m_pz;
 
2702
        RtString m_nz;
 
2703
        RtString m_reflfile;
 
2704
        RtFloat m_fov;
 
2705
        RtFilterFunc m_filterfunc;
 
2706
        RtFloat m_swidth;
 
2707
        RtFloat m_twidth;
 
2708
        // plist information is stored in the base class.
 
2709
};
 
2710
 
 
2711
class RiMakeShadowCache : public RiCacheBase
 
2712
{
 
2713
public:
 
2714
        RiMakeShadowCache(RtString picfile, RtString shadowfile, RtInt count, RtToken tokens[], RtPointer values[]) : RiCacheBase()
 
2715
        {
 
2716
                int __picfile_length = strlen(picfile);
 
2717
                m_picfile = new char[ __picfile_length + 1 ];
 
2718
                strcpy(m_picfile, picfile);
 
2719
                int __shadowfile_length = strlen(shadowfile);
 
2720
                m_shadowfile = new char[ __shadowfile_length + 1 ];
 
2721
                strcpy(m_shadowfile, shadowfile);
 
2722
                // Copy the plist here.
 
2723
                int constant_size = 1;
 
2724
                int uniform_size = 1;
 
2725
                int varying_size = 1;
 
2726
                int vertex_size = 1;
 
2727
                int facevarying_size = 1;
 
2728
                CachePlist(count, tokens, values, constant_size, uniform_size, varying_size, vertex_size, facevarying_size);
 
2729
        }
 
2730
        virtual ~RiMakeShadowCache()
 
2731
        {
 
2732
                delete[](m_picfile);
 
2733
                delete[](m_shadowfile);
 
2734
                // plist gets destroyed by the base class.
 
2735
        }
 
2736
        virtual void ReCall()
 
2737
        {
 
2738
                RiMakeShadowV(m_picfile, m_shadowfile, m_count, m_tokens, m_values);
 
2739
        }
 
2740
 
 
2741
private:
 
2742
        RtString m_picfile;
 
2743
        RtString m_shadowfile;
 
2744
        // plist information is stored in the base class.
 
2745
};
 
2746
 
 
2747
class RiMakeOcclusionCache : public RiCacheBase
 
2748
{
 
2749
public:
 
2750
        RiMakeOcclusionCache(RtInt npics, RtString picfiles[], RtString shadowfile, RtInt count, RtToken tokens[], RtPointer values[]) : RiCacheBase()
 
2751
        {
 
2752
                m_npics = npics;
 
2753
                int __picfiles_length = npics;
 
2754
                m_picfiles = new RtString[__picfiles_length];
 
2755
                int __picfiles_index;
 
2756
                for(__picfiles_index = 0; __picfiles_index<__picfiles_length; __picfiles_index++)
 
2757
                {
 
2758
                        int __picfiles_slength = strlen(picfiles[__picfiles_index]);
 
2759
                        m_picfiles[__picfiles_index] = new char[ __picfiles_slength + 1 ];
 
2760
                        strcpy(m_picfiles[__picfiles_index], picfiles[__picfiles_index]);
 
2761
                }
 
2762
                int __shadowfile_length = strlen(shadowfile);
 
2763
                m_shadowfile = new char[ __shadowfile_length + 1 ];
 
2764
                strcpy(m_shadowfile, shadowfile);
 
2765
                // Copy the plist here.
 
2766
                int constant_size = 1;
 
2767
                int uniform_size = 1;
 
2768
                int varying_size = 1;
 
2769
                int vertex_size = 1;
 
2770
                int facevarying_size = 1;
 
2771
                CachePlist(count, tokens, values, constant_size, uniform_size, varying_size, vertex_size, facevarying_size);
 
2772
        }
 
2773
        virtual ~RiMakeOcclusionCache()
 
2774
        {
 
2775
                int __picfiles_length = 1;
 
2776
                int __picfiles_index;
 
2777
                for(__picfiles_index = 0; __picfiles_index<__picfiles_length; __picfiles_index++)
 
2778
                {
 
2779
                        delete[](m_picfiles[__picfiles_index]);
 
2780
                }
 
2781
                delete[](m_picfiles);
 
2782
                delete[](m_shadowfile);
 
2783
                // plist gets destroyed by the base class.
 
2784
        }
 
2785
        virtual void ReCall()
 
2786
        {
 
2787
                RiMakeOcclusionV(m_npics, m_picfiles, m_shadowfile, m_count, m_tokens, m_values);
 
2788
        }
 
2789
 
 
2790
private:
 
2791
        RtInt m_npics;
 
2792
        RtString* m_picfiles;
 
2793
        RtString m_shadowfile;
 
2794
        // plist information is stored in the base class.
 
2795
};
 
2796
 
 
2797
class RiErrorHandlerCache : public RiCacheBase
 
2798
{
 
2799
public:
 
2800
        RiErrorHandlerCache(RtErrorFunc handler) : RiCacheBase()
 
2801
        {
 
2802
                m_handler = handler;
 
2803
        }
 
2804
        virtual ~RiErrorHandlerCache()
 
2805
        {
 
2806
        }
 
2807
        virtual void ReCall()
 
2808
        {
 
2809
                RiErrorHandler(m_handler);
 
2810
        }
 
2811
 
 
2812
private:
 
2813
        RtErrorFunc m_handler;
 
2814
};
 
2815
 
 
2816
class RiClippingPlaneCache : public RiCacheBase
 
2817
{
 
2818
public:
 
2819
        RiClippingPlaneCache(RtFloat x, RtFloat y, RtFloat z, RtFloat nx, RtFloat ny, RtFloat nz) : RiCacheBase()
 
2820
        {
 
2821
                m_x = x;
 
2822
                m_y = y;
 
2823
                m_z = z;
 
2824
                m_nx = nx;
 
2825
                m_ny = ny;
 
2826
                m_nz = nz;
 
2827
        }
 
2828
        virtual ~RiClippingPlaneCache()
 
2829
        {
 
2830
        }
 
2831
        virtual void ReCall()
 
2832
        {
 
2833
                RiClippingPlane(m_x, m_y, m_z, m_nx, m_ny, m_nz);
 
2834
        }
 
2835
 
 
2836
private:
 
2837
        RtFloat m_x;
 
2838
        RtFloat m_y;
 
2839
        RtFloat m_z;
 
2840
        RtFloat m_nx;
 
2841
        RtFloat m_ny;
 
2842
        RtFloat m_nz;
 
2843
};
 
2844
 
 
2845
class RiCoordSysTransformCache : public RiCacheBase
 
2846
{
 
2847
public:
 
2848
        RiCoordSysTransformCache(RtToken space) : RiCacheBase()
 
2849
        {
 
2850
                int __space_length = strlen(space);
 
2851
                m_space = new char[ __space_length + 1 ];
 
2852
                strcpy(m_space, space);
 
2853
        }
 
2854
        virtual ~RiCoordSysTransformCache()
 
2855
        {
 
2856
                delete[](m_space);
 
2857
        }
 
2858
        virtual void ReCall()
 
2859
        {
 
2860
                RiCoordSysTransform(m_space);
 
2861
        }
 
2862
 
 
2863
private:
 
2864
        RtToken m_space;
 
2865
};
 
2866
 
 
2867
class RiBlobbyCache : public RiCacheBase
 
2868
{
 
2869
public:
 
2870
        RiBlobbyCache(RtInt nleaf, RtInt ncode, RtInt code[], RtInt nflt, RtFloat flt[], RtInt nstr, RtToken str[], RtInt count, RtToken tokens[], RtPointer values[]) : RiCacheBase()
 
2871
        {
 
2872
                m_nleaf = nleaf;
 
2873
                m_ncode = ncode;
 
2874
                int __code_length = ncode;
 
2875
                m_code = new RtInt[__code_length];
 
2876
                int __code_index;
 
2877
                for(__code_index = 0; __code_index<__code_length; __code_index++)
 
2878
                {
 
2879
                        m_code[__code_index] = code[__code_index];
 
2880
                }
 
2881
                m_nflt = nflt;
 
2882
                int __flt_length = nflt;
 
2883
                m_flt = new RtFloat[__flt_length];
 
2884
                int __flt_index;
 
2885
                for(__flt_index = 0; __flt_index<__flt_length; __flt_index++)
 
2886
                {
 
2887
                        m_flt[__flt_index] = flt[__flt_index];
 
2888
                }
 
2889
                m_nstr = nstr;
 
2890
                int __str_length = nstr;
 
2891
                m_str = new RtToken[__str_length];
 
2892
                int __str_index;
 
2893
                for(__str_index = 0; __str_index<__str_length; __str_index++)
 
2894
                {
 
2895
                        int __str_slength = strlen(str[__str_index]);
 
2896
                        m_str[__str_index] = new char[ __str_slength + 1 ];
 
2897
                        strcpy(m_str[__str_index], str[__str_index]);
 
2898
                }
 
2899
                // Copy the plist here.
 
2900
                int constant_size = 1;
 
2901
                int uniform_size = 1;
 
2902
                int varying_size = 1;
 
2903
                int vertex_size = 1;
 
2904
                int facevarying_size = 1;
 
2905
                CachePlist(count, tokens, values, constant_size, uniform_size, varying_size, vertex_size, facevarying_size);
 
2906
        }
 
2907
        virtual ~RiBlobbyCache()
 
2908
        {
 
2909
                delete[](m_code);
 
2910
                delete[](m_flt);
 
2911
                int __str_length = 1;
 
2912
                int __str_index;
 
2913
                for(__str_index = 0; __str_index<__str_length; __str_index++)
 
2914
                {
 
2915
                        delete[](m_str[__str_index]);
 
2916
                }
 
2917
                delete[](m_str);
 
2918
                // plist gets destroyed by the base class.
 
2919
        }
 
2920
        virtual void ReCall()
 
2921
        {
 
2922
                RiBlobbyV(m_nleaf, m_ncode, m_code, m_nflt, m_flt, m_nstr, m_str, m_count, m_tokens, m_values);
 
2923
        }
 
2924
 
 
2925
private:
 
2926
        RtInt m_nleaf;
 
2927
        RtInt m_ncode;
 
2928
        RtInt* m_code;
 
2929
        RtInt m_nflt;
 
2930
        RtFloat* m_flt;
 
2931
        RtInt m_nstr;
 
2932
        RtToken* m_str;
 
2933
        // plist information is stored in the base class.
 
2934
};
 
2935
 
 
2936
class RiPointsCache : public RiCacheBase
 
2937
{
 
2938
public:
 
2939
        RiPointsCache(RtInt npoints, RtInt count, RtToken tokens[], RtPointer values[]) : RiCacheBase()
 
2940
        {
 
2941
                m_npoints = npoints;
 
2942
                // Copy the plist here.
 
2943
                int constant_size = 1;
 
2944
                int uniform_size = 1;
 
2945
                int varying_size = 1;
 
2946
                int vertex_size = 1;
 
2947
                int facevarying_size = 1;
 
2948
                varying_size = npoints;
 
2949
                vertex_size = npoints;
 
2950
                facevarying_size = npoints;
 
2951
                CachePlist(count, tokens, values, constant_size, uniform_size, varying_size, vertex_size, facevarying_size);
 
2952
        }
 
2953
        virtual ~RiPointsCache()
 
2954
        {
 
2955
                // plist gets destroyed by the base class.
 
2956
        }
 
2957
        virtual void ReCall()
 
2958
        {
 
2959
                RiPointsV(m_npoints, m_count, m_tokens, m_values);
 
2960
        }
 
2961
 
 
2962
private:
 
2963
        RtInt m_npoints;
 
2964
        // plist information is stored in the base class.
 
2965
};
 
2966
 
 
2967
class RiCurvesCache : public RiCacheBase
 
2968
{
 
2969
public:
 
2970
        RiCurvesCache(RtToken type, RtInt ncurves, RtInt nvertices[], RtToken wrap, RtInt count, RtToken tokens[], RtPointer values[]) : RiCacheBase()
 
2971
        {
 
2972
                int __type_length = strlen(type);
 
2973
                m_type = new char[ __type_length + 1 ];
 
2974
                strcpy(m_type, type);
 
2975
                m_ncurves = ncurves;
 
2976
                int __nvertices_length = ncurves;
 
2977
                m_nvertices = new RtInt[__nvertices_length];
 
2978
                int __nvertices_index;
 
2979
                for(__nvertices_index = 0; __nvertices_index<__nvertices_length; __nvertices_index++)
 
2980
                {
 
2981
                        m_nvertices[__nvertices_index] = nvertices[__nvertices_index];
 
2982
                }
 
2983
                int __wrap_length = strlen(wrap);
 
2984
                m_wrap = new char[ __wrap_length + 1 ];
 
2985
                strcpy(m_wrap, wrap);
 
2986
                // Copy the plist here.
 
2987
                int constant_size = 1;
 
2988
                int uniform_size = 1;
 
2989
                int varying_size = 1;
 
2990
                int vertex_size = 1;
 
2991
                int facevarying_size = 1;
 
2992
                uniform_size = ncurves;
 
2993
                varying_size = 0;
 
2994
                {
 
2995
                        int __i;
 
2996
                        for(__i=0; __i<__nvertices_length; __i++)
 
2997
                        {
 
2998
                                if(strcmp(type, "cubic")==0)
 
2999
                                {
 
3000
                                        int step = QGetRenderContext() ->pattrCurrent()->GetIntegerAttribute( "System", "BasisStep" ) [ 0 ];
 
3001
                                        if(strcmp(wrap, "periodic")==0)
 
3002
                                                varying_size+=nvertices[__i]/step;
 
3003
                                        else
 
3004
                                                varying_size+=((nvertices[__i]-4)/step)+1;
 
3005
                                }
 
3006
                                else
 
3007
                                {
 
3008
                                        if(strcmp(wrap, "periodic")==0)
 
3009
                                                varying_size+=nvertices[__i];
 
3010
                                        else
 
3011
                                                varying_size+=nvertices[__i]-1;
 
3012
                                }
 
3013
                                varying_size+=1;
 
3014
                        }
 
3015
                }
 
3016
                vertex_size = 0;
 
3017
                {
 
3018
                        int __i;
 
3019
                        for(__i=0; __i<ncurves; __i++)
 
3020
                                vertex_size+=nvertices[__i];
 
3021
                }
 
3022
                CachePlist(count, tokens, values, constant_size, uniform_size, varying_size, vertex_size, facevarying_size);
 
3023
        }
 
3024
        virtual ~RiCurvesCache()
 
3025
        {
 
3026
                delete[](m_type);
 
3027
                delete[](m_nvertices);
 
3028
                delete[](m_wrap);
 
3029
                // plist gets destroyed by the base class.
 
3030
        }
 
3031
        virtual void ReCall()
 
3032
        {
 
3033
                RiCurvesV(m_type, m_ncurves, m_nvertices, m_wrap, m_count, m_tokens, m_values);
 
3034
        }
 
3035
 
 
3036
private:
 
3037
        RtToken m_type;
 
3038
        RtInt m_ncurves;
 
3039
        RtInt* m_nvertices;
 
3040
        RtToken m_wrap;
 
3041
        // plist information is stored in the base class.
 
3042
};
 
3043
 
 
3044
class RiSubdivisionMeshCache : public RiCacheBase
 
3045
{
 
3046
public:
 
3047
        RiSubdivisionMeshCache(RtToken scheme, RtInt nfaces, RtInt nvertices[], RtInt vertices[], RtInt ntags, RtToken tags[], RtInt nargs[], RtInt intargs[], RtFloat floatargs[], RtInt count, RtToken tokens[], RtPointer values[]) : RiCacheBase()
 
3048
        {
 
3049
                int __scheme_length = strlen(scheme);
 
3050
                m_scheme = new char[ __scheme_length + 1 ];
 
3051
                strcpy(m_scheme, scheme);
 
3052
                m_nfaces = nfaces;
 
3053
                int __nvertices_length = nfaces;
 
3054
                m_nvertices = new RtInt[__nvertices_length];
 
3055
                int __nvertices_index;
 
3056
                for(__nvertices_index = 0; __nvertices_index<__nvertices_length; __nvertices_index++)
 
3057
                {
 
3058
                        m_nvertices[__nvertices_index] = nvertices[__nvertices_index];
 
3059
                }
 
3060
                int __vertices_length = 0;
 
3061
                {
 
3062
                        int __i;
 
3063
                        for(__i=0; __i<nfaces; __i++)
 
3064
                                __vertices_length+=nvertices[__i];
 
3065
                }
 
3066
                m_vertices = new RtInt[__vertices_length];
 
3067
                int __vertices_index;
 
3068
                for(__vertices_index = 0; __vertices_index<__vertices_length; __vertices_index++)
 
3069
                {
 
3070
                        m_vertices[__vertices_index] = vertices[__vertices_index];
 
3071
                }
 
3072
                m_ntags = ntags;
 
3073
                int __tags_length = ntags;              m_tags = new RtToken[__tags_length];
 
3074
                int __tags_index;
 
3075
                for(__tags_index = 0; __tags_index<__tags_length; __tags_index++)
 
3076
                {
 
3077
                        int __tags_slength = strlen(tags[__tags_index]);
 
3078
                        m_tags[__tags_index] = new char[ __tags_slength + 1 ];
 
3079
                        strcpy(m_tags[__tags_index], tags[__tags_index]);
 
3080
                }
 
3081
                int __nargs_length = ntags*2;
 
3082
                m_nargs = new RtInt[__nargs_length];
 
3083
                int __nargs_index;
 
3084
                for(__nargs_index = 0; __nargs_index<__nargs_length; __nargs_index++)
 
3085
                {
 
3086
                        m_nargs[__nargs_index] = nargs[__nargs_index];
 
3087
                }
 
3088
                int __intargs_length = 0;
 
3089
                {
 
3090
                        int __i;
 
3091
                        for(__i=0; __i<ntags*2; __i+=2)
 
3092
                                __intargs_length+=nargs[__i];
 
3093
                }
 
3094
                m_intargs = new RtInt[__intargs_length];
 
3095
                int __intargs_index;
 
3096
                for(__intargs_index = 0; __intargs_index<__intargs_length; __intargs_index++)
 
3097
                {
 
3098
                        m_intargs[__intargs_index] = intargs[__intargs_index];
 
3099
                }
 
3100
                int __floatargs_length = 0;
 
3101
                {
 
3102
                        int __i;
 
3103
                        for(__i=0; __i<ntags*2; __i+=2)
 
3104
                                __floatargs_length+=nargs[__i+1];
 
3105
                }
 
3106
                m_floatargs = new RtFloat[__floatargs_length];
 
3107
                int __floatargs_index;
 
3108
                for(__floatargs_index = 0; __floatargs_index<__floatargs_length; __floatargs_index++)
 
3109
                {
 
3110
                        m_floatargs[__floatargs_index] = floatargs[__floatargs_index];
 
3111
                }
 
3112
                // Copy the plist here.
 
3113
                int constant_size = 1;
 
3114
                int uniform_size = 1;
 
3115
                int varying_size = 1;
 
3116
                int vertex_size = 1;
 
3117
                int facevarying_size = 1;
 
3118
                varying_size=0;
 
3119
                {
 
3120
                        int __i;
 
3121
                        for(__i=0; __i<__vertices_length; __i++)
 
3122
                                if(vertices[__i]>varying_size)
 
3123
                                        varying_size=vertices[__i];
 
3124
                }
 
3125
                varying_size+=1;
 
3126
                vertex_size=varying_size;
 
3127
                facevarying_size=0;
 
3128
                {
 
3129
                        int __i;
 
3130
                        for(__i=0; __i<nfaces; __i++)
 
3131
                                facevarying_size+=nvertices[__i];
 
3132
                }
 
3133
                CachePlist(count, tokens, values, constant_size, uniform_size, varying_size, vertex_size, facevarying_size);
 
3134
        }
 
3135
        virtual ~RiSubdivisionMeshCache()
 
3136
        {
 
3137
                delete[](m_scheme);
 
3138
                delete[](m_nvertices);
 
3139
                delete[](m_vertices);
 
3140
                int __tags_length = 1;
 
3141
                int __tags_index;
 
3142
                for(__tags_index = 0; __tags_index<__tags_length; __tags_index++)
 
3143
                {
 
3144
                        delete[](m_tags[__tags_index]);
 
3145
                }
 
3146
                delete[](m_tags);
 
3147
                delete[](m_nargs);
 
3148
                delete[](m_intargs);
 
3149
                delete[](m_floatargs);
 
3150
                // plist gets destroyed by the base class.
 
3151
        }
 
3152
        virtual void ReCall()
 
3153
        {
 
3154
                RiSubdivisionMeshV(m_scheme, m_nfaces, m_nvertices, m_vertices, m_ntags, m_tags, m_nargs, m_intargs, m_floatargs, m_count, m_tokens, m_values);
 
3155
        }
 
3156
 
 
3157
private:
 
3158
        RtToken m_scheme;
 
3159
        RtInt m_nfaces;
 
3160
        RtInt* m_nvertices;
 
3161
        RtInt* m_vertices;
 
3162
        RtInt m_ntags;
 
3163
        RtToken* m_tags;
 
3164
        RtInt* m_nargs;
 
3165
        RtInt* m_intargs;
 
3166
        RtFloat* m_floatargs;
 
3167
        // plist information is stored in the base class.
 
3168
};
 
3169
 
 
3170
class RiReadArchiveCache : public RiCacheBase
 
3171
{
 
3172
public:
 
3173
        RiReadArchiveCache(RtToken name, RtArchiveCallback callback, RtInt count, RtToken tokens[], RtPointer values[]) : RiCacheBase()
 
3174
        {
 
3175
                int __name_length = strlen(name);
 
3176
                m_name = new char[ __name_length + 1 ];
 
3177
                strcpy(m_name, name);
 
3178
                m_callback = callback;
 
3179
                // Copy the plist here.
 
3180
                int constant_size = 1;
 
3181
                int uniform_size = 1;
 
3182
                int varying_size = 1;
 
3183
                int vertex_size = 1;
 
3184
                int facevarying_size = 1;
 
3185
                CachePlist(count, tokens, values, constant_size, uniform_size, varying_size, vertex_size, facevarying_size);
 
3186
        }
 
3187
        virtual ~RiReadArchiveCache()
 
3188
        {
 
3189
                delete[](m_name);
 
3190
                // plist gets destroyed by the base class.
 
3191
        }
 
3192
        virtual void ReCall()
 
3193
        {
 
3194
                RiReadArchiveV(m_name, m_callback, m_count, m_tokens, m_values);
 
3195
        }
 
3196
 
 
3197
private:
 
3198
        RtToken m_name;
 
3199
        RtArchiveCallback m_callback;
 
3200
        // plist information is stored in the base class.
 
3201
};
 
3202
 
 
3203
#define Cache_RiDeclare\
 
3204
        if( QGetRenderContext()->pCurrentObject()) \
 
3205
        { \
 
3206
                        QGetRenderContext()->pCurrentObject()->AddCacheCommand( \
 
3207
                                        new RiDeclareCache(name, declaration) ); \
 
3208
                return(0);      \
 
3209
        }
 
3210
        #define Cache_RiFrameBegin\
 
3211
        if( QGetRenderContext()->pCurrentObject()) \
 
3212
        { \
 
3213
                        QGetRenderContext()->pCurrentObject()->AddCacheCommand( \
 
3214
                                        new RiFrameBeginCache(number) ); \
 
3215
                return; \
 
3216
        }
 
3217
        #define Cache_RiFrameEnd\
 
3218
        if( QGetRenderContext()->pCurrentObject()) \
 
3219
        { \
 
3220
                        QGetRenderContext()->pCurrentObject()->AddCacheCommand( \
 
3221
                                        new RiFrameEndCache() ); \
 
3222
                return; \
 
3223
        }
 
3224
        #define Cache_RiWorldBegin\
 
3225
        if( QGetRenderContext()->pCurrentObject()) \
 
3226
        { \
 
3227
                        QGetRenderContext()->pCurrentObject()->AddCacheCommand( \
 
3228
                                        new RiWorldBeginCache() ); \
 
3229
                return; \
 
3230
        }
 
3231
        #define Cache_RiWorldEnd\
 
3232
        if( QGetRenderContext()->pCurrentObject()) \
 
3233
        { \
 
3234
                        QGetRenderContext()->pCurrentObject()->AddCacheCommand( \
 
3235
                                        new RiWorldEndCache() ); \
 
3236
                return; \
 
3237
        }
 
3238
        #define Cache_RiFormat\
 
3239
        if( QGetRenderContext()->pCurrentObject()) \
 
3240
        { \
 
3241
                        QGetRenderContext()->pCurrentObject()->AddCacheCommand( \
 
3242
                                        new RiFormatCache(xresolution, yresolution, pixelaspectratio) ); \
 
3243
                return; \
 
3244
        }
 
3245
        #define Cache_RiFrameAspectRatio\
 
3246
        if( QGetRenderContext()->pCurrentObject()) \
 
3247
        { \
 
3248
                        QGetRenderContext()->pCurrentObject()->AddCacheCommand( \
 
3249
                                        new RiFrameAspectRatioCache(frameratio) ); \
 
3250
                return; \
 
3251
        }
 
3252
        #define Cache_RiScreenWindow\
 
3253
        if( QGetRenderContext()->pCurrentObject()) \
 
3254
        { \
 
3255
                        QGetRenderContext()->pCurrentObject()->AddCacheCommand( \
 
3256
                                        new RiScreenWindowCache(left, right, bottom, top) ); \
 
3257
                return; \
 
3258
        }
 
3259
        #define Cache_RiCropWindow\
 
3260
        if( QGetRenderContext()->pCurrentObject()) \
 
3261
        { \
 
3262
                        QGetRenderContext()->pCurrentObject()->AddCacheCommand( \
 
3263
                                        new RiCropWindowCache(left, right, top, bottom) ); \
 
3264
                return; \
 
3265
        }
 
3266
        #define Cache_RiProjection\
 
3267
        if( QGetRenderContext()->pCurrentObject()) \
 
3268
        { \
 
3269
                        QGetRenderContext()->pCurrentObject()->AddCacheCommand( \
 
3270
                                        new RiProjectionCache(name, count, tokens, values) ); \
 
3271
                return; \
 
3272
        }
 
3273
        #define Cache_RiClipping\
 
3274
        if( QGetRenderContext()->pCurrentObject()) \
 
3275
        { \
 
3276
                        QGetRenderContext()->pCurrentObject()->AddCacheCommand( \
 
3277
                                        new RiClippingCache(cnear, cfar) ); \
 
3278
                return; \
 
3279
        }
 
3280
        #define Cache_RiDepthOfField\
 
3281
        if( QGetRenderContext()->pCurrentObject()) \
 
3282
        { \
 
3283
                        QGetRenderContext()->pCurrentObject()->AddCacheCommand( \
 
3284
                                        new RiDepthOfFieldCache(fstop, focallength, focaldistance) ); \
 
3285
                return; \
 
3286
        }
 
3287
        #define Cache_RiShutter\
 
3288
        if( QGetRenderContext()->pCurrentObject()) \
 
3289
        { \
 
3290
                        QGetRenderContext()->pCurrentObject()->AddCacheCommand( \
 
3291
                                        new RiShutterCache(opentime, closetime) ); \
 
3292
                return; \
 
3293
        }
 
3294
        #define Cache_RiPixelVariance\
 
3295
        if( QGetRenderContext()->pCurrentObject()) \
 
3296
        { \
 
3297
                        QGetRenderContext()->pCurrentObject()->AddCacheCommand( \
 
3298
                                        new RiPixelVarianceCache(variance) ); \
 
3299
                return; \
 
3300
        }
 
3301
        #define Cache_RiPixelSamples\
 
3302
        if( QGetRenderContext()->pCurrentObject()) \
 
3303
        { \
 
3304
                        QGetRenderContext()->pCurrentObject()->AddCacheCommand( \
 
3305
                                        new RiPixelSamplesCache(xsamples, ysamples) ); \
 
3306
                return; \
 
3307
        }
 
3308
        #define Cache_RiPixelFilter\
 
3309
        if( QGetRenderContext()->pCurrentObject()) \
 
3310
        { \
 
3311
                        QGetRenderContext()->pCurrentObject()->AddCacheCommand( \
 
3312
                                        new RiPixelFilterCache(function, xwidth, ywidth) ); \
 
3313
                return; \
 
3314
        }
 
3315
        #define Cache_RiExposure\
 
3316
        if( QGetRenderContext()->pCurrentObject()) \
 
3317
        { \
 
3318
                        QGetRenderContext()->pCurrentObject()->AddCacheCommand( \
 
3319
                                        new RiExposureCache(gain, gamma) ); \
 
3320
                return; \
 
3321
        }
 
3322
        #define Cache_RiImager\
 
3323
        if( QGetRenderContext()->pCurrentObject()) \
 
3324
        { \
 
3325
                        QGetRenderContext()->pCurrentObject()->AddCacheCommand( \
 
3326
                                        new RiImagerCache(name, count, tokens, values) ); \
 
3327
                return; \
 
3328
        }
 
3329
        #define Cache_RiQuantize\
 
3330
        if( QGetRenderContext()->pCurrentObject()) \
 
3331
        { \
 
3332
                        QGetRenderContext()->pCurrentObject()->AddCacheCommand( \
 
3333
                                        new RiQuantizeCache(type, one, min, max, ditheramplitude) ); \
 
3334
                return; \
 
3335
        }
 
3336
        #define Cache_RiDisplay\
 
3337
        if( QGetRenderContext()->pCurrentObject()) \
 
3338
        { \
 
3339
                        QGetRenderContext()->pCurrentObject()->AddCacheCommand( \
 
3340
                                        new RiDisplayCache(name, type, mode, count, tokens, values) ); \
 
3341
                return; \
 
3342
        }
 
3343
        #define Cache_RiHider\
 
3344
        if( QGetRenderContext()->pCurrentObject()) \
 
3345
        { \
 
3346
                        QGetRenderContext()->pCurrentObject()->AddCacheCommand( \
 
3347
                                        new RiHiderCache(name, count, tokens, values) ); \
 
3348
                return; \
 
3349
        }
 
3350
        #define Cache_RiColorSamples\
 
3351
        if( QGetRenderContext()->pCurrentObject()) \
 
3352
        { \
 
3353
                        QGetRenderContext()->pCurrentObject()->AddCacheCommand( \
 
3354
                                        new RiColorSamplesCache(N, nRGB, RGBn) ); \
 
3355
                return; \
 
3356
        }
 
3357
        #define Cache_RiRelativeDetail\
 
3358
        if( QGetRenderContext()->pCurrentObject()) \
 
3359
        { \
 
3360
                        QGetRenderContext()->pCurrentObject()->AddCacheCommand( \
 
3361
                                        new RiRelativeDetailCache(relativedetail) ); \
 
3362
                return; \
 
3363
        }
 
3364
        #define Cache_RiOption\
 
3365
        if( QGetRenderContext()->pCurrentObject()) \
 
3366
        { \
 
3367
                        QGetRenderContext()->pCurrentObject()->AddCacheCommand( \
 
3368
                                        new RiOptionCache(name, count, tokens, values) ); \
 
3369
                return; \
 
3370
        }
 
3371
        #define Cache_RiAttributeBegin\
 
3372
        if( QGetRenderContext()->pCurrentObject()) \
 
3373
        { \
 
3374
                        QGetRenderContext()->pCurrentObject()->AddCacheCommand( \
 
3375
                                        new RiAttributeBeginCache() ); \
 
3376
                return; \
 
3377
        }
 
3378
        #define Cache_RiAttributeEnd\
 
3379
        if( QGetRenderContext()->pCurrentObject()) \
 
3380
        { \
 
3381
                        QGetRenderContext()->pCurrentObject()->AddCacheCommand( \
 
3382
                                        new RiAttributeEndCache() ); \
 
3383
                return; \
 
3384
        }
 
3385
        #define Cache_RiColor\
 
3386
        if( QGetRenderContext()->pCurrentObject()) \
 
3387
        { \
 
3388
                        QGetRenderContext()->pCurrentObject()->AddCacheCommand( \
 
3389
                                        new RiColorCache(Cq) ); \
 
3390
                return; \
 
3391
        }
 
3392
        #define Cache_RiOpacity\
 
3393
        if( QGetRenderContext()->pCurrentObject()) \
 
3394
        { \
 
3395
                        QGetRenderContext()->pCurrentObject()->AddCacheCommand( \
 
3396
                                        new RiOpacityCache(Os) ); \
 
3397
                return; \
 
3398
        }
 
3399
        #define Cache_RiTextureCoordinates\
 
3400
        if( QGetRenderContext()->pCurrentObject()) \
 
3401
        { \
 
3402
                        QGetRenderContext()->pCurrentObject()->AddCacheCommand( \
 
3403
                                        new RiTextureCoordinatesCache(s1, t1, s2, t2, s3, t3, s4, t4) ); \
 
3404
                return; \
 
3405
        }
 
3406
        #define Cache_RiLightSource\
 
3407
        if( QGetRenderContext()->pCurrentObject()) \
 
3408
        { \
 
3409
                        QGetRenderContext()->pCurrentObject()->AddCacheCommand( \
 
3410
                                        new RiLightSourceCache(name, count, tokens, values) ); \
 
3411
                return(0);      \
 
3412
        }
 
3413
        #define Cache_RiAreaLightSource\
 
3414
        if( QGetRenderContext()->pCurrentObject()) \
 
3415
        { \
 
3416
                        QGetRenderContext()->pCurrentObject()->AddCacheCommand( \
 
3417
                                        new RiAreaLightSourceCache(name, count, tokens, values) ); \
 
3418
                return(0);      \
 
3419
        }
 
3420
        #define Cache_RiIlluminate\
 
3421
        if( QGetRenderContext()->pCurrentObject()) \
 
3422
        { \
 
3423
                        QGetRenderContext()->pCurrentObject()->AddCacheCommand( \
 
3424
                                        new RiIlluminateCache(light, onoff) ); \
 
3425
                return; \
 
3426
        }
 
3427
        #define Cache_RiSurface\
 
3428
        if( QGetRenderContext()->pCurrentObject()) \
 
3429
        { \
 
3430
                        QGetRenderContext()->pCurrentObject()->AddCacheCommand( \
 
3431
                                        new RiSurfaceCache(name, count, tokens, values) ); \
 
3432
                return; \
 
3433
        }
 
3434
        #define Cache_RiAtmosphere\
 
3435
        if( QGetRenderContext()->pCurrentObject()) \
 
3436
        { \
 
3437
                        QGetRenderContext()->pCurrentObject()->AddCacheCommand( \
 
3438
                                        new RiAtmosphereCache(name, count, tokens, values) ); \
 
3439
                return; \
 
3440
        }
 
3441
        #define Cache_RiInterior\
 
3442
        if( QGetRenderContext()->pCurrentObject()) \
 
3443
        { \
 
3444
                        QGetRenderContext()->pCurrentObject()->AddCacheCommand( \
 
3445
                                        new RiInteriorCache(name, count, tokens, values) ); \
 
3446
                return; \
 
3447
        }
 
3448
        #define Cache_RiExterior\
 
3449
        if( QGetRenderContext()->pCurrentObject()) \
 
3450
        { \
 
3451
                        QGetRenderContext()->pCurrentObject()->AddCacheCommand( \
 
3452
                                        new RiExteriorCache(name, count, tokens, values) ); \
 
3453
                return; \
 
3454
        }
 
3455
        #define Cache_RiShadingRate\
 
3456
        if( QGetRenderContext()->pCurrentObject()) \
 
3457
        { \
 
3458
                        QGetRenderContext()->pCurrentObject()->AddCacheCommand( \
 
3459
                                        new RiShadingRateCache(size) ); \
 
3460
                return; \
 
3461
        }
 
3462
        #define Cache_RiShadingInterpolation\
 
3463
        if( QGetRenderContext()->pCurrentObject()) \
 
3464
        { \
 
3465
                        QGetRenderContext()->pCurrentObject()->AddCacheCommand( \
 
3466
                                        new RiShadingInterpolationCache(type) ); \
 
3467
                return; \
 
3468
        }
 
3469
        #define Cache_RiMatte\
 
3470
        if( QGetRenderContext()->pCurrentObject()) \
 
3471
        { \
 
3472
                        QGetRenderContext()->pCurrentObject()->AddCacheCommand( \
 
3473
                                        new RiMatteCache(onoff) ); \
 
3474
                return; \
 
3475
        }
 
3476
        #define Cache_RiBound\
 
3477
        if( QGetRenderContext()->pCurrentObject()) \
 
3478
        { \
 
3479
                        QGetRenderContext()->pCurrentObject()->AddCacheCommand( \
 
3480
                                        new RiBoundCache(bound) ); \
 
3481
                return; \
 
3482
        }
 
3483
        #define Cache_RiDetail\
 
3484
        if( QGetRenderContext()->pCurrentObject()) \
 
3485
        { \
 
3486
                        QGetRenderContext()->pCurrentObject()->AddCacheCommand( \
 
3487
                                        new RiDetailCache(bound) ); \
 
3488
                return; \
 
3489
        }
 
3490
        #define Cache_RiDetailRange\
 
3491
        if( QGetRenderContext()->pCurrentObject()) \
 
3492
        { \
 
3493
                        QGetRenderContext()->pCurrentObject()->AddCacheCommand( \
 
3494
                                        new RiDetailRangeCache(offlow, onlow, onhigh, offhigh) ); \
 
3495
                return; \
 
3496
        }
 
3497
        #define Cache_RiGeometricApproximation\
 
3498
        if( QGetRenderContext()->pCurrentObject()) \
 
3499
        { \
 
3500
                        QGetRenderContext()->pCurrentObject()->AddCacheCommand( \
 
3501
                                        new RiGeometricApproximationCache(type, value) ); \
 
3502
                return; \
 
3503
        }
 
3504
        #define Cache_RiOrientation\
 
3505
        if( QGetRenderContext()->pCurrentObject()) \
 
3506
        { \
 
3507
                        QGetRenderContext()->pCurrentObject()->AddCacheCommand( \
 
3508
                                        new RiOrientationCache(orientation) ); \
 
3509
                return; \
 
3510
        }
 
3511
        #define Cache_RiReverseOrientation\
 
3512
        if( QGetRenderContext()->pCurrentObject()) \
 
3513
        { \
 
3514
                        QGetRenderContext()->pCurrentObject()->AddCacheCommand( \
 
3515
                                        new RiReverseOrientationCache() ); \
 
3516
                return; \
 
3517
        }
 
3518
        #define Cache_RiSides\
 
3519
        if( QGetRenderContext()->pCurrentObject()) \
 
3520
        { \
 
3521
                        QGetRenderContext()->pCurrentObject()->AddCacheCommand( \
 
3522
                                        new RiSidesCache(nsides) ); \
 
3523
                return; \
 
3524
        }
 
3525
        #define Cache_RiIdentity\
 
3526
        if( QGetRenderContext()->pCurrentObject()) \
 
3527
        { \
 
3528
                        QGetRenderContext()->pCurrentObject()->AddCacheCommand( \
 
3529
                                        new RiIdentityCache() ); \
 
3530
                return; \
 
3531
        }
 
3532
        #define Cache_RiTransform\
 
3533
        if( QGetRenderContext()->pCurrentObject()) \
 
3534
        { \
 
3535
                        QGetRenderContext()->pCurrentObject()->AddCacheCommand( \
 
3536
                                        new RiTransformCache(transform) ); \
 
3537
                return; \
 
3538
        }
 
3539
        #define Cache_RiConcatTransform\
 
3540
        if( QGetRenderContext()->pCurrentObject()) \
 
3541
        { \
 
3542
                        QGetRenderContext()->pCurrentObject()->AddCacheCommand( \
 
3543
                                        new RiConcatTransformCache(transform) ); \
 
3544
                return; \
 
3545
        }
 
3546
        #define Cache_RiPerspective\
 
3547
        if( QGetRenderContext()->pCurrentObject()) \
 
3548
        { \
 
3549
                        QGetRenderContext()->pCurrentObject()->AddCacheCommand( \
 
3550
                                        new RiPerspectiveCache(fov) ); \
 
3551
                return; \
 
3552
        }
 
3553
        #define Cache_RiTranslate\
 
3554
        if( QGetRenderContext()->pCurrentObject()) \
 
3555
        { \
 
3556
                        QGetRenderContext()->pCurrentObject()->AddCacheCommand( \
 
3557
                                        new RiTranslateCache(dx, dy, dz) ); \
 
3558
                return; \
 
3559
        }
 
3560
        #define Cache_RiRotate\
 
3561
        if( QGetRenderContext()->pCurrentObject()) \
 
3562
        { \
 
3563
                        QGetRenderContext()->pCurrentObject()->AddCacheCommand( \
 
3564
                                        new RiRotateCache(angle, dx, dy, dz) ); \
 
3565
                return; \
 
3566
        }
 
3567
        #define Cache_RiScale\
 
3568
        if( QGetRenderContext()->pCurrentObject()) \
 
3569
        { \
 
3570
                        QGetRenderContext()->pCurrentObject()->AddCacheCommand( \
 
3571
                                        new RiScaleCache(sx, sy, sz) ); \
 
3572
                return; \
 
3573
        }
 
3574
        #define Cache_RiSkew\
 
3575
        if( QGetRenderContext()->pCurrentObject()) \
 
3576
        { \
 
3577
                        QGetRenderContext()->pCurrentObject()->AddCacheCommand( \
 
3578
                                        new RiSkewCache(angle, dx1, dy1, dz1, dx2, dy2, dz2) ); \
 
3579
                return; \
 
3580
        }
 
3581
        #define Cache_RiDeformation\
 
3582
        if( QGetRenderContext()->pCurrentObject()) \
 
3583
        { \
 
3584
                        QGetRenderContext()->pCurrentObject()->AddCacheCommand( \
 
3585
                                        new RiDeformationCache(name, count, tokens, values) ); \
 
3586
                return; \
 
3587
        }
 
3588
        #define Cache_RiDisplacement\
 
3589
        if( QGetRenderContext()->pCurrentObject()) \
 
3590
        { \
 
3591
                        QGetRenderContext()->pCurrentObject()->AddCacheCommand( \
 
3592
                                        new RiDisplacementCache(name, count, tokens, values) ); \
 
3593
                return; \
 
3594
        }
 
3595
        #define Cache_RiCoordinateSystem\
 
3596
        if( QGetRenderContext()->pCurrentObject()) \
 
3597
        { \
 
3598
                        QGetRenderContext()->pCurrentObject()->AddCacheCommand( \
 
3599
                                        new RiCoordinateSystemCache(space) ); \
 
3600
                return; \
 
3601
        }
 
3602
        #define Cache_RiTransformPoints\
 
3603
        if( QGetRenderContext()->pCurrentObject()) \
 
3604
        { \
 
3605
                        QGetRenderContext()->pCurrentObject()->AddCacheCommand( \
 
3606
                                        new RiTransformPointsCache(fromspace, tospace, npoints, points) ); \
 
3607
                return(0);      \
 
3608
        }
 
3609
        #define Cache_RiTransformBegin\
 
3610
        if( QGetRenderContext()->pCurrentObject()) \
 
3611
        { \
 
3612
                        QGetRenderContext()->pCurrentObject()->AddCacheCommand( \
 
3613
                                        new RiTransformBeginCache() ); \
 
3614
                return; \
 
3615
        }
 
3616
        #define Cache_RiTransformEnd\
 
3617
        if( QGetRenderContext()->pCurrentObject()) \
 
3618
        { \
 
3619
                        QGetRenderContext()->pCurrentObject()->AddCacheCommand( \
 
3620
                                        new RiTransformEndCache() ); \
 
3621
                return; \
 
3622
        }
 
3623
        #define Cache_RiAttribute\
 
3624
        if( QGetRenderContext()->pCurrentObject()) \
 
3625
        { \
 
3626
                        QGetRenderContext()->pCurrentObject()->AddCacheCommand( \
 
3627
                                        new RiAttributeCache(name, count, tokens, values) ); \
 
3628
                return; \
 
3629
        }
 
3630
        #define Cache_RiPolygon\
 
3631
        if( QGetRenderContext()->pCurrentObject()) \
 
3632
        { \
 
3633
                        QGetRenderContext()->pCurrentObject()->AddCacheCommand( \
 
3634
                                        new RiPolygonCache(nvertices, count, tokens, values) ); \
 
3635
                return; \
 
3636
        }
 
3637
        #define Cache_RiGeneralPolygon\
 
3638
        if( QGetRenderContext()->pCurrentObject()) \
 
3639
        { \
 
3640
                        QGetRenderContext()->pCurrentObject()->AddCacheCommand( \
 
3641
                                        new RiGeneralPolygonCache(nloops, nverts, count, tokens, values) ); \
 
3642
                return; \
 
3643
        }
 
3644
        #define Cache_RiPointsPolygons\
 
3645
        if( QGetRenderContext()->pCurrentObject()) \
 
3646
        { \
 
3647
                        QGetRenderContext()->pCurrentObject()->AddCacheCommand( \
 
3648
                                        new RiPointsPolygonsCache(npolys, nverts, verts, count, tokens, values) ); \
 
3649
                return; \
 
3650
        }
 
3651
        #define Cache_RiPointsGeneralPolygons\
 
3652
        if( QGetRenderContext()->pCurrentObject()) \
 
3653
        { \
 
3654
                        QGetRenderContext()->pCurrentObject()->AddCacheCommand( \
 
3655
                                        new RiPointsGeneralPolygonsCache(npolys, nloops, nverts, verts, count, tokens, values) ); \
 
3656
                return; \
 
3657
        }
 
3658
        #define Cache_RiBasis\
 
3659
        if( QGetRenderContext()->pCurrentObject()) \
 
3660
        { \
 
3661
                        QGetRenderContext()->pCurrentObject()->AddCacheCommand( \
 
3662
                                        new RiBasisCache(ubasis, ustep, vbasis, vstep) ); \
 
3663
                return; \
 
3664
        }
 
3665
        #define Cache_RiPatch\
 
3666
        if( QGetRenderContext()->pCurrentObject()) \
 
3667
        { \
 
3668
                        QGetRenderContext()->pCurrentObject()->AddCacheCommand( \
 
3669
                                        new RiPatchCache(type, count, tokens, values) ); \
 
3670
                return; \
 
3671
        }
 
3672
        #define Cache_RiPatchMesh\
 
3673
        if( QGetRenderContext()->pCurrentObject()) \
 
3674
        { \
 
3675
                        QGetRenderContext()->pCurrentObject()->AddCacheCommand( \
 
3676
                                        new RiPatchMeshCache(type, nu, uwrap, nv, vwrap, count, tokens, values) ); \
 
3677
                return; \
 
3678
        }
 
3679
        #define Cache_RiNuPatch\
 
3680
        if( QGetRenderContext()->pCurrentObject()) \
 
3681
        { \
 
3682
                        QGetRenderContext()->pCurrentObject()->AddCacheCommand( \
 
3683
                                        new RiNuPatchCache(nu, uorder, uknot, umin, umax, nv, vorder, vknot, vmin, vmax, count, tokens, values) ); \
 
3684
                return; \
 
3685
        }
 
3686
        #define Cache_RiTrimCurve\
 
3687
        if( QGetRenderContext()->pCurrentObject()) \
 
3688
        { \
 
3689
                        QGetRenderContext()->pCurrentObject()->AddCacheCommand( \
 
3690
                                        new RiTrimCurveCache(nloops, ncurves, order, knot, min, max, n, u, v, w) ); \
 
3691
                return; \
 
3692
        }
 
3693
        #define Cache_RiSphere\
 
3694
        if( QGetRenderContext()->pCurrentObject()) \
 
3695
        { \
 
3696
                        QGetRenderContext()->pCurrentObject()->AddCacheCommand( \
 
3697
                                        new RiSphereCache(radius, zmin, zmax, thetamax, count, tokens, values) ); \
 
3698
                return; \
 
3699
        }
 
3700
        #define Cache_RiCone\
 
3701
        if( QGetRenderContext()->pCurrentObject()) \
 
3702
        { \
 
3703
                        QGetRenderContext()->pCurrentObject()->AddCacheCommand( \
 
3704
                                        new RiConeCache(height, radius, thetamax, count, tokens, values) ); \
 
3705
                return; \
 
3706
        }
 
3707
        #define Cache_RiCylinder\
 
3708
        if( QGetRenderContext()->pCurrentObject()) \
 
3709
        { \
 
3710
                        QGetRenderContext()->pCurrentObject()->AddCacheCommand( \
 
3711
                                        new RiCylinderCache(radius, zmin, zmax, thetamax, count, tokens, values) ); \
 
3712
                return; \
 
3713
        }
 
3714
        #define Cache_RiHyperboloid\
 
3715
        if( QGetRenderContext()->pCurrentObject()) \
 
3716
        { \
 
3717
                        QGetRenderContext()->pCurrentObject()->AddCacheCommand( \
 
3718
                                        new RiHyperboloidCache(point1, point2, thetamax, count, tokens, values) ); \
 
3719
                return; \
 
3720
        }
 
3721
        #define Cache_RiParaboloid\
 
3722
        if( QGetRenderContext()->pCurrentObject()) \
 
3723
        { \
 
3724
                        QGetRenderContext()->pCurrentObject()->AddCacheCommand( \
 
3725
                                        new RiParaboloidCache(rmax, zmin, zmax, thetamax, count, tokens, values) ); \
 
3726
                return; \
 
3727
        }
 
3728
        #define Cache_RiDisk\
 
3729
        if( QGetRenderContext()->pCurrentObject()) \
 
3730
        { \
 
3731
                        QGetRenderContext()->pCurrentObject()->AddCacheCommand( \
 
3732
                                        new RiDiskCache(height, radius, thetamax, count, tokens, values) ); \
 
3733
                return; \
 
3734
        }
 
3735
        #define Cache_RiTorus\
 
3736
        if( QGetRenderContext()->pCurrentObject()) \
 
3737
        { \
 
3738
                        QGetRenderContext()->pCurrentObject()->AddCacheCommand( \
 
3739
                                        new RiTorusCache(majorrad, minorrad, phimin, phimax, thetamax, count, tokens, values) ); \
 
3740
                return; \
 
3741
        }
 
3742
        #define Cache_RiProcedural\
 
3743
        if( QGetRenderContext()->pCurrentObject()) \
 
3744
        { \
 
3745
                        QGetRenderContext()->pCurrentObject()->AddCacheCommand( \
 
3746
                                        new RiProceduralCache(data, bound, refineproc, freeproc) ); \
 
3747
                return; \
 
3748
        }
 
3749
        #define Cache_RiGeometry\
 
3750
        if( QGetRenderContext()->pCurrentObject()) \
 
3751
        { \
 
3752
                        QGetRenderContext()->pCurrentObject()->AddCacheCommand( \
 
3753
                                        new RiGeometryCache(type, count, tokens, values) ); \
 
3754
                return; \
 
3755
        }
 
3756
        #define Cache_RiSolidBegin\
 
3757
        if( QGetRenderContext()->pCurrentObject()) \
 
3758
        { \
 
3759
                        QGetRenderContext()->pCurrentObject()->AddCacheCommand( \
 
3760
                                        new RiSolidBeginCache(type) ); \
 
3761
                return; \
 
3762
        }
 
3763
        #define Cache_RiSolidEnd\
 
3764
        if( QGetRenderContext()->pCurrentObject()) \
 
3765
        { \
 
3766
                        QGetRenderContext()->pCurrentObject()->AddCacheCommand( \
 
3767
                                        new RiSolidEndCache() ); \
 
3768
                return; \
 
3769
        }
 
3770
        #define Cache_RiObjectBegin\
 
3771
        if( QGetRenderContext()->pCurrentObject()) \
 
3772
        { \
 
3773
                        QGetRenderContext()->pCurrentObject()->AddCacheCommand( \
 
3774
                                        new RiObjectBeginCache() ); \
 
3775
                return(0);      \
 
3776
        }
 
3777
        #define Cache_RiObjectEnd\
 
3778
        if( QGetRenderContext()->pCurrentObject()) \
 
3779
        { \
 
3780
                        QGetRenderContext()->pCurrentObject()->AddCacheCommand( \
 
3781
                                        new RiObjectEndCache() ); \
 
3782
                return; \
 
3783
        }
 
3784
        #define Cache_RiObjectInstance\
 
3785
        if( QGetRenderContext()->pCurrentObject()) \
 
3786
        { \
 
3787
                        QGetRenderContext()->pCurrentObject()->AddCacheCommand( \
 
3788
                                        new RiObjectInstanceCache(handle) ); \
 
3789
                return; \
 
3790
        }
 
3791
        #define Cache_RiMotionBeginV\
 
3792
        if( QGetRenderContext()->pCurrentObject()) \
 
3793
        { \
 
3794
                        QGetRenderContext()->pCurrentObject()->AddCacheCommand( \
 
3795
                                        new RiMotionBeginVCache(N, times) ); \
 
3796
                return; \
 
3797
        }
 
3798
        #define Cache_RiMotionEnd\
 
3799
        if( QGetRenderContext()->pCurrentObject()) \
 
3800
        { \
 
3801
                        QGetRenderContext()->pCurrentObject()->AddCacheCommand( \
 
3802
                                        new RiMotionEndCache() ); \
 
3803
                return; \
 
3804
        }
 
3805
        #define Cache_RiMakeTexture\
 
3806
        if( QGetRenderContext()->pCurrentObject()) \
 
3807
        { \
 
3808
                        QGetRenderContext()->pCurrentObject()->AddCacheCommand( \
 
3809
                                        new RiMakeTextureCache(imagefile, texturefile, swrap, twrap, filterfunc, swidth, twidth, count, tokens, values) ); \
 
3810
                return; \
 
3811
        }
 
3812
        #define Cache_RiMakeBump\
 
3813
        if( QGetRenderContext()->pCurrentObject()) \
 
3814
        { \
 
3815
                        QGetRenderContext()->pCurrentObject()->AddCacheCommand( \
 
3816
                                        new RiMakeBumpCache(imagefile, bumpfile, swrap, twrap, filterfunc, swidth, twidth, count, tokens, values) ); \
 
3817
                return; \
 
3818
        }
 
3819
        #define Cache_RiMakeLatLongEnvironment\
 
3820
        if( QGetRenderContext()->pCurrentObject()) \
 
3821
        { \
 
3822
                        QGetRenderContext()->pCurrentObject()->AddCacheCommand( \
 
3823
                                        new RiMakeLatLongEnvironmentCache(imagefile, reflfile, filterfunc, swidth, twidth, count, tokens, values) ); \
 
3824
                return; \
 
3825
        }
 
3826
        #define Cache_RiMakeCubeFaceEnvironment\
 
3827
        if( QGetRenderContext()->pCurrentObject()) \
 
3828
        { \
 
3829
                        QGetRenderContext()->pCurrentObject()->AddCacheCommand( \
 
3830
                                        new RiMakeCubeFaceEnvironmentCache(px, nx, py, ny, pz, nz, reflfile, fov, filterfunc, swidth, twidth, count, tokens, values) ); \
 
3831
                return; \
 
3832
        }
 
3833
        #define Cache_RiMakeShadow\
 
3834
        if( QGetRenderContext()->pCurrentObject()) \
 
3835
        { \
 
3836
                        QGetRenderContext()->pCurrentObject()->AddCacheCommand( \
 
3837
                                        new RiMakeShadowCache(picfile, shadowfile, count, tokens, values) ); \
 
3838
                return; \
 
3839
        }
 
3840
        #define Cache_RiMakeOcclusion\
 
3841
        if( QGetRenderContext()->pCurrentObject()) \
 
3842
        { \
 
3843
                        QGetRenderContext()->pCurrentObject()->AddCacheCommand( \
 
3844
                                        new RiMakeOcclusionCache(npics, picfiles, shadowfile, count, tokens, values) ); \
 
3845
                return; \
 
3846
        }
 
3847
        #define Cache_RiErrorHandler\
 
3848
        if( QGetRenderContext()->pCurrentObject()) \
 
3849
        { \
 
3850
                        QGetRenderContext()->pCurrentObject()->AddCacheCommand( \
 
3851
                                        new RiErrorHandlerCache(handler) ); \
 
3852
                return; \
 
3853
        }
 
3854
        #define Cache_RiClippingPlane\
 
3855
        if( QGetRenderContext()->pCurrentObject()) \
 
3856
        { \
 
3857
                        QGetRenderContext()->pCurrentObject()->AddCacheCommand( \
 
3858
                                        new RiClippingPlaneCache(x, y, z, nx, ny, nz) ); \
 
3859
                return; \
 
3860
        }
 
3861
        #define Cache_RiCoordSysTransform\
 
3862
        if( QGetRenderContext()->pCurrentObject()) \
 
3863
        { \
 
3864
                        QGetRenderContext()->pCurrentObject()->AddCacheCommand( \
 
3865
                                        new RiCoordSysTransformCache(space) ); \
 
3866
                return; \
 
3867
        }
 
3868
        #define Cache_RiBlobby\
 
3869
        if( QGetRenderContext()->pCurrentObject()) \
 
3870
        { \
 
3871
                        QGetRenderContext()->pCurrentObject()->AddCacheCommand( \
 
3872
                                        new RiBlobbyCache(nleaf, ncode, code, nflt, flt, nstr, str, count, tokens, values) ); \
 
3873
                return; \
 
3874
        }
 
3875
        #define Cache_RiPoints\
 
3876
        if( QGetRenderContext()->pCurrentObject()) \
 
3877
        { \
 
3878
                        QGetRenderContext()->pCurrentObject()->AddCacheCommand( \
 
3879
                                        new RiPointsCache(npoints, count, tokens, values) ); \
 
3880
                return; \
 
3881
        }
 
3882
        #define Cache_RiCurves\
 
3883
        if( QGetRenderContext()->pCurrentObject()) \
 
3884
        { \
 
3885
                        QGetRenderContext()->pCurrentObject()->AddCacheCommand( \
 
3886
                                        new RiCurvesCache(type, ncurves, nvertices, wrap, count, tokens, values) ); \
 
3887
                return; \
 
3888
        }
 
3889
        #define Cache_RiSubdivisionMesh\
 
3890
        if( QGetRenderContext()->pCurrentObject()) \
 
3891
        { \
 
3892
                        QGetRenderContext()->pCurrentObject()->AddCacheCommand( \
 
3893
                                        new RiSubdivisionMeshCache(scheme, nfaces, nvertices, vertices, ntags, tags, nargs, intargs, floatargs, count, tokens, values) ); \
 
3894
                return; \
 
3895
        }
 
3896
        #define Cache_RiReadArchive\
 
3897
        if( QGetRenderContext()->pCurrentObject()) \
 
3898
        { \
 
3899
                        QGetRenderContext()->pCurrentObject()->AddCacheCommand( \
 
3900
                                        new RiReadArchiveCache(name, callback, count, tokens, values) ); \
 
3901
                return; \
 
3902
        }
 
3903
        
 
 
b'\\ No newline at end of file'