2 * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008)
3 * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved.
5 * Permission is hereby granted, free of charge, to any person obtaining a
6 * copy of this software and associated documentation files (the "Software"),
7 * to deal in the Software without restriction, including without limitation
8 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
9 * and/or sell copies of the Software, and to permit persons to whom the
10 * Software is furnished to do so, subject to the following conditions:
12 * The above copyright notice including the dates of first publication and
13 * either this permission notice or a reference to
14 * http://oss.sgi.com/projects/FreeB/
15 * shall be included in all copies or substantial portions of the Software.
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
18 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
20 * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
21 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
22 * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
25 * Except as contained in this notice, the name of Silicon Graphics, Inc.
26 * shall not be used in advertising or otherwise to promote the sale, use or
27 * other dealings in this Software without prior written authorization from
28 * Silicon Graphics, Inc.
36 #ifndef __glureader_h_
37 #define __glureader_h_
42 enum Curvetype
{ ct_nurbscurve
, ct_pwlcurve
, ct_none
};
46 struct O_nurbssurface
;
55 struct O_curve
: public PooledObj
{
57 O_nurbscurve
*o_nurbscurve
;
58 O_pwlcurve
*o_pwlcurve
;
60 Curvetype curvetype
; /* arc type: pwl or nurbs */
61 O_curve
* next
; /* next arc in loop */
62 O_surface
* owner
; /* owning surface */
63 int used
; /* curve called in cur surf */
64 int save
; /* 1 if in display list */
66 O_curve() { next
= 0; used
= 0; owner
= 0;
67 curve
.o_pwlcurve
= 0; curvetype
= ct_none
; save
= 0; nuid
= 0; }
70 struct O_nurbscurve
: public PooledObj
{
71 Quilt
*bezier_curves
; /* array of bezier curves */
72 long type
; /* range descriptor */
73 REAL tesselation
; /* tesselation tolerance */
74 int method
; /* tesselation method */
75 O_nurbscurve
* next
; /* next curve in list */
76 int used
; /* curve called in cur surf */
77 int save
; /* 1 if in display list */
78 O_curve
* owner
; /* owning curve */
79 O_nurbscurve( long _type
)
80 { bezier_curves
= 0; type
= _type
; tesselation
= 0; method
= 0; next
= 0; used
= 0; save
= 0; owner
= 0; }
83 class O_pwlcurve
: public PooledObj
{
85 TrimVertex
*pts
; /* array of trim vertices */
86 int npts
; /* number of trim vertices */
87 O_pwlcurve
* next
; /* next curve in list */
88 int used
; /* curve called in cur surf */
89 int save
; /* 1 if in display list */
90 O_curve
* owner
; /* owning curve */
91 O_pwlcurve( long, long, INREAL
*, long, TrimVertex
* );
94 struct O_trim
: public PooledObj
{
95 O_curve
*o_curve
; /* closed trim loop */
96 O_trim
* next
; /* next loop along trim */
97 int save
; /* 1 if in display list */
98 O_trim() { next
= 0; o_curve
= 0; save
= 0; }
101 struct O_nurbssurface
: public PooledObj
{
102 Quilt
* bezier_patches
;/* array of bezier patches */
103 long type
; /* range descriptor */
104 O_surface
* owner
; /* owning surface */
105 O_nurbssurface
* next
; /* next surface in chain */
106 int save
; /* 1 if in display list */
107 int used
; /* 1 if prev called in block */
108 O_nurbssurface( long _type
)
109 { bezier_patches
= 0; type
= _type
; owner
= 0; next
= 0; save
= 0; used
= 0; }
112 struct O_surface
: public PooledObj
{
113 O_nurbssurface
* o_nurbssurface
; /* linked list of surfaces */
114 O_trim
* o_trim
; /* list of trim loops */
115 int save
; /* 1 if in display list */
117 O_surface() { o_trim
= 0; o_nurbssurface
= 0; save
= 0; nuid
= 0; }
120 struct Property
: public PooledObj
{
124 int save
; /* 1 if in display list */
125 Property( long _type
, long _tag
, INREAL _value
)
126 { type
= _type
; tag
= _tag
; value
= (REAL
) _value
; save
= 0; }
127 Property( long _tag
, INREAL _value
)
128 { type
= 0; tag
= _tag
; value
= (REAL
) _value
; save
= 0; }
131 class NurbsTessellator
;
132 #endif /* __glureader_h_ */