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

« back to all changes in this revision

Viewing changes to libri2rib/ri.cpp

  • 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
// This library is free software; you can redistribute it and/or
 
2
// modify it under the terms of the GNU Lesser General Public
 
3
// License as published by the Free Software Foundation; either
 
4
// version 2.1 of the License, or (at your option) any later version.
 
5
//
 
6
// This library is distributed in the hope that it will be useful,
 
7
// but WITHOUT ANY WARRANTY; without even the implied warranty of
 
8
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
9
// General Public License for more details.
 
10
//
 
11
// You should have received a copy of the GNU General Public
 
12
// License along with this library; if not, write to the Free Software
 
13
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
14
 
 
15
#include <stdarg.h>
 
16
#include <string>
 
17
#include <stdio.h>
 
18
#include "aqsis.h"
 
19
#include "ri.h"
 
20
#include "error.h"
 
21
#include "plstore.h"
 
22
#include "context.h"
 
23
 
 
24
 
 
25
START_NAMESPACE( libri2rib )
 
26
static CqContext context;
 
27
END_NAMESPACE( libri2rib )
 
28
 
 
29
using libri2rib::context;
 
30
using libri2rib::CqPLStore;
 
31
using libri2rib::CqError;
 
32
 
 
33
 
 
34
RtFloat RiGaussianFilter ( RtFloat x, RtFloat y, RtFloat xwidth, RtFloat ywidth )
 
35
{
 
36
    return 1.0;
 
37
}
 
38
RtFloat RiBoxFilter ( RtFloat x, RtFloat y, RtFloat xwidth, RtFloat ywidth )
 
39
{
 
40
    return 1.0;
 
41
}
 
42
RtFloat RiTriangleFilter ( RtFloat x, RtFloat y, RtFloat xwidth, RtFloat ywidth )
 
43
{
 
44
    return 1.0;
 
45
}
 
46
RtFloat RiCatmullRomFilter ( RtFloat x, RtFloat y, RtFloat xwidth, RtFloat ywidth )
 
47
{
 
48
    return 1.0;
 
49
}
 
50
RtFloat RiSincFilter ( RtFloat x, RtFloat y, RtFloat xwidth, RtFloat ywidth )
 
51
{
 
52
    return 1.0;
 
53
}
 
54
RtFloat RiDiskFilter ( RtFloat x, RtFloat y, RtFloat xwidth, RtFloat ywidth )
 
55
{
 
56
    return 1.0;
 
57
}
 
58
RtFloat RiBesselFilter ( RtFloat x, RtFloat y, RtFloat xwidth, RtFloat ywidth )
 
59
{
 
60
    return 1.0;
 
61
}
 
62
 
 
63
 
 
64
RtBasis RiBezierBasis = { { -1, 3, -3, 1},
 
65
                          { 3, -6, 3, 0},
 
66
                          { -3, 3, 0, 0},
 
67
                          { 1, 0, 0, 0} };
 
68
 
 
69
RtBasis RiBSplineBasis = { { -1.0 / 6, 3.0 / 6, -3.0 / 6, 1.0 / 6},
 
70
                           { 3.0 / 6, -6.0 / 6, 3.0 / 6, 0.0 / 6},
 
71
                           { -3.0 / 6, 0.0 / 6, 3.0 / 6, 0.0 / 6},
 
72
                           { 1.0 / 6, 4.0 / 6, 1.0 / 6, 0.0 / 6} };
 
73
 
 
74
RtBasis RiCatmullRomBasis = { { -1.0 / 2, 3.0 / 2, -3.0 / 2, 1.0 / 2},
 
75
                              { 2.0 / 2, -5.0 / 2, 4.0 / 2, -1.0 / 2},
 
76
                              { -1.0 / 2, 0.0 / 2, 1.0 / 2, 0.0 / 2},
 
77
                              { 0.0 / 2, 2.0 / 2, 0.0 / 2, 0.0 / 2} };
 
78
 
 
79
RtBasis RiHermiteBasis = { { 2, 1, -2, 1},
 
80
                           { -3, -2, 3, -1},
 
81
                           { 0, 1, 0, 0},
 
82
                           { 1, 0, 0, 0} };
 
83
 
 
84
RtBasis RiPowerBasis = { {1, 0, 0, 0},
 
85
                         {0, 1, 0, 0},
 
86
                         {0, 0, 1, 0},
 
87
                         {0, 0, 0, 1} };
 
88
 
 
89
 
 
90
RtVoid RiProcDelayedReadArchive ( RtPointer data, RtFloat detail )
 
91
{}
 
92
RtVoid RiProcRunProgram ( RtPointer data, RtFloat detail )
 
93
{}
 
94
RtVoid RiProcDynamicLoad ( RtPointer data, RtFloat detail )
 
95
{}
 
96
 
 
97
 
 
98
 
 
99
 
 
100
RtContextHandle RiGetContext ( void )
 
101
{
 
102
    try
 
103
    {
 
104
        return context.getContext();
 
105
    }
 
106
    catch ( CqError & r )
 
107
    {
 
108
        r.manage();
 
109
        return RI_NULL;
 
110
    }
 
111
}
 
112
 
 
113
RtVoid RiContext ( RtContextHandle ch )
 
114
{
 
115
    try
 
116
    {
 
117
        context.switchTo( ch );
 
118
    }
 
119
    catch ( CqError & r )
 
120
    {
 
121
        r.manage();
 
122
    }
 
123
}
 
124
 
 
125
RtToken RiDeclare ( const char *name, const char *declaration )
 
126
{
 
127
    try
 
128
    {
 
129
        return context.current().RiDeclare( name, declaration );
 
130
    }
 
131
    catch ( CqError & r )
 
132
    {
 
133
        r.manage();
 
134
        return RI_NULL;
 
135
    }
 
136
}
 
137
 
 
138
RtVoid RiBegin ( RtToken name )
 
139
{
 
140
    try
 
141
    {
 
142
        context.addContext( name );
 
143
        context.current().RiBegin( name );
 
144
    }
 
145
    catch ( CqError & r )
 
146
    {
 
147
        r.manage();
 
148
    }
 
149
}
 
150
 
 
151
RtVoid RiEnd ( void )
 
152
{
 
153
    try
 
154
    {
 
155
        context.current().RiEnd();
 
156
        context.removeCurrent();
 
157
    }
 
158
    catch ( CqError & r )
 
159
    {
 
160
        r.manage();
 
161
    }
 
162
}
 
163
 
 
164
RtVoid RiFrameBegin ( RtInt frame )
 
165
{
 
166
    try
 
167
    {
 
168
        context.current().RiFrameBegin( frame );
 
169
    }
 
170
    catch ( CqError & r )
 
171
    {
 
172
        r.manage();
 
173
    }
 
174
}
 
175
 
 
176
RtVoid RiFrameEnd ( void )
 
177
{
 
178
    try
 
179
    {
 
180
        context.current().RiFrameEnd();
 
181
    }
 
182
    catch ( CqError & r )
 
183
    {
 
184
        r.manage();
 
185
    }
 
186
}
 
187
 
 
188
RtVoid RiWorldBegin ( void )
 
189
{
 
190
    try
 
191
    {
 
192
        context.current().RiWorldBegin();
 
193
    }
 
194
    catch ( CqError & r )
 
195
    {
 
196
        r.manage();
 
197
    }
 
198
}
 
199
 
 
200
RtVoid RiWorldEnd ( void )
 
201
{
 
202
    try
 
203
    {
 
204
        context.current().RiWorldEnd();
 
205
    }
 
206
    catch ( CqError & r )
 
207
    {
 
208
        r.manage();
 
209
    }
 
210
}
 
211
 
 
212
RtVoid RiFormat ( RtInt xres, RtInt yres, RtFloat aspect )
 
213
{
 
214
    try
 
215
    {
 
216
        context.current().RiFormat( xres, yres, aspect );
 
217
    }
 
218
    catch ( CqError & r )
 
219
    {
 
220
        r.manage();
 
221
    }
 
222
}
 
223
 
 
224
RtVoid RiFrameAspectRatio ( RtFloat aspect )
 
225
{
 
226
    try
 
227
    {
 
228
        context.current().RiFrameAspectRatio( aspect );
 
229
    }
 
230
    catch ( CqError & r )
 
231
    {
 
232
        r.manage();
 
233
    }
 
234
}
 
235
 
 
236
RtVoid RiScreenWindow ( RtFloat left, RtFloat right, RtFloat bot, RtFloat top )
 
237
{
 
238
    try
 
239
    {
 
240
        context.current().RiScreenWindow( left, right, bot, top );
 
241
    }
 
242
    catch ( CqError & r )
 
243
    {
 
244
        r.manage();
 
245
    }
 
246
}
 
247
 
 
248
RtVoid RiCropWindow ( RtFloat xmin, RtFloat xmax, RtFloat ymin, RtFloat ymax )
 
249
{
 
250
    try
 
251
    {
 
252
        context.current().RiCropWindow( xmin, xmax, ymin, ymax );
 
253
    }
 
254
    catch ( CqError & r )
 
255
    {
 
256
        r.manage();
 
257
    }
 
258
}
 
259
 
 
260
RtVoid RiProjection ( const char *name, ... )
 
