ReactOS 0.4.15-dev-5672-gf73ac17
mapdesc.h
Go to the documentation of this file.
1/*
2 * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008)
3 * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved.
4 *
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:
11 *
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.
16 *
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
23 * SOFTWARE.
24 *
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.
29 */
30
31/*
32 * mapdesc.h
33 *
34 */
35
36#ifndef __glumapdesc_h_
37#define __glumapdesc_h_
38
39//#include "mystdio.h"
40#include "types.h"
41#include "defines.h"
42#include "bufpool.h"
43#include "nurbsconsts.h"
44
46
47class Backend;
48
49class Mapdesc : public PooledObj {
50 friend class Maplist;
51
52public:
53 Mapdesc( long, int, int, Backend & );
54 int isProperty( long );
55 REAL getProperty( long );
56 void setProperty( long, REAL );
57 int isConstantSampling( void );
58 int isDomainSampling( void );
59 int isRangeSampling( void );
60 int isSampling( void );
62 int isObjectSpaceParaSampling( void );
63 int isObjectSpacePathSampling( void );
64 int isSurfaceAreaSampling( void );
65 int isPathLengthSampling( void );
66 int isCulling( void );
67 int isBboxSubdividing( void );
68 long getType( void );
69
70 /* curve routines */
71 void subdivide( REAL *, REAL *, REAL, int, int );
72 int cullCheck( REAL *, int, int );
73 void xformBounding( REAL *, int, int, REAL *, int );
74 void xformCulling( REAL *, int, int, REAL *, int );
75 void xformSampling( REAL *, int, int, REAL *, int );
76 void xformMat( Maxmatrix, REAL *, int, int, REAL *, int );
77 REAL calcPartialVelocity ( REAL *, int, int, int, REAL );
78 int project( REAL *, int, REAL *, int, int );
79 REAL calcVelocityRational( REAL *, int, int );
80 REAL calcVelocityNonrational( REAL *, int, int );
81
82 /* surface routines */
83 void subdivide( REAL *, REAL *, REAL, int, int, int, int );
84 int cullCheck( REAL *, int, int, int, int );
85 void xformBounding( REAL *, int, int, int, int, REAL *, int, int );
86 void xformCulling( REAL *, int, int, int, int, REAL *, int, int );
87 void xformSampling( REAL *, int, int, int, int, REAL *, int, int );
88 void xformMat( Maxmatrix, REAL *, int, int, int, int, REAL *, int, int );
89 REAL calcPartialVelocity ( REAL *, REAL *, int, int, int, int, int, int, REAL, REAL, int );
90 int project( REAL *, int, int, REAL *, int, int, int, int);
91 void surfbbox( REAL bb[2][MAXCOORDS] );
92
93 int bboxTooBig( REAL *, int, int, int, int, REAL [2][MAXCOORDS] );
94 int xformAndCullCheck( REAL *, int, int, int, int );
95
97 void setBboxsize( INREAL *);
98 inline void setBmat( INREAL*, long, long );
99 inline void setCmat( INREAL*, long, long );
100 inline void setSmat( INREAL*, long, long );
101 inline int isRational( void );
102 inline int getNcoords( void );
103
104 REAL pixel_tolerance; /* pathlength sampling tolerance */
105 REAL error_tolerance; /* parametric error sampling tolerance*/
106 REAL object_space_error_tolerance; /* object space tess*/
113
114private:
115 long type;
120 int mask;
124 REAL s_steps; /* max samples in s direction */
125 REAL t_steps; /* max samples in t direction */
127 REAL culling_method; /* check for culling */
131
132 void bbox( REAL [2][MAXCOORDS], REAL *, int, int, int, int );
133 REAL maxDifference( int, REAL *, int );
134 static void copy( Maxmatrix, long, INREAL *, long, long );
135
136 /* individual control point routines */
137 static void transform4d( float[4], float[4], float[4][4] );
138 static void multmatrix4d ( float[4][4], const float[4][4],
139 const float[4][4] );
140 void copyPt( REAL *, REAL * );
141 void sumPt( REAL *, REAL *, REAL *, REAL, REAL );
142 void xformSampling( REAL *, REAL * );
143 void xformCulling( REAL *, REAL * );
144 void xformRational( Maxmatrix, REAL *, REAL * );
145 void xformNonrational( Maxmatrix, REAL *, REAL * );
146 unsigned int clipbits( REAL * );
147};
148
149inline void
150Mapdesc::setBmat( INREAL *mat, long rstride, long cstride )
151{
152 copy( bmat, hcoords, mat, rstride, cstride );
153}
154
155inline void
156Mapdesc::setCmat( INREAL *mat, long rstride, long cstride )
157{
158 copy( cmat, hcoords, mat, rstride, cstride );
159}
160
161inline void
162Mapdesc::setSmat( INREAL *mat, long rstride, long cstride )
163{
164 copy( smat, hcoords, mat, rstride, cstride );
165}
166
167inline long
169{
170 return type;
171}
172
173inline void
175{
176 if( isrational )
177 xformRational( cmat, d, s );
178 else
180}
181
182inline void
184{
185 if( isrational )
186 xformRational( smat, d, s );
187 else
189}
190
191inline int
193{
194 return isrational ? 1 : 0;
195}
196
197inline int
199{
200 return ncoords;
201}
202
203inline int
205{
206 return ((sampling_method == N_FIXEDRATE) ? 1 : 0);
207}
208
209inline int
211{
212 return ((sampling_method == N_DOMAINDISTANCE) ? 1 : 0);
213}
214
215inline int
217{
218 return ((sampling_method == N_PARAMETRICDISTANCE) ? 1 : 0);
219}
220
221inline int
223{
224 return ((sampling_method == N_OBJECTSPACE_PARA) ? 1 : 0);
225}
226
227inline int
229{
230 return ((sampling_method == N_OBJECTSPACE_PATH) ? 1 : 0);
231}
232
233inline int
235{
236 return ((sampling_method == N_SURFACEAREA) ? 1 : 0);
237}
238
239inline int
241{
242 return ((sampling_method == N_PATHLENGTH) ? 1 : 0);
243}
244
245inline int
247{
252}
253
254inline int
256{
258}
259
260inline int
262{
263 return ((culling_method != N_NOCULLING) ? 1 : 0);
264}
265
266inline int
268{
269 return ((bbox_subdividing != N_NOBBOXSUBDIVISION) ? 1 : 0);
270}
271#endif /* __glumapdesc_h_ */
REAL sampling_method
Definition: mapdesc.h:126
REAL calcPartialVelocity(REAL *, int, int, int, REAL)
Definition: mapdescv.cc:54
Mapdesc * next
Definition: mapdesc.h:129
REAL object_space_error_tolerance
Definition: mapdesc.h:106
int isObjectSpaceParaSampling(void)
Definition: mapdesc.h:222
REAL clampfactor
Definition: mapdesc.h:107
void xformCulling(REAL *, int, int, REAL *, int)
Definition: mapdesc.cc:472
int isRational(void)
Definition: mapdesc.h:192
static void multmatrix4d(float[4][4], const float[4][4], const float[4][4])
void setBboxsize(INREAL *)
Definition: mapdesc.cc:84
REAL pixel_tolerance
Definition: mapdesc.h:104
void xformRational(Maxmatrix, REAL *, REAL *)
Definition: mapdesc.cc:287
void xformNonrational(Maxmatrix, REAL *, REAL *)
Definition: mapdesc.cc:321
int isConstantSampling(void)
Definition: mapdesc.h:204
int ncoords
Definition: mapdesc.h:117
int isCulling(void)
Definition: mapdesc.h:261
void copyPt(REAL *, REAL *)
Definition: mapdesc.cc:119
REAL minsavings
Definition: mapdesc.h:108
int isObjectSpacePathSampling(void)
Definition: mapdesc.h:228
int isBboxSubdividing(void)
Definition: mapdesc.h:267
REAL bbox_subdividing
Definition: mapdesc.h:128
REAL s_steps
Definition: mapdesc.h:124
REAL culling_method
Definition: mapdesc.h:127
void subdivide(REAL *, REAL *, REAL, int, int)
Definition: mapdesc.cc:577
REAL maxrate
Definition: mapdesc.h:109
Maxmatrix smat
Definition: mapdesc.h:123
void setBmat(INREAL *, long, long)
Definition: mapdesc.h:150
long getType(void)
Definition: mapdesc.h:168
Backend & backend
Definition: mapdesc.h:130
int isDomainSampling(void)
Definition: mapdesc.h:210
Maxmatrix bmat
Definition: mapdesc.h:121
int isParametricDistanceSampling(void)
Definition: mapdesc.h:216
REAL bboxsize[MAXCOORDS]
Definition: mapdesc.h:112
int cullCheck(REAL *, int, int)
Definition: mapdesc.cc:425
REAL maxsrate
Definition: mapdesc.h:110
int isSampling(void)
Definition: mapdesc.h:255
void identify(REAL[MAXCOORDS][MAXCOORDS])
Definition: mapdesc.cc:91
void sumPt(REAL *, REAL *, REAL *, REAL, REAL)
Definition: mapdesc.cc:159
long type
Definition: mapdesc.h:115
int getNcoords(void)
Definition: mapdesc.h:198
Maxmatrix cmat
Definition: mapdesc.h:122
int xformAndCullCheck(REAL *, int, int, int, int)
Definition: mapdesc.cc:355
int hcoords
Definition: mapdesc.h:118
void xformBounding(REAL *, int, int, REAL *, int)
Definition: mapdesc.cc:460
int isrational
Definition: mapdesc.h:116
unsigned int clipbits(REAL *)
Definition: mapdesc.cc:202
int inhcoords
Definition: mapdesc.h:119
static void copy(Maxmatrix, long, INREAL *, long, long)
Definition: mapdesc.cc:105
void xformMat(Maxmatrix, REAL *, int, int, REAL *, int)
Definition: mapdesc.cc:517
void setSmat(INREAL *, long, long)
Definition: mapdesc.h:162
int isProperty(long)
Definition: mapdesc.cc:750
REAL calcVelocityNonrational(REAL *, int, int)
Definition: mapdesc.cc:744
int isRangeSampling(void)
Definition: mapdesc.h:246
REAL getProperty(long)
Definition: mapdesc.cc:769
static void transform4d(float[4], float[4], float[4][4])
int project(REAL *, int, REAL *, int, int)
Definition: mapdesc.cc:647
int isPathLengthSampling(void)
Definition: mapdesc.h:240
REAL t_steps
Definition: mapdesc.h:125
void xformSampling(REAL *, int, int, REAL *, int)
Definition: mapdesc.cc:454
REAL maxDifference(int, REAL *, int)
int isSurfaceAreaSampling(void)
Definition: mapdesc.h:234
void setCmat(INREAL *, long, long)
Definition: mapdesc.h:156
void surfbbox(REAL bb[2][MAXCOORDS])
Definition: mapdesc.cc:99
REAL maxtrate
Definition: mapdesc.h:111
void setProperty(long, REAL)
Definition: mapdesc.cc:797
REAL calcVelocityRational(REAL *, int, int)
Definition: mapdesc.cc:723
REAL error_tolerance
Definition: mapdesc.h:105
int mask
Definition: mapdesc.h:120
int bboxTooBig(REAL *, int, int, int, int, REAL[2][MAXCOORDS])
Definition: mapdesc.cc:663
#define MAXCOORDS
Definition: defines.h:48
#define INREAL
Definition: types.h:40
float REAL
Definition: types.h:41
FT_BBox bbox
Definition: ftbbox.c:446
GLdouble s
Definition: gl.h:2039
#define d
Definition: ke_i.h:81
REAL Maxmatrix[MAXCOORDS][MAXCOORDS]
Definition: mapdesc.h:45
static const MAT2 mat
Definition: font.c:66
#define N_PATHLENGTH
Definition: nurbsconsts.h:59
#define N_OBJECTSPACE_PARA
Definition: nurbsconsts.h:61
#define N_OBJECTSPACE_PATH
Definition: nurbsconsts.h:62
#define N_PARAMETRICDISTANCE
Definition: nurbsconsts.h:58
#define N_NOBBOXSUBDIVISION
Definition: nurbsconsts.h:64
#define N_DOMAINDISTANCE
Definition: nurbsconsts.h:57
#define N_SURFACEAREA
Definition: nurbsconsts.h:60
#define N_NOCULLING
Definition: nurbsconsts.h:52
#define N_FIXEDRATE
Definition: nurbsconsts.h:56