36 #ifndef __glumapdesc_h_
37 #define __glumapdesc_h_
43 #include "nurbsconsts.h"
45 typedef REAL Maxmatrix[MAXCOORDS][MAXCOORDS];
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 );
61 int isParametricDistanceSampling(
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 );
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 );
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] );
93 int bboxTooBig( REAL *,
int,
int,
int,
int, REAL [2][MAXCOORDS] );
94 int xformAndCullCheck( REAL *,
int,
int,
int,
int );
96 void identify( REAL[MAXCOORDS][MAXCOORDS] );
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 );
104 REAL pixel_tolerance;
105 REAL error_tolerance;
106 REAL object_space_error_tolerance;
112 REAL bboxsize[MAXCOORDS];
126 REAL sampling_method;
128 REAL bbox_subdividing;
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 );
137 static void transform4d(
float[4],
float[4],
float[4][4] );
138 static void multmatrix4d (
float[4][4],
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 * );
150 Mapdesc::setBmat( INREAL *mat,
long rstride,
long cstride )
152 copy( bmat, hcoords, mat, rstride, cstride );
156 Mapdesc::setCmat( INREAL *mat,
long rstride,
long cstride )
158 copy( cmat, hcoords, mat, rstride, cstride );
162 Mapdesc::setSmat( INREAL *mat,
long rstride,
long cstride )
164 copy( smat, hcoords, mat, rstride, cstride );
168 Mapdesc::getType(
void )
174 Mapdesc::xformCulling( REAL *d, REAL *s )
177 xformRational( cmat, d, s );
179 xformNonrational( cmat, d, s );
183 Mapdesc::xformSampling( REAL *d, REAL *s )
186 xformRational( smat, d, s );
188 xformNonrational( smat, d, s );
192 Mapdesc::isRational(
void )
194 return isrational ? 1 : 0;
198 Mapdesc::getNcoords(
void )
204 Mapdesc::isConstantSampling(
void )
206 return ((sampling_method == N_FIXEDRATE) ? 1 : 0);
210 Mapdesc::isDomainSampling(
void )
212 return ((sampling_method == N_DOMAINDISTANCE) ? 1 : 0);
216 Mapdesc::isParametricDistanceSampling(
void )
218 return ((sampling_method == N_PARAMETRICDISTANCE) ? 1 : 0);
222 Mapdesc::isObjectSpaceParaSampling(
void )
224 return ((sampling_method == N_OBJECTSPACE_PARA) ? 1 : 0);
228 Mapdesc::isObjectSpacePathSampling(
void )
230 return ((sampling_method == N_OBJECTSPACE_PATH) ? 1 : 0);
234 Mapdesc::isSurfaceAreaSampling(
void )
236 return ((sampling_method == N_SURFACEAREA) ? 1 : 0);
240 Mapdesc::isPathLengthSampling(
void )
242 return ((sampling_method == N_PATHLENGTH) ? 1 : 0);
246 Mapdesc::isRangeSampling(
void )
248 return ( isParametricDistanceSampling() || isPathLengthSampling() ||
249 isSurfaceAreaSampling() ||
250 isObjectSpaceParaSampling() ||
251 isObjectSpacePathSampling());
255 Mapdesc::isSampling(
void )
257 return isRangeSampling() || isConstantSampling() || isDomainSampling();
261 Mapdesc::isCulling(
void )
263 return ((culling_method != N_NOCULLING) ? 1 : 0);
267 Mapdesc::isBboxSubdividing(
void )
269 return ((bbox_subdividing != N_NOBBOXSUBDIVISION) ? 1 : 0);