261
{
 
262
    try
 
263
    {
 
264
        va_list args;
 
265
        va_start( args, name );
 
266
        CqPLStore pls( args );
 
267
        va_end( args );
 
268
 
 
269
        RiProjectionV( name, pls.n, pls.tokens(), pls.parms() );
 
270
    }
 
271
    catch ( CqError & r )
 
272
    {
 
273
        r.manage();
 
274
    }
 
275
}
 
276
 
 
277
RtVoid RiProjectionV ( const char *name, RtInt n, RtToken tokens[], RtPointer parms[] )
 
278
{
 
279
    try
 
280
    {
 
281
        context.current().RiProjectionV( name, n, tokens, parms );
 
282
    }
 
283
    catch ( CqError & r )
 
284
    {
 
285
        r.manage();
 
286
    }
 
287
}
 
288
 
 
289
RtVoid RiClipping ( RtFloat hither, RtFloat yon )
 
290
{
 
291
    try
 
292
    {
 
293
        context.current().RiClipping( hither, yon );
 
294
    }
 
295
    catch ( CqError & r )
 
296
    {
 
297
        r.manage();
 
298
    }
 
299
}
 
300
 
 
301
RtVoid RiClippingPlane ( RtFloat x, RtFloat y, RtFloat z,
 
302
                         RtFloat nx, RtFloat ny, RtFloat nz )
 
303
{
 
304
    try
 
305
    {
 
306
        context.current().RiClippingPlane( x, y, z, nx, ny, nz );
 
307
    }
 
308
    catch ( CqError & r )
 
309
    {
 
310
        r.manage();
 
311
    }
 
312
}
 
313
 
 
314
RtVoid RiDepthOfField ( RtFloat fstop, RtFloat focallength, RtFloat focaldistance )
 
315
{
 
316
    try
 
317
    {
 
318
        context.current().RiDepthOfField ( fstop, focallength, focaldistance );
 
319
    }
 
320
    catch ( CqError & r )
 
321
    {
 
322
        r.manage();
 
323
    }
 
324
}
 
325
 
 
326
RtVoid RiShutter ( RtFloat min, RtFloat max )
 
327
{
 
328
    try
 
329
    {
 
330
        context.current().RiShutter( min, max );
 
331
    }
 
332
    catch ( CqError & r )
 
333
    {
 
334
        r.manage();
 
335
    }
 
336
}
 
337
 
 
338
RtVoid RiPixelVariance ( RtFloat variation )
 
339
{
 
340
    try
 
341
    {
 
342
        context.current().RiPixelVariance( variation );
 
343
    }
 
344
    catch ( CqError & r )
 
345
    {
 
346
        r.manage();
 
347
    }
 
348
}
 
349
 
 
350
RtVoid RiPixelSamples ( RtFloat xsamples, RtFloat ysamples )
 
351
{
 
352
    try
 
353
    {
 
354
        context.current().RiPixelSamples( xsamples, ysamples );
 
355
    }
 
356
    catch ( CqError & r )
 
357
    {
 
358
        r.manage();
 
359
    }
 
360
}
 
361
 
 
362
RtVoid RiPixelFilter ( RtFilterFunc filterfunc, RtFloat xwidth, RtFloat ywidth )
 
363
{
 
364
    try
 
365
    {
 
366
        context.current().RiPixelFilter( filterfunc, xwidth, ywidth );
 
367
    }
 
368
    catch ( CqError & r )
 
369
    {
 
370
        r.manage();
 
371
    }
 
372
}
 
373
 
 
374
RtVoid RiExposure ( RtFloat gain, RtFloat gamma )
 
375
{
 
376
    try
 
377
    {
 
378
        context.current().RiExposure( gain, gamma );
 
379
    }
 
380
    catch ( CqError & r )
 
381
    {
 
382
        r.manage();
 
383
    }
 
384
}
 
385
 
 
386
RtVoid RiImager ( const char *name, ... )
 
387
{
 
388
    try
 
389
    {
 
390
        va_list args;
 
391
        va_start( args, name );
 
392
        CqPLStore pls( args );
 
393
        va_end( args );
 
394
 
 
395
        RiImagerV( name, pls.n, pls.tokens(), pls.parms() );
 
396
    }
 
397
    catch ( CqError & r )
 
398
    {
 
399
        r.manage();
 
400
    }
 
401
}
 
402
 
 
403
RtVoid RiImagerV ( const char *name, RtInt n, RtToken tokens[], RtPointer parms[] )
 
404
{
 
405
    try
 
406
    {
 
407
        context.current().RiImagerV( name, n, tokens, parms );
 
408
    }
 
409
    catch ( CqError & r )
 
410
    {
 
411
        r.manage();
 
412
    }
 
413
}
 
414
 
 
415
RtVoid RiQuantize ( RtToken type, RtInt one, RtInt min, RtInt max, RtFloat ampl )
 
416
{
 
417
    try
 
418
    {
 
419
        context.current().RiQuantize( type, one, min, max, ampl );
 
420
    }
 
421
    catch ( CqError & r )
 
422
    {
 
423
        r.manage();
 
424
    }
 
425
}
 
426
 
 
427
RtVoid RiDisplay ( const char *name, RtToken type, RtToken mode, ... )
 
428
{
 
429
    try
 
430
    {
 
431
        va_list args;
 
432
        va_start( args, mode );
 
433
        CqPLStore pls( args );
 
434
        va_end( args );
 
435
 
 
436
        RiDisplayV( name, type, mode, pls.n, pls.tokens(), pls.parms() );
 
437
    }
 
438
    catch ( CqError & r )
 
439
    {
 
440
        r.manage();
 
441
    }
 
442
}
 
443
 
 
444
RtVoid RiDisplayV ( const char *name, RtToken type, RtToken mode,
 
445
                    RtInt n, RtToken tokens[], RtPointer parms[] )
 
446
{
 
447
    try
 
448
    {
 
449
        context.current().RiDisplayV( name, type, mode, n, tokens, parms );
 
450
    }
 
451
    catch ( CqError & r )
 
452
    {
 
453
        r.manage();
 
454
    }
 
455
}
 
456
 
 
457
RtVoid RiHider ( const char *type, ... )
 
458
{
 
459
    try
 
460
    {
 
461
        va_list args;
 
462
        va_start( args, type );
 
463
        CqPLStore pls( args );
 
464
        va_end( args );
 
465
 
 
466
        RiHiderV( type, pls.n, pls.tokens(), pls.parms() );
 
467
    }
 
468
    catch ( CqError & r )
 
469
    {
 
470
        r.manage();
 
471
    }
 
472
}
 
473
 
 
474
RtVoid RiHiderV ( const char *type, RtInt n, RtToken tokens[], RtPointer parms[] )
 
475
{
 
476
    try
 
477
    {
 
478
        context.current().RiHiderV( type, n, tokens, parms );
 
479
    }
 
480
    catch ( CqError & r )
 
481
    {
 
482
        r.manage();
 
483
    }
 
484
}
 
485
 
 
486
RtVoid RiColorSamples ( RtInt n, RtFloat nRGB[], RtFloat RGBn[] )
 
487
{
 
488
    try
 
489
    {
 
490
        context.current().RiColorSamples( n, nRGB, RGBn );
 
491
    }
 
492
    catch ( CqError & r )
 
493
    {
 
494
        r.manage();
 
495
    }
 
496
}
 
497
 
 
498
RtVoid RiRelativeDetail ( RtFloat relativedetail )
 
499
{
 
500
    try
 
501
    {
 
502
        context.current().RiRelativeDetail( relativedetail );
 
503
    }
 
504
    catch ( CqError & r )
 
505
    {
 
506
        r.manage();
 
507
    }
 
508
}
 
509
 
 
510
RtVoid RiOption ( const char *name, ... )
 
511
{
 
512
    try
 
513
    {
 
514
        va_list args;
 
515
        va_start( args, name );
 
516
        CqPLStore pls( args );
 
517
        va_end( args );
 
518
 
 
519
        RiOptionV( name, pls.n, pls.tokens(), pls.parms() );
 
520
    }
 
521
    catch ( CqError & r )
 
522
    {
 
523
        r.manage();
 
524
    }
 
525
}
 
526
 
 
527
RtVoid RiOptionV ( const char *name, RtInt n, RtToken tokens[], RtPointer parms[] )
 
528
{
 
529
    try
 
530
    {
 
531
        if ( context.getContext() == ( RtContextHandle ) RI_NULL )
 
532
        {
 
533
            context.parseOption( name, n, tokens, parms );
 
534
        }
 
535
        else
 
536
        {
 
537
            context.current().RiOptionV( name, n, tokens, parms );
 
538
        }
 
539
    }
 
540
    catch ( CqError & r )
 
541
    {
 
542
        r.manage();
 
543
    }
 
544
}
 
545
 
 
546
RtVoid RiAttributeBegin ( void )
 
547
{
 
548
    try
 
549
    {
 
550
        context.current().RiAttributeBegin();
 
551
    }
 
552
    catch ( CqError & r )
 
553
    {
 
554
        r.manage();
 
555
    }
 
556
}
 
557
 
 
558
RtVoid RiAttributeEnd ( void )
 
559
{
 
560
    try
 
561
    {
 
562
        context.current().RiAttributeEnd();
 
563
    }
 
564
    catch ( CqError & r )
 
565
    {
 
566
        r.manage();
 
567
    }
 
568
}
 
569
 
 
570
RtVoid RiColor ( RtColor color )
 
