source: trunk/src/opengl/glu/nurbs/internals/nurbstess.h

Last change on this file was 2689, checked in by jeroen, 26 years ago

* empty log message *

File size: 6.2 KB
Line 
1/* $Id: nurbstess.h,v 1.1 2000-02-09 08:49:54 jeroen Exp $ */
2/*
3** License Applicability. Except to the extent portions of this file are
4** made subject to an alternative license as permitted in the SGI Free
5** Software License B, Version 1.0 (the "License"), the contents of this
6** file are subject only to the provisions of the License. You may not use
7** this file except in compliance with the License. You may obtain a copy
8** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
9** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
10**
11** http://oss.sgi.com/projects/FreeB
12**
13** Note that, as provided in the License, the Software is distributed on an
14** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
15** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
16** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
17** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
18**
19** Original Code. The Original Code is: OpenGL Sample Implementation,
20** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
21** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
22** Copyright in any portions created by third parties is as indicated
23** elsewhere herein. All Rights Reserved.
24**
25** Additional Notice Provisions: The application programming interfaces
26** established by SGI in conjunction with the Original Code are The
27** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
28** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
29** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
30** Window System(R) (Version 1.3), released October 19, 1998. This software
31** was created using the OpenGL(R) version 1.2.1 Sample Implementation
32** published by SGI, but has not been independently verified as being
33** compliant with the OpenGL(R) version 1.2.1 Specification.
34*/
35
36/*
37 * nurbstess.h
38 *
39 * $Date: 2000-02-09 08:49:54 $ $Revision: 1.1 $
40 * $Header: /home/ktk/tmp/odin/2007/netlabs.cvs/odin32/src/opengl/glu/nurbs/internals/nurbstess.h,v 1.1 2000-02-09 08:49:54 jeroen Exp $
41 */
42
43#ifndef __glunurbstess_h_
44#define __glunurbstess_h_
45
46#include "mysetjmp.h"
47#include "subdivider.h"
48#include "renderhints.h"
49#include "backend.h"
50#include "maplist.h"
51#include "reader.h"
52#include "nurbsconsts.h"
53
54class Knotvector;
55class Quilt;
56class DisplayList;
57class BasicCurveEvaluator;
58class BasicSurfaceEvaluator;
59
60class NurbsTessellator {
61public:
62 NurbsTessellator( BasicCurveEvaluator &c,
63 BasicSurfaceEvaluator &e );
64 ~NurbsTessellator( void );
65
66 void getnurbsproperty( long, INREAL * );
67 void getnurbsproperty( long, long, INREAL * );
68 void setnurbsproperty( long, INREAL );
69 void setnurbsproperty( long, long, INREAL );
70 void setnurbsproperty( long, long, INREAL * );
71 void setnurbsproperty( long, long, INREAL *, long, long );
72
73 // called before a tessellation begins/ends
74 virtual void bgnrender( void );
75 virtual void endrender( void );
76
77 // called to make a display list of the output vertices
78 virtual void makeobj( int n );
79 virtual void closeobj( void );
80
81 // called when a error occurs
82 virtual void errorHandler( int );
83
84 void bgnsurface( long );
85 void endsurface( void );
86 void bgntrim( void );
87 void endtrim( void );
88 void bgncurve( long );
89 void endcurve( void );
90 void pwlcurve( long, INREAL[], long, long );
91 void nurbscurve( long, INREAL[], long, INREAL[], long, long );
92 void nurbssurface( long, INREAL[], long, INREAL[], long, long,
93 INREAL[], long, long, long );
94
95 void defineMap( long, long, long );
96 void redefineMaps( void );
97
98 // recording of input description
99 void discardRecording( void * );
100 void * beginRecording( void );
101 void endRecording( void );
102 void playRecording( void * );
103
104 //for optimizing untrimmed nurbs in the case of domain distance sampling
105 void set_domain_distance_u_rate(REAL u_rate);
106 void set_domain_distance_v_rate(REAL v_rate);
107 void set_is_domain_distance_sampling(int flag);
108
109
110protected:
111 Renderhints renderhints;
112 Maplist maplist;
113 Backend backend;
114
115private:
116
117 void resetObjects( void );
118 int do_check_knots( Knotvector *, char * );
119 void do_nurbserror( int );
120 void do_bgncurve( O_curve * );
121 void do_endcurve( void );
122 void do_freeall( void );
123 void do_freecurveall( O_curve * );
124 void do_freebgntrim( O_trim * );
125 void do_freebgncurve( O_curve * );
126 void do_freepwlcurve( O_pwlcurve * );
127 void do_freenurbscurve( O_nurbscurve * );
128 void do_freenurbssurface( O_nurbssurface * );
129 void do_freebgnsurface( O_surface * );
130 void do_bgnsurface( O_surface * );
131 void do_endsurface( void );
132 void do_bgntrim( O_trim * );
133 void do_endtrim( void );
134 void do_pwlcurve( O_pwlcurve * );
135 void do_nurbscurve( O_nurbscurve * );
136 void do_nurbssurface( O_nurbssurface * );
137 void do_freenurbsproperty( Property * );
138 void do_setnurbsproperty( Property * );
139 void do_setnurbsproperty2( Property * );
140
141 Subdivider subdivider;
142 JumpBuffer* jumpbuffer;
143 Pool o_pwlcurvePool;
144 Pool o_nurbscurvePool;
145 Pool o_curvePool;
146 Pool o_trimPool;
147 Pool o_surfacePool;
148 Pool o_nurbssurfacePool;
149 Pool propertyPool;
150public:
151 Pool quiltPool;
152private:
153 TrimVertexPool extTrimVertexPool;
154
155 int inSurface; /* bgnsurface seen */
156 int inCurve; /* bgncurve seen */
157 int inTrim; /* bgntrim seen */
158 int isCurveModified; /* curve changed */
159 int isTrimModified; /* trim curves changed */
160 int isSurfaceModified; /* surface changed */
161 int isDataValid; /* all data is good */
162 int numTrims; /* valid trim regions */
163 int playBack;
164
165 O_trim** nextTrim; /* place to link o_trim */
166 O_curve** nextCurve; /* place to link o_curve */
167 O_nurbscurve** nextNurbscurve; /* place to link o_nurbscurve */
168 O_pwlcurve** nextPwlcurve; /* place to link o_pwlcurve */
169 O_nurbssurface** nextNurbssurface; /* place to link o_nurbssurface */
170
171 O_surface* currentSurface;
172 O_trim* currentTrim;
173 O_curve* currentCurve;
174
175 DisplayList *dl;
176
177};
178
179#endif /* __glunurbstess_h_ */
Note: See TracBrowser for help on using the repository browser.