571
{
 
572
    try
 
573
    {
 
574
        context.current().RiColor( color );
 
575
    }
 
576
    catch ( CqError & r )
 
577
    {
 
578
        r.manage();
 
579
    }
 
580
}
 
581
 
 
582
RtVoid RiOpacity ( RtColor color )
 
583
{
 
584
    try
 
585
    {
 
586
        context.current().RiOpacity( color );
 
587
    }
 
588
    catch ( CqError & r )
 
589
    {
 
590
        r.manage();
 
591
    }
 
592
}
 
593
 
 
594
RtVoid RiTextureCoordinates( RtFloat s1, RtFloat t1, RtFloat s2, RtFloat t2,
 
595
                             RtFloat s3, RtFloat t3, RtFloat s4, RtFloat t4 )
 
596
{
 
597
    try
 
598
    {
 
599
        context.current().RiTextureCoordinates( s1, t1, s2, t2, s3, t3, s4, t4 );
 
600
    }
 
601
    catch ( CqError & r )
 
602
    {
 
603
        r.manage();
 
604
    }
 
605
}
 
606
 
 
607
RtLightHandle RiLightSource ( const char *name, ... )
 
608
{
 
609
    try
 
610
    {
 
611
        va_list args;
 
612
        va_start( args, name );
 
613
        CqPLStore pls( args );
 
614
        va_end( args );
 
615
 
 
616
        return RiLightSourceV( name, pls.n, pls.tokens(), pls.parms() );
 
617
    }
 
618
    catch ( CqError & r )
 
619
    {
 
620
        r.manage();
 
621
        return RI_NULL;
 
622
    }
 
623
}
 
624
 
 
625
RtLightHandle RiLightSourceV ( const char *name, RtInt n, RtToken tokens[], RtPointer parms[] )
 
626
{
 
627
    try
 
628
    {
 
629
        return context.current().RiLightSourceV( name, n, tokens, parms );
 
630
    }
 
631
    catch ( CqError & r )
 
632
    {
 
633
        r.manage();
 
634
        return RI_NULL;
 
635
    }
 
636
}
 
637
 
 
638
RtLightHandle RiAreaLightSource ( const char *name, ... )
 
639
{
 
640
    try
 
641
    {
 
642
        va_list args;
 
643
        va_start( args, name );
 
644
        CqPLStore pls( args );
 
645
        va_end( args );
 
646
 
 
647
        return RiAreaLightSourceV( name, pls.n, pls.tokens(), pls.parms() );
 
648
    }
 
649
    catch ( CqError & r )
 
650
    {
 
651
        r.manage();
 
652
        return RI_NULL;
 
653
    }
 
654
}
 
655
 
 
656
RtLightHandle RiAreaLightSourceV ( const char *name,
 
657
                                   RtInt n, RtToken tokens[], RtPointer parms[] )
 
658
{
 
659
    try
 
660
    {
 
661
        return context.current().RiAreaLightSourceV( name, n, tokens, parms );
 
662
    }
 
663
    catch ( CqError & r )
 
664
    {
 
665
        r.manage();
 
666
        return RI_NULL;
 
667
    }
 
668
}
 
669
 
 
670
RtVoid RiIlluminate ( RtLightHandle light, RtBoolean onoff )
 
671
{
 
672
    try
 
673
    {
 
674
        context.current().RiIlluminate( light, onoff );
 
675
    }
 
676
    catch ( CqError & r )
 
677
    {
 
678
        r.manage();
 
679
    }
 
680
}
 
681
 
 
682
RtVoid RiSurface ( const char *name, ... )
 
683
{
 
684
    try
 
685
    {
 
686
        va_list args;
 
687
        va_start( args, name );
 
688
        CqPLStore pls( args );
 
689
        va_end( args );
 
690
 
 
691
        RiSurfaceV( name, pls.n, pls.tokens(), pls.parms() );
 
692
    }
 
693
    catch ( CqError & r )
 
694
    {
 
695
        r.manage();
 
696
    }
 
697
}
 
698
 
 
699
RtVoid RiSurfaceV ( const char *name, RtInt n, RtToken tokens[], RtPointer parms[] )
 
700
{
 
701
    try
 
702
    {
 
703
        context.current().RiSurfaceV( name, n, tokens, parms );
 
704
    }
 
705
    catch ( CqError & r )
 
706
    {
 
707
        r.manage();
 
708
    }
 
709
}
 
710
 
 
711
RtVoid RiAtmosphere ( const char *name, ... )
 
712
{
 
713
    try
 
714
    {
 
715
        va_list args;
 
716
        va_start( args, name );
 
717
        CqPLStore pls( args );
 
718
        va_end( args );
 
719
 
 
720
        RiAtmosphereV( name, pls.n, pls.tokens(), pls.parms() );
 
721
    }
 
722
    catch ( CqError & r )
 
723
    {
 
724
        r.manage();
 
725
    }
 
726
}
 
727
 
 
728
RtVoid RiAtmosphereV ( const char *name, RtInt n, RtToken tokens[], RtPointer parms[] )
 
729
{
 
730
    try
 
731
    {
 
732
        context.current().RiAtmosphereV( name, n, tokens, parms );
 
733
    }
 
734
    catch ( CqError & r )
 
735
    {
 
736
        r.manage();
 
737
    }
 
738
}
 
739
 
 
740
RtVoid RiInterior ( const char *name, ... )
 
741
{
 
742
    try
 
743
    {
 
744
        va_list args;
 
745
        va_start( args, name );
 
746
        CqPLStore pls( args );
 
747
        va_end( args );
 
748
 
 
749
        RiInteriorV( name, pls.n, pls.tokens(), pls.parms() );
 
750
    }
 
751
    catch ( CqError & r )
 
752
    {
 
753
        r.manage();
 
754
    }
 
755
}
 
756
 
 
757
RtVoid RiInteriorV ( const char *name, RtInt n, RtToken tokens[], RtPointer parms[] )
 
758
{
 
759
    try
 
760
    {
 
761
        context.current().RiInteriorV( name, n, tokens, parms );
 
762
    }
 
763
    catch ( CqError & r )
 
764
    {
 
765
        r.manage();
 
766
    }
 
767
}
 
768
 
 
769
RtVoid RiExterior ( const char *name, ... )
 
770
{
 
771
    try
 
772
    {
 
773
        va_list args;
 
774
        va_start( args, name );
 
775
        CqPLStore pls( args );
 
776
        va_end( args );
 
777
 
 
778
        RiExteriorV( name, pls.n, pls.tokens(), pls.parms() );
 
779
    }
 
780
    catch ( CqError & r )
 
781
    {
 
782
        r.manage();
 
783
    }
 
784
}
 
785
 
 
786
RtVoid RiExteriorV ( const char *name, RtInt n, RtToken tokens[], RtPointer parms[] )
 
787
{
 
788
    try
 
789
    {
 
790
        context.current().RiExteriorV( name, n, tokens, parms );
 
791
    }
 
792
    catch ( CqError & r )
 
793
    {
 
794
        r.manage();
 
795
    }
 
796
}
 
797
 
 
798
RtVoid RiShadingRate ( RtFloat size )
 
799
{
 
800
    try
 
801
    {
 
802
        context.current().RiShadingRate( size );
 
803
    }
 
804
    catch ( CqError & r )
 
805
    {
 
806
        r.manage();
 
807
    }
 
808
}
 
809
 
 
810
RtVoid RiShadingInterpolation ( RtToken type )
 
811
{
 
812
    try
 
813
    {
 
814
        context.current().RiShadingInterpolation( type );
 
815
    }
 
816
    catch ( CqError & r )
 
817
    {
 
818
        r.manage();
 
819
    }
 
820
}
 
821
 
 
822
RtVoid RiMatte ( RtBoolean onoff )
 
823
{
 
824
    try
 
825
    {
 
826
        context.current().RiMatte( onoff );
 
827
    }
 
828
    catch ( CqError & r )
 
829
    {
 
830
        r.manage();
 
831
    }
 
832
}
 
833
 
 
834
RtVoid RiBound ( RtBound bound )
 
835
{
 
836
    try
 
837
    {
 
838
        context.current().RiBound( bound );
 
839
    }
 
840
    catch ( CqError & r )
 
841
    {
 
842
        r.manage();
 
843
    }
 
844
}
 
845
 
 
846
RtVoid RiDetail ( RtBound bound )
 
847
{
 
848
    try
 
849
    {
 
850
        context.current().RiDetail( bound );
 
851
    }
 
852
    catch ( CqError & r )
 
853
    {
 
854
        r.manage();
 
855
    }
 
856
}
 
857
 
 
858
RtVoid RiDetailRange ( RtFloat minvis, RtFloat lowtran, RtFloat uptran, RtFloat maxvis )
 
859
{
 
860
    try
 
861
    {
 
862
        context.current().RiDetailRange( minvis, lowtran, uptran, maxvis );
 
863
    }
 
864
    catch ( CqError & r )
 
865
    {
 
866
        r.manage();
 
867
    }
 
868
}
 
869
 
 
870
RtVoid RiGeometricApproximation ( RtToken type, RtFloat value )
 
871
{
 
872
    try
 
873
    {
 
874
        context.current().RiGeometricApproximation( type, value );
 
875
    }
 
876
    catch ( CqError & r )
 
877
    {
 
878
        r.manage();
 
879
    }
 
880
}
 
881
 
 
882
RtVoid RiOrientation ( RtToken orientation )
 
883
{
 
884
    try
 
885
    {
 
886
        context.current().RiOrientation( orientation );
 
887
    }
 
888
    catch ( CqError & r )
 
889
    {
 
890
        r.manage();
 
891
    }
 
892
}
 
893
 
 
894
RtVoid RiReverseOrientation ( void )
 
895
{
 
896
    try
 
897
    {
 
898
        context.current().RiReverseOrientation();
 
899
    }
 
900
    catch ( CqError & r )
 
901
    {
 
902
        r.manage();
 
903
    }
 
904
}
 
905
 
 
906
RtVoid RiSides ( RtInt sides )
 
907
{
 
908
    try
 
909
    {
 
910
        context.current().RiSides( sides );
 
911
    }
 
912
    catch ( CqError & r )
 
913
    {
 
914
        r.manage();
 
915
    }
 
916
}
 
917
 
 
918
RtVoid RiIdentity ( void )
 
919
{
 
920
    try
 
921
    {
 
922
        context.current().RiIdentity();
 
923
    }
 
924
    catch ( CqError & r )
 
925
    {
 
926
        r.manage();
 
927
    }
 
928
}
 
929
 
 
930
RtVoid RiTransform ( RtMatrix transform )
 
931
{
 
932
    try
 
933
    {
 
934
        context.current().RiTransform( transform );
 
935
    }
 
936
    catch ( CqError & r )
 
937
    {
 
938
        r.manage();
 
939
    }
 
940
}
 
941
 
 
942
RtVoid RiConcatTransform ( RtMatrix transform )
 
943
{
 
944
    try
 
945
    {
 
946
        context.current().RiConcatTransform( transform );
 
947
    }
 
948
    catch ( CqError & r )
 
949
    {
 
950
        r.manage();
 
951
    }
 
952
}
 
953
 
 
954
RtVoid RiPerspective ( RtFloat fov )
 
955
{
 
956
    try
 
957
    {
 
958
        context.current().RiPerspective( fov );
 
959
    }
 
960
    catch ( CqError & r )
 
961
    {
 
962
        r.manage();
 
963
    }
 
964
}
 
965
 
 
966
RtVoid RiTranslate ( RtFloat dx, RtFloat dy, RtFloat dz )
 
967
{
 
968
    try
 
969
    {
 
970
        context.current().RiTranslate( dx, dy, dz );
 
971
    }
 
972
    catch ( CqError & r )
 
973
    {
 
974
        r.manage();
 
975
    }
 
976
}
 
977
 
 
978
RtVoid RiRotate ( RtFloat angle, RtFloat dx, RtFloat dy, RtFloat dz )
 
979
{
 
980
    try
 
981
    {
 
982
        context.current().RiRotate( angle, dx, dy, dz );
 
983
    }
 
984
    catch ( CqError & r )
 
985
    {
 
986
        r.manage();
 
987
    }
 
988
}
 
989
 
 
990
RtVoid RiScale ( RtFloat sx, RtFloat sy, RtFloat sz )
 
991
{
 
992
    try
 
993
    {
 
994
        context.current().RiScale( sx, sy, sz );
 
995
    }
 
996
    catch ( CqError & r )
 
997
    {
 
998
        r.manage();
 
999
    }
 
1000
}
 
1001
 
 
1002
RtVoid RiSkew ( RtFloat angle, RtFloat dx1, RtFloat dy1, RtFloat dz1,
 
1003
                RtFloat dx2, RtFloat dy2, RtFloat dz2 )
 
1004
{
 
1005
    try
 
1006
    {
 
1007
        context.current().RiSkew( angle, dx1, dy1, dz1, dx2, dy2, dz2 );
 
1008
    }
 
1009
    catch ( CqError & r )
 
1010
    {
 
1011
        r.manage();
 
1012
    }
 
1013
}
 
1014
 
 
1015
RtVoid RiDeformation ( const char *name, ... )
 
1016
{
 
1017
    try
 
1018
    {
 
1019
        va_list args;
 
1020
        va_start( args, name );
 
1021
        CqPLStore pls( args );
 
1022
        va_end( args );
 
1023
 
 
1024
        RiDeformationV( name, pls.n, pls.tokens(), pls.parms() );
 
1025
    }
 
1026
    catch ( CqError & r )
 
1027
    {
 
1028
        r.manage();
 
1029
    }
 
1030
}
 
1031
 
 
1032
RtVoid RiDeformationV ( const char *name, RtInt n, RtToken tokens[], RtPointer parms[] )
 
1033
{
 
1034
    try
 
1035
    {
 
1036
        context.current().RiDeformationV( name, n, tokens, parms );
 
1037
    }
 
1038
    catch ( CqError & r )
 
1039
    {
 
1040
        r.manage();
 
1041
    }
 
1042
}
 
1043
 
 
1044
RtVoid RiDisplacement ( const char *name, ... )
 
1045
{
 
1046
    try
 
1047
    {
 
1048
        va_list args;
 
1049
        va_start( args, name );
 
1050
        CqPLStore pls( args );
 
1051
        va_end( args );
 
1052
 
 
1053
        RiDisplacementV( name, pls.n, pls.tokens(), pls.parms() );
 
1054
    }
 
1055
    catch ( CqError & r )
 
1056
    {
 
1057
        r.manage();
 
1058
    }
 
1059
}
 
1060
 
 
1061
RtVoid RiDisplacementV ( const char *name, RtInt n, RtToken tokens[], RtPointer parms[] )
 
1062
{
 
1063
    try
 
1064
    {
 
1065
        context.current().RiDisplacementV( name, n, tokens, parms );
 
1066
    }
 
1067
    catch ( CqError & r )
 
1068
    {
 
1069
        r.manage();
 
1070
    }
 
1071
}
 
1072
 
 
1073
RtVoid RiCoordinateSystem ( RtToken space )
 
1074
{
 
1075
    try
 
1076
    {
 
1077
        context.current().RiCoordinateSystem( space );
 
1078
    }
 
1079
    catch ( CqError & r )
 
1080
    {
 
1081
        r.manage();
 
1082
    }
 
1083
}
 
1084
 
 
1085
RtVoid RiCoordSysTransform ( RtToken space )
 
1086
{
 
1087
    try
 
1088
    {
 
1089
        context.current().RiCoordSysTransform( space );
 
1090
    }
 
1091
    catch ( CqError & r )
 
1092
    {
 
1093
        r.manage();
 
1094
    }
 
1095
}
 
1096
 
 
1097
RtPoint * RiTransformPoints ( RtToken fromspace, RtToken tospace,
 
1098
                              RtInt n, RtPoint points[] )
 
1099
{
 
1100
    CqError r( RIE_UNIMPLEMENT, RIE_WARNING,
 
1101
               "RiTransformPoints cannot be written to a RIB file.", TqFalse );
 
1102
    r.manage();
 
1103
    return ( RtPoint * ) RI_NULL;
 
1104
}
 
1105
 
 
1106
RtVoid RiTransformBegin ( void )
 
1107
{
 
1108
    try
 
1109
    {
 
1110
        context.current().RiTransformBegin();
 
1111
    }
 
1112
    catch ( CqError & r )
 
1113
    {
 
1114
        r.manage();
 
1115
    }
 
1116
}
 
1117
 
 
1118
RtVoid RiTransformEnd ( void )
 
1119
{
 
1120
 
 
1121
    try
 
1122
    {
 
1123
        context.current().RiTransformEnd();
 
1124
    }
 
1125
    catch ( CqError & r )
 
1126
    {
 
1127
        r.manage();
 
1128
    }
 
1129
}
 
1130
 
 
1131
RtVoid RiAttribute ( const char *name, ... )
 
1132
{
 
1133
    try
 
1134
    {
 
1135
        va_list args;
 
1136
        va_start( args, name );
 
1137
        CqPLStore pls( args );
 
1138
        va_end( args );
 
1139
 
 
1140
        RiAttributeV( name, pls.n, pls.tokens(), pls.parms() );
 
1141
    }
 
1142
    catch ( CqError & r )
 
1143
    {
 
1144
        r.manage();
 
1145
    }
 
1146
}
 
1147
 
 
1148
RtVoid RiAttributeV ( const char *name, RtInt n, RtToken tokens[], RtPointer parms[] )
 
1149
{
 
1150
    try
 
1151
    {
 
1152
        context.current().RiAttributeV( name, n, tokens, parms );
 
1153
    }
 
1154
    catch ( CqError & r )
 
1155
    {
 
1156
        r.manage();
 
1157
    }
 
1158
}
 
1159
 
 
1160
RtVoid RiPolygon ( RtInt nverts, ... )
 
1161
{
 
1162
    try
 
1163
    {
 
1164
        va_list args;
 
1165
        va_start( args, nverts );
 
1166
        CqPLStore pls( args );
 
1167
        va_end( args );
 
1168
 
 
1169
        RiPolygonV( nverts, pls.n, pls.tokens(), pls.parms() );
 
1170
    }
 
1171
    catch ( CqError & r )
 
1172
    {
 
1173
        r.manage();
 
1174
    }
 
1175
}
 
1176
 
 
1177
RtVoid RiPolygonV ( RtInt nverts, RtInt n, RtToken tokens[], RtPointer parms[] )
 
1178
{
 
1179
    try
 
1180
    {
 
1181
        context.current().RiPolygonV( nverts, n, tokens, parms );
 
1182
    }
 
1183
    catch ( CqError & r )
 
1184
    {
 
1185
        r.manage();
 
1186
    }
 
1187
}
 
1188
 
 
1189
RtVoid RiGeneralPolygon ( RtInt nloops, RtInt nverts[], ... )
 
1190
{
 
1191
    try
 
1192
    {
 
1193
        va_list args;
 
1194
        va_start( args, nverts );
 
1195
        CqPLStore pls( args );
 
1196
        va_end( args );
 
1197
 
 
1198
        RiGeneralPolygonV( nloops, nverts, pls.n, pls.tokens(), pls.parms() );
 
1199
    }
 
1200
    catch ( CqError & r )
 
1201
    {
 
1202
        r.manage();
 
1203
    }
 
1204
}
 
1205
 
 
1206
RtVoid RiGeneralPolygonV ( RtInt nloops, RtInt nverts[],
 
1207
                           RtInt n, RtToken tokens[], RtPointer parms[] )
 
1208
{
 
1209
    try
 
1210
    {
 
1211
        context.current().RiGeneralPolygonV( nloops, nverts, n, tokens, parms );
 
1212
    }
 
1213
    catch ( CqError & r )
 
1214
    {
 
1215
        r.manage();
 
1216
    }
 
1217
}
 
1218
 
 
1219
RtVoid RiPointsPolygons ( RtInt npolys, RtInt nverts[], RtInt verts[], ... )
 
1220
{
 
1221
    try
 
1222
    {
 
1223
        va_list args;
 
1224
        va_start( args, verts );
 
1225
        CqPLStore pls( args );
 
1226
        va_end( args );
 
1227
 
 
1228
        RiPointsPolygonsV( npolys, nverts, verts, pls.n, pls.tokens(), pls.parms() );
 
1229
    }
 
1230
    catch ( CqError & r )
 
1231
    {
 
1232
        r.manage();
 
1233
    }
 
1234
}
 
1235
 
 
1236
 
 
1237
RtVoid RiPointsPolygonsV ( RtInt npolys, RtInt nverts[], RtInt verts[],
 
1238
                           RtInt n, RtToken tokens[], RtPointer parms[] )
 
1239
{
 
1240
    try
 
1241
    {
 
1242
        context.current().RiPointsPolygonsV( npolys, nverts, verts, n, tokens, parms );
 
1243
    }
 
1244
    catch ( CqError & r )
 
1245
    {
 
1246
        r.manage();
 
1247
    }
 
1248
}
 
1249
 
 
1250
RtVoid RiPointsGeneralPolygons ( RtInt npolys, RtInt nloops[], RtInt nverts[], RtInt verts[], ... )
 
1251
{
 
1252
    try
 
1253
    {
 
1254
        va_list args;
 
1255
        va_start( args, verts );
 
1256
        CqPLStore pls( args );
 
1257
        va_end( args );
 
1258
 
 
1259
        RiPointsGeneralPolygonsV( npolys, nloops, nverts, verts, pls.n, pls.tokens(), pls.parms() );
 
1260
    }
 
1261
    catch ( CqError & r )
 
1262
    {
 
1263
        r.manage();
 
1264
    }
 
1265
}
 
1266
 
 
1267
RtVoid RiPointsGeneralPolygonsV ( RtInt npolys, RtInt nloops[], RtInt nverts[], RtInt verts[],
 
1268
                                  RtInt n, RtToken tokens[], RtPointer parms[] )
 
1269
{
 
1270
    try
 
1271
    {
 
1272
        context.current().RiPointsGeneralPolygonsV( npolys, nloops, nverts, verts, n, tokens, parms );
 
1273
    }
 
1274
    catch ( CqError & r )
 
1275
    {
 
1276
        r.manage();
 
1277
    }
 
1278
}
 
1279
 
 
1280
RtVoid RiBasis ( RtBasis ubasis, RtInt ustep, RtBasis vbasis, RtInt vstep )
 
1281
{
 
1282
    try
 
1283
    {
 
1284
        context.current().RiBasis( ubasis, ustep, vbasis, vstep );
 
1285
    }
 
1286
    catch ( CqError & r )
 
1287
    {
 
1288
        r.manage();
 
1289
    }
 
1290
}
 
1291
 
 
1292
RtVoid RiPatch ( RtToken type, ... )
 
1293
{
 
1294
    try
 
1295
    {
 
1296
        va_list args;
 
1297
        va_start( args, type );
 
1298
        CqPLStore pls( args );
 
1299
        va_end( args );
 
1300
 
 
1301
        RiPatchV( type, pls.n, pls.tokens(), pls.parms() );
 
1302
    }
 
1303
    catch ( CqError & r )
 
1304
    {
 
1305
        r.manage();
 
1306
    }
 
1307
}
 
1308
 
 
1309
RtVoid RiPatchV ( RtToken type, RtInt n, RtToken tokens[], RtPointer parms[] )
 
1310
{
 
1311
    try
 
1312
    {
 
1313
        context.current().RiPatchV( type, n, tokens, parms );
 
1314
    }
 
1315
    catch ( CqError & r )
 
1316
    {
 
1317
        r.manage();
 
1318
    }
 
1319
}
 
1320
 
 
1321
RtVoid RiPatchMesh ( RtToken type, RtInt nu, RtToken uwrap, RtInt nv, RtToken vwrap, ... )
 
1322
{
 
1323
    try
 
1324
    {
 
1325
        va_list args;
 
1326
        va_start( args, vwrap );
 
1327
        CqPLStore pls( args );
 
1328
        va_end( args );
 
1329
 
 
1330
        RiPatchMeshV( type, nu, uwrap, nv, vwrap, pls.n, pls.tokens(), pls.parms() );
 
1331
    }
 
1332
    catch ( CqError & r )
 
1333
    {
 
1334
        r.manage();
 
1335
    }
 
1336
}
 
1337
 
 
1338
RtVoid RiPatchMeshV ( RtToken type, RtInt nu, RtToken uwrap, RtInt nv, RtToken vwrap,
 
1339
                      RtInt n, RtToken tokens[], RtPointer parms[] )
 
1340
{
 
1341
    try
 
1342
    {
 
1343
        context.current().RiPatchMeshV( type, nu, uwrap, nv, vwrap, n, tokens, parms );
 
1344
    }
 
1345
    catch ( CqError & r )
 
1346
    {
 
1347
        r.manage();
 
1348
    }
 
1349
}
 
1350
 
 
1351
RtVoid RiNuPatch ( RtInt nu, RtInt uorder, RtFloat uknot[], RtFloat umin,
 
1352
                   RtFloat umax, RtInt nv, RtInt vorder, RtFloat vknot[],
 
1353
                   RtFloat vmin, RtFloat vmax, ... )
 
1354
{
 
1355
    try
 
1356
    {
 
1357
        va_list args;
 
1358
        va_start( args, vmax );
 
1359
        CqPLStore pls( args );
 
1360
        va_end( args );
 
1361
 
 
1362
        RiNuPatchV( nu, uorder, uknot, umin,
 
1363
                    umax, nv, vorder, vknot,
 
1364
                    vmin, vmax, pls.n, pls.tokens(), pls.parms() );
 
1365
    }
 
1366
    catch ( CqError & r )
 
1367
    {
 
1368
        r.manage();
 
1369
    }
 
1370
}
 
1371
 
 
1372
RtVoid RiNuPatchV ( RtInt nu, RtInt uorder, RtFloat uknot[], RtFloat umin,
 
1373
                    RtFloat umax, RtInt nv, RtInt vorder, RtFloat vknot[],
 
1374
                    RtFloat vmin, RtFloat vmax,
 
1375
                    RtInt n, RtToken tokens[], RtPointer parms[] )
 
1376
{
 
1377
    try
 
1378
    {
 
1379
        context.current().RiNuPatchV( nu, uorder, uknot, umin,
 
1380
                                      umax, nv, vorder, vknot,
 
1381
                                      vmin, vmax, n, tokens, parms );
 
1382
    }
 
1383
    catch ( CqError & r )
 
1384
    {
 
1385
        r.manage();
 
1386
    }
 
1387
}
 
1388
 
 
1389
RtVoid RiTrimCurve ( RtInt nloops, RtInt ncurves[], RtInt order[],
 
1390
                     RtFloat knot[], RtFloat min[], RtFloat max[],
 
1391
                     RtInt n[], RtFloat u[], RtFloat v[], RtFloat w[] )
 
1392
{
 
1393
    try
 
1394
    {
 
1395
        context.current().RiTrimCurve( nloops, ncurves, order,
 
1396
                                       knot, min, max,
 
1397
                                       n, u, v, w );
 
1398
    }
 
1399
    catch ( CqError & r )
 
1400
    {
 
1401
        r.manage();
 
1402
    }
 
1403
}
 
1404
 
 
1405
RtVoid RiSphere ( RtFloat radius, RtFloat zmin, RtFloat zmax, RtFloat tmax, ... )
 
1406
{
 
1407
    try
 
1408
    {
 
1409
        va_list args;
 
1410
        va_start( args, tmax );
 
1411
        CqPLStore pls( args );
 
1412
        va_end( args );
 
1413
 
 
1414
        RiSphereV( radius, zmin, zmax, tmax, pls.n, pls.tokens(), pls.parms() );
 
1415
    }
 
1416
    catch ( CqError & r )
 
1417
    {
 
1418
        r.manage();
 
1419
    }
 
1420
}
 
1421
 
 
1422
RtVoid RiSphereV ( RtFloat radius, RtFloat zmin, RtFloat zmax, RtFloat tmax,
 
1423
                   RtInt n, RtToken tokens[], RtPointer parms[] )
 
1424
{
 
1425
    try
 
1426
    {
 
1427
        context.current().RiSphereV( radius, zmin, zmax, tmax, n, tokens, parms );
 
1428
    }
 
1429
    catch ( CqError & r )
 
1430
    {
 
1431
        r.manage();
 
1432
    }
 
1433
}
 
1434
 
 
1435
RtVoid RiCone ( RtFloat height, RtFloat radius, RtFloat tmax, ... )
 
1436
{
 
1437
    try
 
1438
    {
 
1439
        va_list args;
 
1440
        va_start( args, tmax );
 
1441
        CqPLStore pls( args );
 
1442
        va_end( args );
 
1443
 
 
1444
        RiConeV( height, radius, tmax, pls.n, pls.tokens(), pls.parms() );
 
1445
    }
 
1446
    catch ( CqError & r )
 
1447
    {
 
1448
        r.manage();
 
1449
    }
 
1450
}
 
1451
 
 
1452
RtVoid RiConeV ( RtFloat height, RtFloat radius, RtFloat tmax,
 
1453
                 RtInt n, RtToken tokens[], RtPointer parms[] )
 
1454
{
 
1455
    try
 
1456
    {
 
1457
        context.current().RiConeV( height, radius, tmax, n, tokens, parms );
 
1458
    }
 
1459
    catch ( CqError & r )
 
1460
    {
 
1461
        r.manage();
 
1462
    }
 
1463
}
 
1464
 
 
1465
RtVoid RiCylinder ( RtFloat radius, RtFloat zmin, RtFloat zmax, RtFloat tmax, ... )
 
1466
{
 
1467
    try
 
1468
    {
 
1469
        va_list args;
 
1470
        va_start( args, tmax );
 
1471
        CqPLStore pls( args );
 
1472
        va_end( args );
 
1473
 
 
1474
        RiCylinderV( radius, zmin, zmax, tmax, pls.n, pls.tokens(), pls.parms() );
 
1475
    }
 
1476
    catch ( CqError & r )
 
1477
    {
 
1478
        r.manage();
 
1479
    }
 
1480
}
 
1481
 
 
1482
RtVoid RiCylinderV ( RtFloat radius, RtFloat zmin, RtFloat zmax, RtFloat tmax,
 
1483
                     RtInt n, RtToken tokens[], RtPointer parms[] )
 
1484
{
 
1485
    try
 
1486
    {
 
1487
        context.current().RiCylinderV( radius, zmin, zmax, tmax, n, tokens, parms );
 
1488
    }
 
1489
    catch ( CqError & r )
 
1490
    {
 
1491
        r.manage();
 
1492
    }
 
1493
}
 
1494
 
 
1495
RtVoid RiHyperboloid ( RtPoint point1, RtPoint point2, RtFloat tmax, ... )
 
1496
{
 
1497
    try
 
1498
    {
 
1499
        va_list args;
 
1500
        va_start( args, tmax );
 
1501
        CqPLStore pls( args );
 
1502
        va_end( args );
 
1503
 
 
1504
        RiHyperboloidV( point1, point2, tmax, pls.n, pls.tokens(), pls.parms() );
 
1505
    }
 
1506
    catch ( CqError & r )
 
1507
    {
 
1508
        r.manage();
 
1509
    }
 
1510
}
 
1511
 
 
1512
RtVoid RiHyperboloidV ( RtPoint point1, RtPoint point2, RtFloat tmax,
 
1513
                        RtInt n, RtToken tokens[], RtPointer parms[] )
 
1514
{
 
1515
    try
 
1516
    {
 
1517
        context.current().RiHyperboloidV( point1, point2, tmax, n, tokens, parms );
 
1518
    }
 
1519
    catch ( CqError & r )
 
1520
    {
 
1521
        r.manage();
 
1522
    }
 
1523
}
 
1524
 
 
1525
RtVoid RiParaboloid ( RtFloat rmax, RtFloat zmin, RtFloat zmax, RtFloat tmax, ... )
 
1526
{
 
1527
    try
 
1528
    {
 
1529
        va_list args;
 
1530
        va_start( args, tmax );
 
1531
        CqPLStore pls( args );
 
1532
        va_end( args );
 
1533
 
 
1534
        RiParaboloidV( rmax, zmin, zmax, tmax, pls.n, pls.tokens(), pls.parms() );
 
1535
    }
 
1536
    catch ( CqError & r )
 
1537
    {
 
1538
        r.manage();
 
1539
    }
 
1540
}
 
1541
 
 
1542
RtVoid RiParaboloidV ( RtFloat rmax, RtFloat zmin, RtFloat zmax, RtFloat tmax,
 
1543
                       RtInt n, RtToken tokens[], RtPointer parms[] )
 
1544
{
 
1545
    try
 
1546
    {
 
1547
        context.current().RiParaboloidV( rmax, zmin, zmax, tmax, n, tokens, parms );
 
1548
    }
 
1549
    catch ( CqError & r )
 
1550
    {
 
1551
        r.manage();
 
1552
    }
 
1553
}
 
1554
 
 
1555
RtVoid RiDisk ( RtFloat height, RtFloat radius, RtFloat tmax, ... )
 
1556
{
 
1557
    try
 
1558
    {
 
1559
        va_list args;
 
1560
        va_start( args, tmax );
 
1561
        CqPLStore pls( args );
 
1562
        va_end( args );
 
1563
 
 
1564
        RiDiskV( height, radius, tmax, pls.n, pls.tokens(), pls.parms() );
 
1565
    }
 
1566
    catch ( CqError & r )
 
1567
    {
 
1568
        r.manage();
 
1569
    }
 
1570
}
 
1571
 
 
1572
RtVoid RiDiskV ( RtFloat height, RtFloat radius, RtFloat tmax,
 
1573
                 RtInt n, RtToken tokens[], RtPointer parms[] )
 
1574
{
 
1575
    try
 
1576
    {
 
1577
        context.current().RiDiskV( height, radius, tmax, n, tokens, parms );
 
1578
    }
 
1579
    catch ( CqError & r )
 
1580
    {
 
1581
        r.manage();
 
1582
    }
 
1583
}
 
1584
 
 
1585
RtVoid RiTorus ( RtFloat majrad, RtFloat minrad, RtFloat phimin,
 
1586
                 RtFloat phimax, RtFloat tmax, ... )
 
1587
{
 
1588
    try
 
1589
    {
 
1590
        va_list args;
 
1591
        va_start( args, tmax );
 
1592
        CqPLStore pls( args );
 
1593
        va_end( args );
 
1594
 
 
1595
        RiTorusV( majrad, minrad, phimin, phimax, tmax, pls.n, pls.tokens(), pls.parms() );
 
1596
    }
 
1597
    catch ( CqError & r )
 
1598
    {
 
1599
        r.manage();
 
1600
    }
 
1601
}
 
1602
 
 
1603
RtVoid RiTorusV ( RtFloat majrad, RtFloat minrad,
 
1604
                  RtFloat phimin, RtFloat phimax, RtFloat tmax,
 
1605
                  RtInt n, RtToken tokens[], RtPointer parms[] )
 
1606
{
 
1607
    try
 
1608
    {
 
1609
        context.current().RiTorusV( majrad, minrad, phimin, phimax, tmax, n, tokens, parms );
 
1610
    }
 
1611
    catch ( CqError & r )
 
1612
    {
 
1613
        r.manage();
 
1614
    }
 
1615
}
 
1616
 
 
1617
RtVoid RiBlobby ( RtInt nleaf, RtInt ncode, RtInt code[],
 
1618
                  RtInt nflt, RtFloat flt[],
 
1619
                  RtInt nstr, RtToken str[], ... )
 
1620
{
 
1621
    try
 
1622
    {
 
1623
        va_list args;
 
1624
        va_start( args, str );
 
1625
        CqPLStore pls( args );
 
1626
        va_end( args );
 
1627
 
 
1628
        RiBlobbyV( nleaf, ncode, code, nflt, flt, nstr, str, pls.n, pls.tokens(), pls.parms() );
 
1629
    }
 
1630
    catch ( CqError & r )
 
1631
    {
 
1632
        r.manage();
 
1633
    }
 
1634
}
 
1635
 
 
1636
RtVoid RiBlobbyV ( RtInt nleaf, RtInt ncode, RtInt code[],
 
1637
                   RtInt nflt, RtFloat flt[],
 
1638
                   RtInt nstr, RtToken str[],
 
1639
                   RtInt n, RtToken tokens[], RtPointer parms[] )
 
1640
{
 
1641
    try
 
1642
    {
 
1643
        context.current().RiBlobbyV( nleaf, ncode, code, nflt, flt, nstr, str, n, tokens, parms );
 
1644
    }
 
1645
    catch ( CqError & r )
 
1646
    {
 
1647
        r.manage();
 
1648
    }
 
1649
}
 
1650
 
 
1651
RtVoid RiCurves ( RtToken type, RtInt ncurves,
 
1652
                  RtInt nvertices[], RtToken wrap, ... )
 
1653
{
 
1654
    try
 
1655
    {
 
1656
        va_list args;
 
1657
        va_start( args, wrap );
 
1658
        CqPLStore pls( args );
 
1659
        va_end( args );
 
1660
 
 
1661
        RiCurvesV( type, ncurves, nvertices, wrap, pls.n, pls.tokens(), pls.parms() );
 
1662
    }
 
1663
    catch ( CqError & r )
 
1664
    {
 
1665
        r.manage();
 
1666
    }
 
1667
}
 
1668
 
 
1669
RtVoid RiCurvesV ( RtToken type, RtInt ncurves,
 
1670
                   RtInt nvertices[], RtToken wrap,
 
1671
                   RtInt n, RtToken tokens[], RtPointer parms[] )
 
1672
{
 
1673
    try
 
1674
    {
 
1675
        context.current().RiCurvesV( type, ncurves, nvertices, wrap, n, tokens, parms );
 
1676
    }
 
1677
    catch ( CqError & r )
 
1678
    {
 
1679
        r.manage();
 
1680
    }
 
1681
}
 
1682
 
 
1683
RtVoid RiPoints( RtInt npoints, ... )
 
1684
{
 
1685
    try
 
1686
    {
 
1687
        va_list args;
 
1688
        va_start( args, npoints );
 
1689
        CqPLStore pls( args );
 
1690
        va_end( args );
 
1691
 
 
1692
        RiPointsV( npoints, pls.n, pls.tokens(), pls.parms() );
 
1693
    }
 
1694
    catch ( CqError & r )
 
1695
    {
 
1696
        r.manage();
 
1697
    }
 
1698
}
 
1699
 
 
1700
RtVoid RiPointsV( RtInt npoints, RtInt n, RtToken tokens[], RtPointer parms[] )
 
1701
{
 
1702
 
 
1703
    try
 
1704
    {
 
1705
        context.current().RiPointsV( npoints, n, tokens, parms );
 
1706
    }
 
1707
    catch ( CqError & r )
 
1708
    {
 
1709
        r.manage();
 
1710
    }
 
1711
}
 
1712
 
 
1713
RtVoid RiSubdivisionMesh ( RtToken mask, RtInt nf, RtInt nverts[],
 
1714
                           RtInt verts[],
 
1715
                           RtInt ntags, RtToken tags[], RtInt numargs[],
 
1716
                           RtInt intargs[], RtFloat floatargs[], ... )
 
1717
{
 
1718
    try
 
1719
    {
 
1720
        va_list args;
 
1721
        va_start( args, floatargs );
 
1722
        CqPLStore pls( args );
 
1723
        va_end( args );
 
1724
 
 
1725
        RiSubdivisionMeshV( mask, nf, nverts, verts, ntags, tags, numargs,
 
1726
                            intargs, floatargs, pls.n, pls.tokens(), pls.parms() );
 
1727
    }
 
1728
    catch ( CqError & r )
 
1729
    {
 
1730
        r.manage();
 
1731
    }
 
1732
}
 
1733
 
 
1734
RtVoid RiSubdivisionMeshV ( RtToken mask, RtInt nf, RtInt nverts[],
 
1735
                            RtInt verts[],
 
1736
                            RtInt ntags, RtToken tags[], RtInt numargs[],
 
1737
                            RtInt intargs[], RtFloat floatargs[],
 
1738
                            RtInt n, RtToken tokens[], RtPointer parms[] )
 
1739
{
 
1740
    try
 
1741
    {
 
1742
        context.current().RiSubdivisionMeshV( mask, nf, nverts, verts,
 
1743
                                              ntags, tags, numargs, intargs, floatargs,
 
1744
                                              n, tokens, parms );
 
1745
    }
 
1746
    catch ( CqError & r )
 
1747
    {
 
1748
        r.manage();
 
1749
    }
 
1750
}
 
1751
 
 
1752
RtVoid RiProcedural ( RtPointer data, RtBound bound,
 
1753
                      RtVoid ( *subdivfunc ) ( RtPointer, RtFloat ),
 
1754
                      RtVoid ( *freefunc ) ( RtPointer ) )
 
1755
{
 
1756
    try
 
1757
    {
 
1758
        context.current().RiProcedural( data, bound, subdivfunc, freefunc );
 
1759
    }
 
1760
    catch ( CqError & r )
 
1761
    {
 
1762
        r.manage();
 
1763
    }
 
1764
}
 
1765
 
 
1766
RtVoid RiGeometry ( RtToken type, ... )
 
1767
{
 
1768
    try
 
1769
    {
 
1770
        va_list args;
 
1771
        va_start( args, type );
 
1772
        CqPLStore pls( args );
 
1773
        va_end( args );
 
1774
 
 
1775
        RiGeometryV( type, pls.n, pls.tokens(), pls.parms() );
 
1776
    }
 
1777
    catch ( CqError & r )
 
1778
    {
 
1779
        r.manage();
 
1780
    }
 
1781
}
 
1782
 
 
1783
RtVoid RiGeometryV ( RtToken type, RtInt n, RtToken tokens[], RtPointer parms[] )
 
1784
{
 
1785
    try
 
1786
    {
 
1787
        context.current().RiGeometryV( type, n, tokens, parms );
 
1788
    }
 
1789
    catch ( CqError & r )
 
1790
    {
 
1791
        r.manage();
 
1792
    }
 
1793
}
 
1794
 
 
1795
RtVoid RiSolidBegin ( RtToken operation )
 
1796
{
 
1797
    try
 
1798
    {
 
1799
        context.current().RiSolidBegin( operation );
 
1800
    }
 
1801
    catch ( CqError & r )
 
1802
    {
 
1803
        r.manage();
 
1804
    }
 
1805
}
 
1806
 
 
1807
RtVoid RiSolidEnd ( void )
 
1808
{
 
1809
    try
 
1810
    {
 
1811
        context.current().RiSolidEnd();
 
1812
    }
 
1813
    catch ( CqError & r )
 
1814
    {
 
1815
        r.manage();
 
1816
    }
 
1817
}
 
1818
 
 
1819
RtObjectHandle RiObjectBegin ( void )
 
1820
{
 
1821
    try
 
1822
    {
 
1823
        return context.current().RiObjectBegin();
 
1824
    }
 
1825
    catch ( CqError & r )
 
1826
    {
 
1827
        r.manage();
 
1828
        return RI_NULL;
 
1829
    }
 
1830
}
 
1831
 
 
1832
RtVoid RiObjectEnd ( void )
 
1833
{
 
1834
    try
 
1835
    {
 
1836
        context.current().RiObjectEnd();
 
1837
    }
 
1838
    catch ( CqError & r )
 
1839
    {
 
1840
        r.manage();
 
1841
    }
 
1842
}
 
1843
 
 
1844
RtVoid RiObjectInstance ( RtObjectHandle handle )
 
1845
{
 
1846
    try
 
1847
    {
 
1848
        context.current().RiObjectInstance( handle );
 
1849
    }
 
1850
    catch ( CqError & r )
 
1851
    {
 
1852
        r.manage();
 
1853
    }
 
1854
}
 
1855
 
 
1856
RtVoid RiMotionBegin ( RtInt n, ... )
 
1857
{
 
1858
    try
 
1859
    {
 
1860
        va_list args;
 
1861
        va_start( args, n );
 
1862
        RtFloat* times = new RtFloat[ n ];
 
1863
 
 
1864
        for ( RtInt i = 0;i < n;i++ )
 
1865
        {
 
1866
            times[ i ] = va_arg( args, double );
 
1867
        }
 
1868
        va_end( args );
 
1869
 
 
1870
        RiMotionBeginV( n, times );
 
1871
        delete[] ( times );
 
1872
    }
 
1873
    catch ( CqError & r )
 
1874
    {
 
1875
        r.manage();
 
1876
    }
 
1877
}
 
1878
 
 
1879
RtVoid RiMotionBeginV ( RtInt n, RtFloat times[] )
 
1880
{
 
1881
    try
 
1882
    {
 
1883
        context.current().RiMotionBeginV( n, times );
 
1884
    }
 
1885
    catch ( CqError & r )
 
1886
    {
 
1887
        r.manage();
 
1888
    }
 
1889
}
 
1890
 
 
1891
RtVoid RiMotionEnd ( void )
 
1892
{
 
1893
    try
 
1894
    {
 
1895
        context.current().RiMotionEnd();
 
1896
    }
 
1897
    catch ( CqError & r )
 
1898
    {
 
1899
        r.manage();
 
1900
    }
 
1901
}
 
1902
 
 
1903
RtVoid RiMakeTexture ( const char *pic, const char *tex, RtToken swrap, RtToken twrap,
 
1904
                       RtFilterFunc filterfunc, RtFloat swidth, RtFloat twidth, ... )
 
1905
{
 
1906
    try
 
1907
    {
 
1908
        va_list args;
 
1909
        va_start( args, twidth );
 
1910
        CqPLStore pls( args );
 
1911
        va_end( args );
 
1912
 
 
1913
        RiMakeTextureV( pic, tex, swrap, twrap, filterfunc, swidth, twidth,
 
1914
                        pls.n, pls.tokens(), pls.parms() );
 
1915
    }
 
1916
    catch ( CqError & r )
 
1917
    {
 
1918
        r.manage();
 
1919
    }
 
1920
}
 
1921
 
 
1922
RtVoid RiMakeTextureV ( const char *pic, const char *tex, RtToken swrap, RtToken twrap,
 
1923
                        RtFilterFunc filterfunc, RtFloat swidth, RtFloat twidth,
 
1924
                        RtInt n, RtToken tokens[], RtPointer parms[] )
 
1925
{
 
1926
    try
 
1927
    {
 
1928
        context.current().RiMakeTextureV( pic, tex, swrap, twrap,
 
1929
                                          filterfunc, swidth, twidth,
 
1930
                                          n, tokens, parms );
 
1931
    }
 
1932
    catch ( CqError & r )
 
1933
    {
 
1934
        r.manage();
 
1935
    }
 
1936
}
 
1937
 
 
1938
RtVoid RiMakeBump ( const char *pic, const char *tex, RtToken swrap, RtToken twrap,
 
1939
                    RtFilterFunc filterfunc, RtFloat swidth, RtFloat twidth, ... )
 
1940
{
 
1941
    try
 
1942
    {
 
1943
        va_list args;
 
1944
        va_start( args, twidth );
 
1945
        CqPLStore pls( args );
 
1946
        va_end( args );
 
1947
 
 
1948
        RiMakeBumpV( pic, tex, swrap, twrap, filterfunc, swidth, twidth,
 
1949
                     pls.n, pls.tokens(), pls.parms() );
 
1950
    }
 
1951
    catch ( CqError & r )
 
1952
    {
 
1953
        r.manage();
 
1954
    }
 
1955
}
 
1956
 
 
1957
RtVoid RiMakeBumpV ( const char *pic, const char *tex, RtToken swrap, RtToken twrap,
 
1958
                     RtFilterFunc filterfunc, RtFloat swidth, RtFloat twidth,
 
1959
                     RtInt n, RtToken tokens[], RtPointer parms[] )
 
1960
{
 
1961
    try
 
1962
    {
 
1963
        context.current().RiMakeBumpV( pic, tex, swrap, twrap,
 
1964
                                       filterfunc, swidth, twidth,
 
1965
                                       n, tokens, parms );
 
1966
    }
 
1967
    catch ( CqError & r )
 
1968
    {
 
1969
        r.manage();
 
1970
    }
 
1971
}
 
1972
 
 
1973
RtVoid RiMakeLatLongEnvironment ( const char *pic, const char *tex,
 
1974
                                  RtFilterFunc filterfunc,
 
1975
                                  RtFloat swidth, RtFloat twidth, ... )
 
1976
{
 
1977
    try
 
1978
    {
 
1979
        va_list args;
 
1980
        va_start( args, twidth );
 
1981
        CqPLStore pls( args );
 
1982
        va_end( args );
 
1983
 
 
1984
        RiMakeLatLongEnvironmentV( pic, tex, filterfunc, swidth, twidth,
 
1985
                                   pls.n, pls.tokens(), pls.parms() );
 
1986
    }
 
1987
    catch ( CqError & r )
 
1988
    {
 
1989
        r.manage();
 
1990
    }
 
1991
}
 
1992
 
 
1993
RtVoid RiMakeLatLongEnvironmentV ( const char *pic, const char *tex,
 
1994
                                   RtFilterFunc filterfunc,
 
1995
                                   RtFloat swidth, RtFloat twidth,
 
1996
                                   RtInt n, RtToken tokens[], RtPointer parms[] )
 
1997
{
 
1998
    try
 
1999
    {
 
2000
        context.current().RiMakeLatLongEnvironmentV( pic, tex, filterfunc,
 
2001
                swidth, twidth,
 
2002
                n, tokens, parms );
 
2003
    }
 
2004
    catch ( CqError & r )
 
2005
    {
 
2006
        r.manage();
 
2007
    }
 
2008
}
 
2009
 
 
2010
RtVoid RiMakeCubeFaceEnvironment ( const char *px, const char *nx, const char *py, const char *ny,
 
2011
                                   const char *pz, const char *nz, const char *tex, RtFloat fov,
 
2012
                                   RtFilterFunc filterfunc,
 
2013
                                   RtFloat swidth, RtFloat ywidth, ... )
 
2014
{
 
2015
    try
 
2016
    {
 
2017
        va_list args;
 
2018
        va_start( args, ywidth );
 
2019
        CqPLStore pls( args );
 
2020
        va_end( args );
 
2021
 
 
2022
        RiMakeCubeFaceEnvironmentV( px, nx, py, ny, pz, nz, tex, fov,
 
2023
                                    filterfunc, swidth, ywidth,
 
2024
                                    pls.n, pls.tokens(), pls.parms() );
 
2025
    }
 
2026
    catch ( CqError & r )
 
2027
    {
 
2028
        r.manage();
 
2029
    }
 
2030
}
 
2031
 
 
2032
RtVoid RiMakeCubeFaceEnvironmentV ( const char *px, const char *nx, const char *py, const char *ny,
 
2033
                                    const char *pz, const char *nz, const char *tex, RtFloat fov,
 
2034
                                    RtFilterFunc filterfunc, RtFloat swidth, RtFloat ywidth,
 
2035
                                    RtInt n, RtToken tokens[], RtPointer parms[] )
 
2036
{
 
2037
    try
 
2038
    {
 
2039
        context.current().RiMakeCubeFaceEnvironmentV( px, nx, py, ny, pz, nz, tex, fov,
 
2040
                filterfunc, swidth, ywidth,
 
2041
                n, tokens, parms );
 
2042
    }
 
2043
    catch ( CqError & r )
 
2044
    {
 
2045
        r.manage();
 
2046
    }
 
2047
}
 
2048
 
 
2049
RtVoid RiMakeShadow ( const char *pic, const char *tex, ... )
 
2050
{
 
2051
 
 
2052
    try
 
2053
    {
 
2054
        va_list args;
 
2055
        va_start( args, tex );
 
2056
        CqPLStore pls( args );
 
2057
        va_end( args );
 
2058
 
 
2059
        RiMakeShadowV( pic, tex, pls.n, pls.tokens(), pls.parms() );
 
2060
    }
 
2061
    catch ( CqError & r )
 
2062
    {
 
2063
        r.manage();
 
2064
    }
 
2065
}
 
2066
 
 
2067
RtVoid RiMakeShadowV ( const char *pic, const char *tex,
 
2068
                       RtInt n, RtToken tokens[], RtPointer parms[] )
 
2069
{
 
2070
    try
 
2071
    {
 
2072
        context.current().RiMakeShadowV( pic, tex, n, tokens, parms );
 
2073
    }
 
2074
    catch ( CqError & r )
 
2075
    {
 
2076
        r.manage();
 
2077
    }
 
2078
}
 
2079
 
 
2080
RtVoid RiArchiveRecord ( RtToken type, char *format, ... )
 
2081
{
 
2082
    try
 
2083
    {
 
2084
        va_list args;
 
2085
        va_start( args, format );
 
2086
 
 
2087
        TqInt size = 256;
 
2088
        char* buffer = new char[ size ];
 
2089
#ifdef  AQSIS_COMPILER_MSVC6
 
2090
        while ( _vsnprintf( buffer, 256, format, args ) < 0 )
 
2091
#else
 
2092
        while ( vsnprintf( buffer, 256, format, args ) < 0 )
 
2093
#endif
 
2094
        {
 
2095
            size *= 2;
 
2096
            delete[] ( buffer );
 
2097
            buffer = new char[ size ];
 
2098
        }
 
2099
        std::string i( buffer );
 
2100
        delete[] ( buffer );
 
2101
 
 
2102
        va_end( args );
 
2103
        context.current().RiArchiveRecord( type, i );
 
2104
    }
 
2105
    catch ( CqError & r )
 
2106
    {
 
2107
        r.manage();
 
2108
    }
 
2109
}
 
2110
 
 
2111
RtVoid RiReadArchive( RtToken name, RtArchiveCallback callback, ... )
 
2112
{
 
2113
    try
 
2114
    {
 
2115
        va_list args;
 
2116
        va_start( args, callback );
 
2117
        CqPLStore pls( args );
 
2118
        va_end( args );
 
2119
 
 
2120
        RiReadArchiveV( name, callback, pls.n, pls.tokens(), pls.parms() );
 
2121
    }
 
2122
    catch ( CqError & r )
 
2123
    {
 
2124
        r.manage();
 
2125
    }
 
2126
}
 
2127
 
 
2128
RtVoid RiReadArchiveV( RtToken name, RtArchiveCallback callback,
 
2129
                       RtInt n, RtToken tokens[], RtPointer parms[] )
 
2130
{
 
2131
    try
 
2132
    {
 
2133
        context.current().RiReadArchiveV( name, callback, n, tokens, parms );
 
2134
    }
 
2135
    catch ( CqError & r )
 
2136
    {
 
2137
        r.manage();
 
2138
    }
 
2139
}
 
2140
 
 
2141
RtVoid RiErrorHandler ( RtErrorFunc handler )
 
2142
{
 
2143
    try
 
2144
    {
 
2145
        context.current().RiErrorHandler( handler );
 
2146
    }
 
2147
    catch ( CqError & r )
 
2148
    {
 
2149
        r.manage();
 
2150
    }
 
2151
}