ReactOS 0.4.15-dev-7887-g64a59a1
Mapdesc Class Reference

#include <mapdesc.h>

Inheritance diagram for Mapdesc:
Collaboration diagram for Mapdesc:

Public Member Functions

 Mapdesc (long, int, int, Backend &)
 
int isProperty (long)
 
REAL getProperty (long)
 
void setProperty (long, REAL)
 
int isConstantSampling (void)
 
int isDomainSampling (void)
 
int isRangeSampling (void)
 
int isSampling (void)
 
int isParametricDistanceSampling (void)
 
int isObjectSpaceParaSampling (void)
 
int isObjectSpacePathSampling (void)
 
int isSurfaceAreaSampling (void)
 
int isPathLengthSampling (void)
 
int isCulling (void)
 
int isBboxSubdividing (void)
 
long getType (void)
 
void subdivide (REAL *, REAL *, REAL, int, int)
 
int cullCheck (REAL *, int, int)
 
void xformBounding (REAL *, int, int, REAL *, int)
 
void xformCulling (REAL *, int, int, REAL *, int)
 
void xformSampling (REAL *, int, int, REAL *, int)
 
void xformMat (Maxmatrix, REAL *, int, int, REAL *, int)
 
REAL calcPartialVelocity (REAL *, int, int, int, REAL)
 
int project (REAL *, int, REAL *, int, int)
 
REAL calcVelocityRational (REAL *, int, int)
 
REAL calcVelocityNonrational (REAL *, int, int)
 
void subdivide (REAL *, REAL *, REAL, int, int, int, int)
 
int cullCheck (REAL *, int, int, int, int)
 
void xformBounding (REAL *, int, int, int, int, REAL *, int, int)
 
void xformCulling (REAL *, int, int, int, int, REAL *, int, int)
 
void xformSampling (REAL *, int, int, int, int, REAL *, int, int)
 
void xformMat (Maxmatrix, REAL *, int, int, int, int, REAL *, int, int)
 
REAL calcPartialVelocity (REAL *, REAL *, int, int, int, int, int, int, REAL, REAL, int)
 
int project (REAL *, int, int, REAL *, int, int, int, int)
 
void surfbbox (REAL bb[2][MAXCOORDS])
 
int bboxTooBig (REAL *, int, int, int, int, REAL[2][MAXCOORDS])
 
int xformAndCullCheck (REAL *, int, int, int, int)
 
void identify (REAL[MAXCOORDS][MAXCOORDS])
 
void setBboxsize (INREAL *)
 
void setBmat (INREAL *, long, long)
 
void setCmat (INREAL *, long, long)
 
void setSmat (INREAL *, long, long)
 
int isRational (void)
 
int getNcoords (void)
 
- Public Member Functions inherited from PooledObj
voidoperator new (size_t, Pool &)
 
voidoperator new (size_t, void *)
 
voidoperator new (size_t s)
 
void operator delete (void *)
 
void operator delete (void *, Pool &)
 
void deleteMe (Pool &)
 

Public Attributes

REAL pixel_tolerance
 
REAL error_tolerance
 
REAL object_space_error_tolerance
 
REAL clampfactor
 
REAL minsavings
 
REAL maxrate
 
REAL maxsrate
 
REAL maxtrate
 
REAL bboxsize [MAXCOORDS]
 

Private Member Functions

void bbox (REAL[2][MAXCOORDS], REAL *, int, int, int, int)
 
REAL maxDifference (int, REAL *, int)
 
void copyPt (REAL *, REAL *)
 
void sumPt (REAL *, REAL *, REAL *, REAL, REAL)
 
void xformSampling (REAL *, REAL *)
 
void xformCulling (REAL *, REAL *)
 
void xformRational (Maxmatrix, REAL *, REAL *)
 
void xformNonrational (Maxmatrix, REAL *, REAL *)
 
unsigned int clipbits (REAL *)
 

Static Private Member Functions

static void copy (Maxmatrix, long, INREAL *, long, long)
 
static void transform4d (float[4], float[4], float[4][4])
 
static void multmatrix4d (float[4][4], const float[4][4], const float[4][4])
 

Private Attributes

long type
 
int isrational
 
int ncoords
 
int hcoords
 
int inhcoords
 
int mask
 
Maxmatrix bmat
 
Maxmatrix cmat
 
Maxmatrix smat
 
REAL s_steps
 
REAL t_steps
 
REAL sampling_method
 
REAL culling_method
 
REAL bbox_subdividing
 
Mapdescnext
 
Backendbackend
 

Friends

class Maplist
 

Detailed Description

Definition at line 49 of file mapdesc.h.

Constructor & Destructor Documentation

◆ Mapdesc()

Mapdesc::Mapdesc ( long  _type,
int  _israt,
int  _ncoords,
Backend b 
)

Definition at line 50 of file mapdesc.cc.

51 : backend( b )
52{
53 type = _type;
54 isrational = _israt;
55 ncoords = _ncoords;
56 hcoords = _ncoords + (_israt ? 0 : 1 );
57 inhcoords = _ncoords - (_israt ? 1 : 0 );
58 mask = ((1<<(inhcoords*2))-1);
59 next = 0;
60
62 assert( inhcoords >= 1 );
63
64 pixel_tolerance = 1.0;
65 error_tolerance = 1.0;
71 s_steps = 0.0;
72 t_steps = 0.0;
73 maxrate = ( s_steps < 0.0 ) ? 0.0 : s_steps;
74 maxsrate = ( s_steps < 0.0 ) ? 0.0 : s_steps;
75 maxtrate = ( t_steps < 0.0 ) ? 0.0 : t_steps;
76 identify( bmat );
77 identify( cmat );
78 identify( smat );
79 for( int i = 0; i != inhcoords; i++ )
80 bboxsize[i] = 1.0;
81}
REAL sampling_method
Definition: mapdesc.h:126
Mapdesc * next
Definition: mapdesc.h:129
REAL clampfactor
Definition: mapdesc.h:107
REAL pixel_tolerance
Definition: mapdesc.h:104
int ncoords
Definition: mapdesc.h:117
REAL minsavings
Definition: mapdesc.h:108
REAL bbox_subdividing
Definition: mapdesc.h:128
REAL s_steps
Definition: mapdesc.h:124
REAL culling_method
Definition: mapdesc.h:127
REAL maxrate
Definition: mapdesc.h:109
Maxmatrix smat
Definition: mapdesc.h:123
Backend & backend
Definition: mapdesc.h:130
Maxmatrix bmat
Definition: mapdesc.h:121
REAL bboxsize[MAXCOORDS]
Definition: mapdesc.h:112
REAL maxsrate
Definition: mapdesc.h:110
void identify(REAL[MAXCOORDS][MAXCOORDS])
Definition: mapdesc.cc:91
Maxmatrix cmat
Definition: mapdesc.h:122
int hcoords
Definition: mapdesc.h:118
int isrational
Definition: mapdesc.h:116
int inhcoords
Definition: mapdesc.h:119
REAL t_steps
Definition: mapdesc.h:125
REAL maxtrate
Definition: mapdesc.h:111
REAL error_tolerance
Definition: mapdesc.h:105
#define MAXCOORDS
Definition: defines.h:48
#define assert(x)
Definition: debug.h:53
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
GLenum GLint GLuint mask
Definition: glext.h:6028
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define N_NOSAVINGSSUBDIVISION
Definition: nurbsconsts.h:47
#define N_NOCLAMPING
Definition: nurbsconsts.h:45
#define N_NOSAMPLING
Definition: nurbsconsts.h:55
#define N_NOBBOXSUBDIVISION
Definition: nurbsconsts.h:64
#define N_NOCULLING
Definition: nurbsconsts.h:52

Member Function Documentation

◆ bbox()

void Mapdesc::bbox ( REAL  bb[2][MAXCOORDS],
REAL p,
int  rstride,
int  cstride,
int  nrows,
int  ncols 
)
private

Definition at line 696 of file mapdesc.cc.

703{
704 int k;
705 for( k=0; k != inhcoords; k++ )
706 bb[0][k] = bb[1][k] = p[k];
707
708 for( int i=0; i != nrows; i++ )
709 for( int j=0; j != ncols; j++ )
710 for( k=0; k != inhcoords; k++ ) {
711 REAL x = p[i*rstride + j*cstride + k];
712 if( x < bb[0][k] ) bb[0][k] = x;
713 else if( x > bb[1][k] ) bb[1][k] = x;
714 }
715}
float REAL
Definition: types.h:41
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
GLfloat GLfloat p
Definition: glext.h:8902
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
Definition: glfuncs.h:250
int k
Definition: mpi.c:3369

◆ bboxTooBig()

int Mapdesc::bboxTooBig ( REAL p,
int  rstride,
int  cstride,
int  nrows,
int  ncols,
REAL  bb[2][MAXCOORDS] 
)

Definition at line 663 of file mapdesc.cc.

670{
672 const int trstride = sizeof(bbpts[0]) / sizeof(REAL);
673 const int tcstride = sizeof(bbpts[0][0]) / sizeof(REAL);
674
675 // points have been transformed, therefore they are homogeneous
676 // project points
677 int val = project( p, rstride, cstride,
678 &bbpts[0][0][0], trstride, tcstride, nrows, ncols );
679 if( val == 0 ) return -1;
680
681 // compute bounding box
682 bbox( bb, &bbpts[0][0][0], trstride, tcstride, nrows, ncols );
683
684 // find out if bounding box can't fit in unit cube
686 for( int k=0; k != inhcoords; k++ )
687 if( ceilf(bb[1][k]) - floorf(bb[0][k]) > bboxsize[k] ) return 1;
688 } else {
689 for( int k=0; k != inhcoords; k++ )
690 if( bb[1][k] - bb[0][k] > bboxsize[k] ) return 1;
691 }
692 return 0;
693}
int project(REAL *, int, REAL *, int, int)
Definition: mapdesc.cc:647
#define MAXORDER
Definition: defines.h:45
FT_BBox bbox
Definition: ftbbox.c:446
GLuint GLfloat * val
Definition: glext.h:7180
#define ceilf(x)
Definition: mymath.h:62
#define floorf(x)
Definition: mymath.h:65
#define N_BBOXROUND
Definition: nurbsconsts.h:66

Referenced by Patch::checkBboxConstraint().

◆ calcPartialVelocity() [1/2]

REAL Mapdesc::calcPartialVelocity ( REAL p,
int  stride,
int  ncols,
int  partial,
REAL  range 
)

Definition at line 54 of file mapdescv.cc.

60{
62 REAL mag[MAXORDER];
63
64 assert( ncols <= MAXORDER );
65
66 int j, k, t;
67 // copy inhomogeneous control points into temporary array
68 for( j=0; j != ncols; j++ )
69 for( k=0; k != inhcoords; k++ )
70 tmp[j][k] = p[j*stride + k];
71
72 for( t=0; t != partial; t++ )
73 for( j=0; j != ncols-t-1; j++ )
74 for( k=0; k != inhcoords; k++ )
75 tmp[j][k] = tmp[j+1][k] - tmp[j][k];
76
77 // compute magnitude and store in mag array
78 for( j=0; j != ncols-partial; j++ ) {
79 mag[j] = 0.0;
80 for( k=0; k != inhcoords; k++ )
81 mag[j] += tmp[j][k] * tmp[j][k];
82 }
83
84 // compute scale factor
85 REAL fac = 1;
86 REAL invt = 1.0 / range;
87 for( t = ncols-1; t != ncols-1-partial; t-- )
88 fac *= t * invt;
89
90 // compute max magnitude of all entries in array
91 REAL max = 0.0;
92 for( j=0; j != ncols-partial; j++ )
93 if( mag[j] > max ) max = mag[j];
94 max = fac * sqrtf( (float) max );
95
96 return max;
97}
GLdouble GLdouble t
Definition: gl.h:2047
GLsizei stride
Definition: glext.h:5848
GLenum GLint * range
Definition: glext.h:7539
#define sqrtf(x)
Definition: mymath.h:59
#define max(a, b)
Definition: svc.c:63

Referenced by calcVelocityNonrational(), calcVelocityRational(), Curve::getstepsize(), and Patch::getstepsize().

◆ calcPartialVelocity() [2/2]

REAL Mapdesc::calcPartialVelocity ( REAL dist,
REAL p,
int  rstride,
int  cstride,
int  nrows,
int  ncols,
int  spartial,
int  tpartial,
REAL  srange,
REAL  trange,
int  side 
)

Definition at line 105 of file mapdescv.cc.

117{
119 REAL mag[MAXORDER][MAXORDER];
120
121 assert( nrows <= MAXORDER );
122 assert( ncols <= MAXORDER );
123
124 REAL *tp = &tmp[0][0][0];
125 REAL *mp = &mag[0][0];
126 const int istride = sizeof( tmp[0]) / sizeof( tmp[0][0][0] );
127 const int jstride = sizeof( tmp[0][0]) / sizeof( tmp[0][0][0] );
128 /*
129 const int kstride = sizeof( tmp[0][0][0]) / sizeof( tmp[0][0][0] );
130 */
131 const int mistride = sizeof( mag[0]) / sizeof( mag[0][0] );
132 const int mjstride = sizeof( mag[0][0]) / sizeof( mag[0][0] );
133 const int idist = nrows * istride;
134 const int jdist = ncols * jstride;
135 /*
136 const int kdist = inhcoords * kstride;
137 */
138 const int id = idist - spartial * istride;
139 const int jd = jdist - tpartial * jstride;
140
141 {
142 // copy control points
143 REAL *ti = tp;
144 REAL *qi = p;
145 REAL *til = tp + idist;
146 for( ; ti != til; ) {
147 REAL *tj = ti;
148 REAL *qj = qi;
149 REAL *tjl = ti + jdist;
150 for( ; tj != tjl; ) {
151 for( int k=0; k != inhcoords; k++ ) {
152 tj[k] = qj[k];
153 }
154 tj += jstride;
155 qj += cstride;
156 }
157 ti += istride;
158 qi += rstride;
159 }
160 }
161
162 {
163 // compute (s)-partial derivative control points
164 REAL *til = tp + idist - istride;
165 const REAL *till = til - ( spartial * istride );
166 for( ; til != till; til -= istride )
167 for( REAL *ti = tp; ti != til; ti += istride )
168 for( REAL *tj = ti, *tjl = tj + jdist; tj != tjl; tj += jstride )
169 for( int k=0; k != inhcoords; k++ )
170 tj[k] = tj[k+istride] - tj[k];
171 }
172
173 {
174 // compute (s,t)-partial derivative control points
175 REAL *tjl = tp + jdist - jstride;
176 const REAL *tjll = tjl - ( tpartial * jstride );
177 for( ; tjl != tjll; tjl -= jstride )
178 for( REAL *tj = tp; tj != tjl; tj += jstride )
179 for( REAL *ti = tj, *til = ti + id; ti != til; ti += istride )
180 for( int k=0; k != inhcoords; k++ )
181 ti[k] = ti[k+jstride] - ti[k];
182
183 }
184
185 REAL max = 0.0;
186 {
187 // compute magnitude and store in mag array
188 memset( (void *) mp, 0, sizeof( mag ) );
189 for( REAL *ti = tp, *mi = mp, *til = tp + id; ti != til; ti += istride, mi += mistride )
190 for( REAL *tj = ti, *mj = mi, *tjl = ti + jd; tj != tjl; tj += jstride, mj += mjstride ) {
191 for( int k=0; k != inhcoords; k++ )
192 *mj += tj[k] * tj[k];
193 if( *mj > max ) max = *mj;
194 }
195
196 }
197
198 int i, j;
199
200 // compute scale factor
201 REAL fac = 1.0;
202 {
203 REAL invs = 1.0 / srange;
204 REAL invt = 1.0 / trange;
205 for( int s = nrows-1, slast = s-spartial; s != slast; s-- )
206 fac *= s * invs;
207 for( int t = ncols-1, tlast = t-tpartial; t != tlast; t-- )
208 fac *= t * invt;
209 }
210
211 if( side == 0 ) {
212 // compute max magnitude of first and last column
213 dist[0] = 0.0;
214 dist[1] = 0.0;
215 for( i=0; i != nrows-spartial; i++ ) {
216 j = 0;
217 if( mag[i][j] > dist[0] ) dist[0] = mag[i][j];
218
219 j = ncols-tpartial-1;
220 if( mag[i][j] > dist[1] ) dist[1] = mag[i][j];
221 }
222 dist[0] = fac * sqrtf( dist[0] );
223 dist[1] = fac * sqrtf( dist[1] );
224 } else if( side == 1 ) {
225 // compute max magnitude of first and last row
226 dist[0] = 0.0;
227 dist[1] = 0.0;
228 for( j=0; j != ncols-tpartial; j++ ) {
229 i = 0;
230 if( mag[i][j] > dist[0] ) dist[0] = mag[i][j];
231
232 i = nrows-spartial-1;
233 if( mag[i][j] > dist[1] ) dist[1] = mag[i][j];
234 }
235 dist[0] = fac * sqrtf( dist[0] );
236 dist[1] = fac * sqrtf( dist[1] );
237 }
238
239 max = fac * sqrtf( (float) max );
240
241 return max;
242}
_In_ uint64_t _In_ uint64_t _In_ uint64_t _In_opt_ traverse_ptr * tp
Definition: btrfs.c:2996
GLdouble s
Definition: gl.h:2039
#define memset(x, y, z)
Definition: compat.h:39
static MONITORINFO mi
Definition: win.c:7338

◆ calcVelocityNonrational()

REAL Mapdesc::calcVelocityNonrational ( REAL pts,
int  stride,
int  ncols 
)

Definition at line 744 of file mapdesc.cc.

745{
746 return calcPartialVelocity( pts, stride, ncols, 1, 1.0 );
747}
REAL calcPartialVelocity(REAL *, int, int, int, REAL)
Definition: mapdescv.cc:54

Referenced by Subdivider::tessellate().

◆ calcVelocityRational()

REAL Mapdesc::calcVelocityRational ( REAL p,
int  stride,
int  ncols 
)

Definition at line 723 of file mapdesc.cc.

724{
725 REAL tmp[MAXORDER][MAXCOORDS];
726
727 assert( ncols <= MAXORDER );
728
729 const int tstride = sizeof(tmp[0]) / sizeof(REAL);
730
731 if( project( p, stride, &tmp[0][0], tstride, ncols ) ) {
732 return calcPartialVelocity( &tmp[0][0], tstride, ncols, 1, 1.0 );
733 } else { /* XXX */
734 return calcPartialVelocity( &tmp[0][0], tstride, ncols, 1, 1.0 );
735 }
736}

Referenced by Subdivider::tessellate().

◆ clipbits()

unsigned int Mapdesc::clipbits ( REAL p)
private

Definition at line 202 of file mapdesc.cc.

203{
204 assert( inhcoords >= 0 );
205 assert( inhcoords <= 3 );
206
207 int nc = inhcoords;
208 REAL pw = p[nc];
209 REAL nw = -pw;
210 unsigned int bits = 0;
211
212 if( pw == 0.0 ) return mask;
213
214 if( pw > 0.0 ) {
215 switch( nc ) {
216 case 3:
217 if( p[2] <= pw ) bits |= (1<<5);
218 if( p[2] >= nw ) bits |= (1<<4);
219 if( p[1] <= pw ) bits |= (1<<3);
220 if( p[1] >= nw ) bits |= (1<<2);
221 if( p[0] <= pw ) bits |= (1<<1);
222 if( p[0] >= nw ) bits |= (1<<0);
223 return bits;
224 case 2:
225 if( p[1] <= pw ) bits |= (1<<3);
226 if( p[1] >= nw ) bits |= (1<<2);
227 if( p[0] <= pw ) bits |= (1<<1);
228 if( p[0] >= nw ) bits |= (1<<0);
229 return bits;
230 case 1:
231 if( p[0] <= pw ) bits |= (1<<1);
232 if( p[0] >= nw ) bits |= (1<<0);
233 return bits;
234 default: {
235 int bit = 1;
236 for( int i=0; i<nc; i++ ) {
237 if( p[i] >= nw ) bits |= bit;
238 bit <<= 1;
239 if( p[i] <= pw ) bits |= bit;
240 bit <<= 1;
241 }
242 abort();
243 break;
244 }
245 }
246 } else {
247 switch( nc ) {
248 case 3:
249 if( p[2] <= nw ) bits |= (1<<5);
250 if( p[2] >= pw ) bits |= (1<<4);
251 if( p[1] <= nw ) bits |= (1<<3);
252 if( p[1] >= pw ) bits |= (1<<2);
253 if( p[0] <= nw ) bits |= (1<<1);
254 if( p[0] >= pw ) bits |= (1<<0);
255 return bits;
256 case 2:
257 if( p[1] <= nw ) bits |= (1<<3);
258 if( p[1] >= pw ) bits |= (1<<2);
259 if( p[0] <= nw ) bits |= (1<<1);
260 if( p[0] >= pw ) bits |= (1<<0);
261 return bits;
262 case 1:
263 if( p[0] <= nw ) bits |= (1<<1);
264 if( p[0] >= pw ) bits |= (1<<0);
265 return bits;
266 default: {
267 int bit = 1;
268 for( int i=0; i<nc; i++ ) {
269 if( p[i] >= pw ) bits |= bit;
270 bit <<= 1;
271 if( p[i] <= nw ) bits |= bit;
272 bit <<= 1;
273 }
274 abort();
275 break;
276 }
277 }
278 }
279 return bits;
280}
int mask
Definition: mapdesc.h:120
GLenum GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * bits
Definition: glext.h:10929
#define abort()
Definition: i386-dis.c:34
#define bits
Definition: infblock.c:15

Referenced by cullCheck(), and xformAndCullCheck().

◆ copy()

void Mapdesc::copy ( Maxmatrix  ,
long  ,
INREAL ,
long  ,
long   
)
staticprivate

Definition at line 105 of file mapdesc.cc.

107{
108 assert( n >= 0 );
109 for( int i=0; i != n; i++ )
110 for( int j=0; j != n; j++ )
111 dest[i][j] = src[i*rstride + j*cstride];
112}
GLdouble n
Definition: glext.h:7729
GLenum src
Definition: glext.h:6340
static char * dest
Definition: rtl.c:135

Referenced by setBmat(), setCmat(), and setSmat().

◆ copyPt()

void Mapdesc::copyPt ( REAL d,
REAL s 
)
private

Definition at line 119 of file mapdesc.cc.

120{
121 assert( hcoords > 0 );
122 switch( hcoords ) {
123 case 4:
124 d[3] = s[3];
125 d[2] = s[2];
126 d[1] = s[1];
127 d[0] = s[0];
128 break;
129 case 3:
130 d[2] = s[2];
131 d[1] = s[1];
132 d[0] = s[0];
133 break;
134 case 2:
135 d[1] = s[1];
136 d[0] = s[0];
137 break;
138 case 1:
139 d[0] = s[0];
140 break;
141 case 5:
142 d[4] = s[4];
143 d[3] = s[3];
144 d[2] = s[2];
145 d[1] = s[1];
146 d[0] = s[0];
147 break;
148 default:
149 memcpy( d, s, hcoords * sizeof( REAL ) );
150 break;
151 }
152}
#define d
Definition: ke_i.h:81
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878

Referenced by subdivide().

◆ cullCheck() [1/2]

int Mapdesc::cullCheck ( REAL pts,
int  order,
int  stride 
)

Definition at line 425 of file mapdesc.cc.

426{
427 unsigned int inbits = mask;
428 unsigned int outbits = 0;
429
430 REAL *p = pts;
431 for( REAL *pend = p + order * stride; p != pend; p += stride ) {
432 unsigned int bits = clipbits( p );
433 outbits |= bits;
434 inbits &= bits;
435 if( ( outbits == (unsigned int)mask ) && ( inbits != (unsigned int)mask ) ) return CULL_ACCEPT;
436 }
437
438 if( outbits != (unsigned int)mask ) {
439 return CULL_TRIVIAL_REJECT;
440 } else if( inbits == (unsigned int)mask ) {
441 return CULL_TRIVIAL_ACCEPT;
442 } else {
443 return CULL_ACCEPT;
444 }
445}
unsigned int clipbits(REAL *)
Definition: mapdesc.cc:202
#define CULL_TRIVIAL_ACCEPT
Definition: defines.h:41
#define CULL_ACCEPT
Definition: defines.h:42
#define CULL_TRIVIAL_REJECT
Definition: defines.h:40
GLuint GLdouble GLdouble GLint GLint order
Definition: glext.h:11194

Referenced by Curve::cullCheck(), and Patch::cullCheck().

◆ cullCheck() [2/2]

int Mapdesc::cullCheck ( REAL pts,
int  uorder,
int  ustride,
int  vorder,
int  vstride 
)

Definition at line 393 of file mapdesc.cc.

394{
395 unsigned int inbits = mask;
396 unsigned int outbits = 0;
397
398 REAL *p = pts;
399 for( REAL *pend = p + uorder * ustride; p != pend; p += ustride ) {
400 REAL *q = p;
401 for( REAL *qend = q + vorder * vstride; q != qend; q += vstride ) {
402 unsigned int bits = clipbits( q );
403 outbits |= bits;
404 inbits &= bits;
405 if( ( outbits == (unsigned int)mask ) && ( inbits != (unsigned int)mask ) ) return CULL_ACCEPT;
406 }
407 }
408
409 if( outbits != (unsigned int)mask ) {
410 return CULL_TRIVIAL_REJECT;
411 } else if( inbits == (unsigned int)mask ) {
412 return CULL_TRIVIAL_ACCEPT;
413 } else {
414 return CULL_ACCEPT;
415 }
416}
GLdouble GLdouble GLdouble GLdouble q
Definition: gl.h:2063
GLdouble GLdouble GLint ustride
Definition: glext.h:8308
GLdouble GLdouble GLint GLint uorder
Definition: glext.h:8308
GLdouble GLdouble GLint GLint GLdouble GLdouble GLint GLint vorder
Definition: glext.h:8308
GLdouble GLdouble GLint GLint GLdouble GLdouble GLint vstride
Definition: glext.h:8308

◆ getNcoords()

int Mapdesc::getNcoords ( void  )
inline

Definition at line 198 of file mapdesc.h.

199{
200 return ncoords;
201}

Referenced by NurbsTessellator::nurbscurve(), NurbsTessellator::nurbssurface(), and Quilt::show().

◆ getProperty()

REAL Mapdesc::getProperty ( long  property)

Definition at line 769 of file mapdesc.cc.

770{
771 switch ( property ) {
773 return pixel_tolerance;
775 return error_tolerance;
776 case N_CULLING:
777 return culling_method;
779 return bbox_subdividing;
780 case N_S_STEPS:
781 return s_steps;
782 case N_T_STEPS:
783 return t_steps;
784 case N_SAMPLINGMETHOD:
785 return sampling_method;
786 case N_CLAMPFACTOR:
787 return clampfactor;
788 case N_MINSAVINGS:
789 return minsavings;
790 default:
791 abort();
792 return -1; //not necessary, needed to shut up compiler
793 }
794}
#define N_BBOX_SUBDIVIDING
Definition: nurbsconsts.h:63
#define N_CLAMPFACTOR
Definition: nurbsconsts.h:44
#define N_S_STEPS
Definition: nurbsconsts.h:99
#define N_T_STEPS
Definition: nurbsconsts.h:100
#define N_PIXEL_TOLERANCE
Definition: nurbsconsts.h:89
#define N_ERROR_TOLERANCE
Definition: nurbsconsts.h:90
#define N_MINSAVINGS
Definition: nurbsconsts.h:46
#define N_SAMPLINGMETHOD
Definition: nurbsconsts.h:54
#define N_CULLING
Definition: nurbsconsts.h:51

Referenced by NurbsTessellator::getnurbsproperty(), Curve::getstepsize(), and Patch::getstepsize().

◆ getType()

long Mapdesc::getType ( void  )
inline

Definition at line 168 of file mapdesc.h.

169{
170 return type;
171}
long type
Definition: mapdesc.h:115

Referenced by Quilt::download().

◆ identify()

void Mapdesc::identify ( REAL  dest[MAXCOORDS][MAXCOORDS])

Definition at line 91 of file mapdesc.cc.

92{
93 memset( dest, 0, sizeof( REAL ) * MAXCOORDS * MAXCOORDS );
94 for( int i=0; i != hcoords; i++ )
95 dest[i][i] = 1.0;
96}

Referenced by Mapdesc().

◆ isBboxSubdividing()

int Mapdesc::isBboxSubdividing ( void  )
inline

Definition at line 267 of file mapdesc.h.

268{
269 return ((bbox_subdividing != N_NOBBOXSUBDIVISION) ? 1 : 0);
270}

Referenced by Patch::bbox(), and Patch::Patch().

◆ isConstantSampling()

int Mapdesc::isConstantSampling ( void  )
inline

Definition at line 204 of file mapdesc.h.

205{
206 return ((sampling_method == N_FIXEDRATE) ? 1 : 0);
207}
#define N_FIXEDRATE
Definition: nurbsconsts.h:56

Referenced by Curve::getstepsize(), Patch::getstepsize(), and isSampling().

◆ isCulling()

int Mapdesc::isCulling ( void  )
inline

Definition at line 261 of file mapdesc.h.

262{
263 return ((culling_method != N_NOCULLING) ? 1 : 0);
264}

Referenced by Quilt::isCulled().

◆ isDomainSampling()

int Mapdesc::isDomainSampling ( void  )
inline

Definition at line 210 of file mapdesc.h.

211{
212 return ((sampling_method == N_DOMAINDISTANCE) ? 1 : 0);
213}
#define N_DOMAINDISTANCE
Definition: nurbsconsts.h:57

Referenced by Curve::getstepsize(), Patch::getstepsize(), and isSampling().

◆ isObjectSpaceParaSampling()

int Mapdesc::isObjectSpaceParaSampling ( void  )
inline

Definition at line 222 of file mapdesc.h.

223{
224 return ((sampling_method == N_OBJECTSPACE_PARA) ? 1 : 0);
225}
#define N_OBJECTSPACE_PARA
Definition: nurbsconsts.h:61

Referenced by Patch::getstepsize(), and isRangeSampling().

◆ isObjectSpacePathSampling()

int Mapdesc::isObjectSpacePathSampling ( void  )
inline

Definition at line 228 of file mapdesc.h.

229{
230 return ((sampling_method == N_OBJECTSPACE_PATH) ? 1 : 0);
231}
#define N_OBJECTSPACE_PATH
Definition: nurbsconsts.h:62

Referenced by Patch::getstepsize(), and isRangeSampling().

◆ isParametricDistanceSampling()

int Mapdesc::isParametricDistanceSampling ( void  )
inline

Definition at line 216 of file mapdesc.h.

217{
218 return ((sampling_method == N_PARAMETRICDISTANCE) ? 1 : 0);
219}
#define N_PARAMETRICDISTANCE
Definition: nurbsconsts.h:58

Referenced by Curve::getstepsize(), Patch::getstepsize(), and isRangeSampling().

◆ isPathLengthSampling()

int Mapdesc::isPathLengthSampling ( void  )
inline

Definition at line 240 of file mapdesc.h.

241{
242 return ((sampling_method == N_PATHLENGTH) ? 1 : 0);
243}
#define N_PATHLENGTH
Definition: nurbsconsts.h:59

Referenced by Curve::getstepsize(), Patch::getstepsize(), and isRangeSampling().

◆ isProperty()

int Mapdesc::isProperty ( long  property)

Definition at line 750 of file mapdesc.cc.

751{
752 switch ( property ) {
755 case N_CULLING:
757 case N_S_STEPS:
758 case N_T_STEPS:
759 case N_SAMPLINGMETHOD:
760 case N_CLAMPFACTOR:
761 case N_MINSAVINGS:
762 return 1;
763 default:
764 return 0;
765 }
766}

Referenced by NurbsTessellator::getnurbsproperty(), and NurbsTessellator::setnurbsproperty().

◆ isRangeSampling()

int Mapdesc::isRangeSampling ( void  )
inline

Definition at line 246 of file mapdesc.h.

247{
252}
int isObjectSpaceParaSampling(void)
Definition: mapdesc.h:222
int isObjectSpacePathSampling(void)
Definition: mapdesc.h:228
int isParametricDistanceSampling(void)
Definition: mapdesc.h:216
int isPathLengthSampling(void)
Definition: mapdesc.h:240
int isSurfaceAreaSampling(void)
Definition: mapdesc.h:234

Referenced by isSampling().

◆ isRational()

int Mapdesc::isRational ( void  )
inline

Definition at line 192 of file mapdesc.h.

193{
194 return isrational ? 1 : 0;
195}

Referenced by NurbsTessellator::pwlcurve(), and Subdivider::tessellate().

◆ isSampling()

int Mapdesc::isSampling ( void  )
inline

Definition at line 255 of file mapdesc.h.

256{
258}
int isConstantSampling(void)
Definition: mapdesc.h:204
int isDomainSampling(void)
Definition: mapdesc.h:210
int isRangeSampling(void)
Definition: mapdesc.h:246

◆ isSurfaceAreaSampling()

int Mapdesc::isSurfaceAreaSampling ( void  )
inline

Definition at line 234 of file mapdesc.h.

235{
236 return ((sampling_method == N_SURFACEAREA) ? 1 : 0);
237}
#define N_SURFACEAREA
Definition: nurbsconsts.h:60

Referenced by Patch::getstepsize(), and isRangeSampling().

◆ maxDifference()

REAL Mapdesc::maxDifference ( int  ,
REAL ,
int   
)
private

◆ multmatrix4d()

static void Mapdesc::multmatrix4d ( float  [4][4],
const float  [4][4],
const float  [4][4] 
)
staticprivate

◆ project() [1/2]

int Mapdesc::project ( REAL src,
int  rstride,
int  cstride,
REAL dest,
int  trstride,
int  tcstride,
int  nrows,
int  ncols 
)

Definition at line 620 of file mapdesc.cc.

623{
624 int s = sign( src[inhcoords] );
625 REAL *rlast = src + nrows * rstride;
626 REAL *trptr = dest;
627 for( REAL *rptr=src; rptr != rlast; rptr+=rstride, trptr+=trstride ) {
628 REAL *clast = rptr + ncols * cstride;
629 REAL *tcptr = trptr;
630 for( REAL *cptr = rptr; cptr != clast; cptr+=cstride, tcptr+=tcstride ) {
631 REAL *coordlast = cptr + inhcoords;
632 if( sign( *coordlast ) != s ) return 0;
633 REAL *tcoord = tcptr;
634 for( REAL *coord = cptr; coord != coordlast; coord++, tcoord++ ) {
635 *tcoord = *coord / *coordlast;
636 }
637 }
638 }
639 return 1;
640}
GLuint coord
Definition: glext.h:9511
#define sign(x)
Definition: mapdesc.cc:613

◆ project() [2/2]

int Mapdesc::project ( REAL src,
int  stride,
REAL dest,
int  tstride,
int  ncols 
)

Definition at line 647 of file mapdesc.cc.

648{
649 int s = sign( src[inhcoords] );
650
651 REAL *clast = src + ncols * stride;
652 for( REAL *cptr = src, *tcptr = dest; cptr != clast; cptr+=stride, tcptr+=tstride ) {
653 REAL *coordlast = cptr + inhcoords;
654 if( sign( *coordlast ) != s ) return 0;
655 for( REAL *coord = cptr, *tcoord = tcptr; coord != coordlast; coord++, tcoord++ )
656 *tcoord = *coord / *coordlast;
657 }
658
659 return 1;
660}

Referenced by bboxTooBig(), calcVelocityRational(), Curve::getstepsize(), and Patch::getstepsize().

◆ setBboxsize()

void Mapdesc::setBboxsize ( INREAL mat)

Definition at line 84 of file mapdesc.cc.

85{
86 for( int i = 0; i != inhcoords; i++ )
87 bboxsize[i] = (REAL) mat[i];
88}
static const MAT2 mat
Definition: font.c:66

Referenced by NurbsTessellator::setnurbsproperty().

◆ setBmat()

void Mapdesc::setBmat ( INREAL mat,
long  rstride,
long  cstride 
)
inline

Definition at line 150 of file mapdesc.h.

151{
152 copy( bmat, hcoords, mat, rstride, cstride );
153}
static void copy(Maxmatrix, long, INREAL *, long, long)
Definition: mapdesc.cc:105

Referenced by NurbsTessellator::setnurbsproperty().

◆ setCmat()

void Mapdesc::setCmat ( INREAL mat,
long  rstride,
long  cstride 
)
inline

Definition at line 156 of file mapdesc.h.

157{
158 copy( cmat, hcoords, mat, rstride, cstride );
159}

Referenced by NurbsTessellator::setnurbsproperty().

◆ setProperty()

void Mapdesc::setProperty ( long  property,
REAL  value 
)

Definition at line 797 of file mapdesc.cc.

798{
799
800 switch ( property ) {
803 break;
806 break;
807 case N_CULLING:
809 break;
811 if( value <= 0.0 ) value = N_NOBBOXSUBDIVISION;
813 break;
814 case N_S_STEPS:
815 if( value < 0.0 ) value = 0.0;
816 s_steps = value;
817 maxrate = ( value < 0.0 ) ? 0.0 : value;
818 maxsrate = ( value < 0.0 ) ? 0.0 : value;
819 break;
820 case N_T_STEPS:
821 if( value < 0.0 ) value = 0.0;
822 t_steps = value;
823 maxtrate = ( value < 0.0 ) ? 0.0 : value;
824 break;
825 case N_SAMPLINGMETHOD:
827 break;
828 case N_CLAMPFACTOR:
829 if( value <= 0.0 ) value = N_NOCLAMPING;
831 break;
832 case N_MINSAVINGS:
833 if( value <= 0.0 ) value = N_NOSAVINGSSUBDIVISION;
835 break;
836 default:
837 abort();
838 break;
839 }
840}
Definition: pdh_main.c:94

Referenced by NurbsTessellator::do_setnurbsproperty2().

◆ setSmat()

void Mapdesc::setSmat ( INREAL mat,
long  rstride,
long  cstride 
)
inline

Definition at line 162 of file mapdesc.h.

163{
164 copy( smat, hcoords, mat, rstride, cstride );
165}

Referenced by NurbsTessellator::setnurbsproperty().

◆ subdivide() [1/2]

void Mapdesc::subdivide ( REAL src,
REAL dst,
REAL  v,
int  stride,
int  order 
)

Definition at line 577 of file mapdesc.cc.

578{
579 REAL mv = 1.0 - v;
580
582 copyPt( dst, src );
583 REAL *qpnt = src + stride;
584 for( REAL *qp=src; qpnt!=send; qp=qpnt, qpnt+=stride )
585 sumPt( qp, qp, qpnt, mv, v );
586 }
587}
void copyPt(REAL *, REAL *)
Definition: mapdesc.cc:119
void sumPt(REAL *, REAL *, REAL *, REAL, REAL)
Definition: mapdesc.cc:159
INT WSAAPI send(IN SOCKET s, IN CONST CHAR FAR *buf, IN INT len, IN INT flags)
Definition: send.c:23
const GLdouble * v
Definition: gl.h:2040
GLenum GLenum dst
Definition: glext.h:6340

Referenced by Curve::Curve(), and Patch::Patch().

◆ subdivide() [2/2]

void Mapdesc::subdivide ( REAL src,
REAL dst,
REAL  v,
int  so,
int  ss,
int  to,
int  ts 
)

Definition at line 595 of file mapdesc.cc.

597{
598 REAL mv = 1.0 - v;
599
600 for( REAL *slast = src+ss*so; src != slast; src += ss, dst += ss ) {
601 REAL *sp = src;
602 REAL *dp = dst;
603 for( REAL *send = src+ts*to; sp != send; send -= ts, dp += ts ) {
604 copyPt( dp, sp );
605 REAL *qp = sp;
606 for( REAL *qpnt = sp+ts; qpnt != send; qp = qpnt, qpnt += ts )
607 sumPt( qp, qp, qpnt, mv, v );
608 }
609 }
610}
#define ss
Definition: i386-dis.c:441
static const WCHAR sp[]
Definition: suminfo.c:287

◆ sumPt()

void Mapdesc::sumPt ( REAL dst,
REAL src1,
REAL src2,
REAL  alpha,
REAL  beta 
)
private

Definition at line 159 of file mapdesc.cc.

160{
161 assert( hcoords > 0 );
162 switch( hcoords ) {
163 case 4:
164 dst[3] = src1[3] * alpha + src2[3] * beta;
165 dst[2] = src1[2] * alpha + src2[2] * beta;
166 dst[1] = src1[1] * alpha + src2[1] * beta;
167 dst[0] = src1[0] * alpha + src2[0] * beta;
168 break;
169 case 3:
170 dst[2] = src1[2] * alpha + src2[2] * beta;
171 dst[1] = src1[1] * alpha + src2[1] * beta;
172 dst[0] = src1[0] * alpha + src2[0] * beta;
173 break;
174 case 2:
175 dst[1] = src1[1] * alpha + src2[1] * beta;
176 dst[0] = src1[0] * alpha + src2[0] * beta;
177 break;
178 case 1:
179 dst[0] = src1[0] * alpha + src2[0] * beta;
180 break;
181 case 5:
182 dst[4] = src1[4] * alpha + src2[4] * beta;
183 dst[3] = src1[3] * alpha + src2[3] * beta;
184 dst[2] = src1[2] * alpha + src2[2] * beta;
185 dst[1] = src1[1] * alpha + src2[1] * beta;
186 dst[0] = src1[0] * alpha + src2[0] * beta;
187 break;
188 default: {
189 for( int i = 0; i != hcoords; i++ )
190 dst[i] = src1[i] * alpha + src2[i] * beta;
191 }
192 break;
193 }
194}
GLclampf GLclampf GLclampf alpha
Definition: gl.h:1740

Referenced by subdivide().

◆ surfbbox()

void Mapdesc::surfbbox ( REAL  bb[2][MAXCOORDS])

Definition at line 99 of file mapdesc.cc.

100{
101 backend.surfbbox( type, bb[0], bb[1] );
102}
void surfbbox(long, REAL *, REAL *)
Definition: backend.cc:95

Referenced by Patch::bbox().

◆ transform4d()

static void Mapdesc::transform4d ( float  [4],
float  [4],
float  [4][4] 
)
staticprivate

◆ xformAndCullCheck()

int Mapdesc::xformAndCullCheck ( REAL pts,
int  uorder,
int  ustride,
int  vorder,
int  vstride 
)

Definition at line 355 of file mapdesc.cc.

357{
358 assert( uorder > 0 );
359 assert( vorder > 0 );
360
361 unsigned int inbits = mask;
362 unsigned int outbits = 0;
363
364 REAL *p = pts;
365 for( REAL *pend = p + uorder * ustride; p != pend; p += ustride ) {
366 REAL *q = p;
367 for( REAL *qend = q + vorder * vstride; q != qend; q += vstride ) {
368 REAL cpts[MAXCOORDS];
369 xformCulling( cpts, q );
370 unsigned int bits = clipbits( cpts );
371 outbits |= bits;
372 inbits &= bits;
373 if( ( outbits == (unsigned int)mask ) && ( inbits != (unsigned int)mask ) ) return CULL_ACCEPT;
374 }
375 }
376
377 if( outbits != (unsigned int)mask ) {
378 return CULL_TRIVIAL_REJECT;
379 } else if( inbits == (unsigned int)mask ) {
380 return CULL_TRIVIAL_ACCEPT;
381 } else {
382 return CULL_ACCEPT;
383 }
384}
void xformCulling(REAL *, int, int, REAL *, int)
Definition: mapdesc.cc:472

Referenced by Quilt::isCulled().

◆ xformBounding() [1/2]

void Mapdesc::xformBounding ( REAL pts,
int  uorder,
int  ustride,
int  vorder,
int  vstride,
REAL sp,
int  outustride,
int  outvstride 
)

Definition at line 508 of file mapdesc.cc.

512{
513 xformMat( bmat, pts, uorder, ustride, vorder, vstride, sp, outustride, outvstride );
514}
void xformMat(Maxmatrix, REAL *, int, int, REAL *, int)
Definition: mapdesc.cc:517

◆ xformBounding() [2/2]

void Mapdesc::xformBounding ( REAL pts,
int  order,
int  stride,
REAL sp,
int  outstride 
)

Definition at line 460 of file mapdesc.cc.

461{
462 xformMat( bmat, pts, order, stride, sp, outstride );
463}

◆ xformCulling() [1/3]

void Mapdesc::xformCulling ( REAL pts,
int  uorder,
int  ustride,
int  vorder,
int  vstride,
REAL cp,
int  outustride,
int  outvstride 
)

Definition at line 484 of file mapdesc.cc.

488{
489 xformMat( cmat, pts, uorder, ustride, vorder, vstride, cp, outustride, outvstride );
490}
POINT cp
Definition: magnifier.c:59

◆ xformCulling() [2/3]

void Mapdesc::xformCulling ( REAL pts,
int  order,
int  stride,
REAL cp,
int  outstride 
)

Definition at line 472 of file mapdesc.cc.

473{
474 xformMat( cmat, pts, order, stride, cp, outstride );
475}

Referenced by xformAndCullCheck().

◆ xformCulling() [3/3]

void Mapdesc::xformCulling ( REAL d,
REAL s 
)
inlineprivate

Definition at line 174 of file mapdesc.h.

175{
176 if( isrational )
177 xformRational( cmat, d, s );
178 else
180}
void xformRational(Maxmatrix, REAL *, REAL *)
Definition: mapdesc.cc:287
void xformNonrational(Maxmatrix, REAL *, REAL *)
Definition: mapdesc.cc:321

◆ xformMat() [1/2]

void Mapdesc::xformMat ( Maxmatrix  mat,
REAL pts,
int  uorder,
int  ustride,
int  vorder,
int  vstride,
REAL cp,
int  outustride,
int  outvstride 
)

Definition at line 541 of file mapdesc.cc.

545{
546 if( isrational ) {
547 REAL *pend = pts + uorder * ustride;
548 for( REAL *p = pts ; p != pend; p += ustride ) {
549 REAL *cpts2 = cp;
550 REAL *qend = p + vorder * vstride;
551 for( REAL *q = p; q != qend; q += vstride ) {
552 xformRational( mat, cpts2, q );
553 cpts2 += outvstride;
554 }
555 cp += outustride;
556 }
557 } else {
558 REAL *pend = pts + uorder * ustride;
559 for( REAL *p = pts ; p != pend; p += ustride ) {
560 REAL *cpts2 = cp;
561 REAL *qend = p + vorder * vstride;
562 for( REAL *q = p; q != qend; q += vstride ) {
563 xformNonrational( mat, cpts2, q );
564 cpts2 += outvstride;
565 }
566 cp += outustride;
567 }
568 }
569}

◆ xformMat() [2/2]

void Mapdesc::xformMat ( Maxmatrix  mat,
REAL pts,
int  order,
int  stride,
REAL cp,
int  outstride 
)

Definition at line 517 of file mapdesc.cc.

524{
525 if( isrational ) {
526 REAL *pend = pts + order * stride;
527 for( REAL *p = pts ; p != pend; p += stride ) {
528 xformRational( mat, cp, p );
529 cp += outstride;
530 }
531 } else {
532 REAL *pend = pts + order * stride;
533 for( REAL *p = pts ; p != pend; p += stride ) {
535 cp += outstride;
536 }
537 }
538}

Referenced by xformBounding(), xformCulling(), and xformSampling().

◆ xformNonrational()

void Mapdesc::xformNonrational ( Maxmatrix  mat,
REAL d,
REAL s 
)
private

Definition at line 321 of file mapdesc.cc.

322{
323 if( inhcoords == 2 ) {
324 REAL x = s[0];
325 REAL y = s[1];
326 d[0] = x*mat[0][0]+y*mat[1][0]+mat[2][0];
327 d[1] = x*mat[0][1]+y*mat[1][1]+mat[2][1];
328 d[2] = x*mat[0][2]+y*mat[1][2]+mat[2][2];
329 } else if( inhcoords == 3 ) {
330 REAL x = s[0];
331 REAL y = s[1];
332 REAL z = s[2];
333 d[0] = x*mat[0][0]+y*mat[1][0]+z*mat[2][0]+mat[3][0];
334 d[1] = x*mat[0][1]+y*mat[1][1]+z*mat[2][1]+mat[3][1];
335 d[2] = x*mat[0][2]+y*mat[1][2]+z*mat[2][2]+mat[3][2];
336 d[3] = x*mat[0][3]+y*mat[1][3]+z*mat[2][3]+mat[3][3];
337 } else {
338 assert( inhcoords >= 0 );
339 for( int i=0; i != hcoords; i++ ) {
340 d[i] = mat[inhcoords][i];
341 for( int j = 0; j < inhcoords; j++ )
342 d[i] += s[j] * mat[j][i];
343 }
344 }
345}
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
GLdouble GLdouble z
Definition: glext.h:5874

Referenced by xformCulling(), xformMat(), and xformSampling().

◆ xformRational()

void Mapdesc::xformRational ( Maxmatrix  mat,
REAL d,
REAL s 
)
private

Definition at line 287 of file mapdesc.cc.

288{
289 assert( hcoords >= 0 );
290
291 if( hcoords == 3 ) {
292 REAL x = s[0];
293 REAL y = s[1];
294 REAL z = s[2];
295 d[0] = x*mat[0][0]+y*mat[1][0]+z*mat[2][0];
296 d[1] = x*mat[0][1]+y*mat[1][1]+z*mat[2][1];
297 d[2] = x*mat[0][2]+y*mat[1][2]+z*mat[2][2];
298 } else if( hcoords == 4 ) {
299 REAL x = s[0];
300 REAL y = s[1];
301 REAL z = s[2];
302 REAL w = s[3];
303 d[0] = x*mat[0][0]+y*mat[1][0]+z*mat[2][0]+w*mat[3][0];
304 d[1] = x*mat[0][1]+y*mat[1][1]+z*mat[2][1]+w*mat[3][1];
305 d[2] = x*mat[0][2]+y*mat[1][2]+z*mat[2][2]+w*mat[3][2];
306 d[3] = x*mat[0][3]+y*mat[1][3]+z*mat[2][3]+w*mat[3][3];
307 } else {
308 for( int i=0; i != hcoords; i++ ) {
309 d[i] = 0;
310 for( int j = 0; j != hcoords; j++ )
311 d[i] += s[j] * mat[j][i];
312 }
313 }
314}
GLubyte GLubyte GLubyte GLubyte w
Definition: glext.h:6102

Referenced by xformCulling(), xformMat(), and xformSampling().

◆ xformSampling() [1/3]

void Mapdesc::xformSampling ( REAL pts,
int  uorder,
int  ustride,
int  vorder,
int  vstride,
REAL sp,
int  outustride,
int  outvstride 
)

Definition at line 499 of file mapdesc.cc.

503{
504 xformMat( smat, pts, uorder, ustride, vorder, vstride, sp, outustride, outvstride );
505}

◆ xformSampling() [2/3]

void Mapdesc::xformSampling ( REAL pts,
int  order,
int  stride,
REAL sp,
int  outstride 
)

Definition at line 454 of file mapdesc.cc.

455{
456 xformMat( smat, pts, order, stride, sp, outstride );
457}

◆ xformSampling() [3/3]

void Mapdesc::xformSampling ( REAL d,
REAL s 
)
inlineprivate

Definition at line 183 of file mapdesc.h.

184{
185 if( isrational )
186 xformRational( smat, d, s );
187 else
189}

Friends And Related Function Documentation

◆ Maplist

friend class Maplist
friend

Definition at line 50 of file mapdesc.h.

Member Data Documentation

◆ backend

Backend& Mapdesc::backend
private

Definition at line 130 of file mapdesc.h.

Referenced by surfbbox().

◆ bbox_subdividing

REAL Mapdesc::bbox_subdividing
private

Definition at line 128 of file mapdesc.h.

Referenced by bboxTooBig(), getProperty(), isBboxSubdividing(), Mapdesc(), and setProperty().

◆ bboxsize

REAL Mapdesc::bboxsize[MAXCOORDS]

Definition at line 112 of file mapdesc.h.

Referenced by bboxTooBig(), Mapdesc(), and setBboxsize().

◆ bmat

Maxmatrix Mapdesc::bmat
private

Definition at line 121 of file mapdesc.h.

Referenced by Mapdesc(), setBmat(), and xformBounding().

◆ clampfactor

REAL Mapdesc::clampfactor

Definition at line 107 of file mapdesc.h.

Referenced by Curve::clamp(), Patch::clamp(), getProperty(), Mapdesc(), and setProperty().

◆ cmat

Maxmatrix Mapdesc::cmat
private

Definition at line 122 of file mapdesc.h.

Referenced by Mapdesc(), setCmat(), and xformCulling().

◆ culling_method

REAL Mapdesc::culling_method
private

Definition at line 127 of file mapdesc.h.

Referenced by getProperty(), isCulling(), Mapdesc(), and setProperty().

◆ error_tolerance

REAL Mapdesc::error_tolerance

Definition at line 105 of file mapdesc.h.

Referenced by getProperty(), Mapdesc(), and setProperty().

◆ hcoords

int Mapdesc::hcoords
private

◆ inhcoords

int Mapdesc::inhcoords
private

◆ isrational

int Mapdesc::isrational
private

Definition at line 116 of file mapdesc.h.

Referenced by isRational(), Mapdesc(), xformCulling(), xformMat(), and xformSampling().

◆ mask

int Mapdesc::mask
private

Definition at line 120 of file mapdesc.h.

Referenced by clipbits(), cullCheck(), and xformAndCullCheck().

◆ maxrate

REAL Mapdesc::maxrate

Definition at line 109 of file mapdesc.h.

Referenced by Curve::getstepsize(), Mapdesc(), and setProperty().

◆ maxsrate

REAL Mapdesc::maxsrate

Definition at line 110 of file mapdesc.h.

Referenced by Patch::getstepsize(), Mapdesc(), and setProperty().

◆ maxtrate

REAL Mapdesc::maxtrate

Definition at line 111 of file mapdesc.h.

Referenced by Patch::getstepsize(), Mapdesc(), and setProperty().

◆ minsavings

REAL Mapdesc::minsavings

Definition at line 108 of file mapdesc.h.

Referenced by getProperty(), Patch::getstepsize(), Mapdesc(), and setProperty().

◆ ncoords

int Mapdesc::ncoords
private

Definition at line 117 of file mapdesc.h.

Referenced by getNcoords(), and Mapdesc().

◆ next

Mapdesc* Mapdesc::next
private

Definition at line 129 of file mapdesc.h.

Referenced by Mapdesc().

◆ object_space_error_tolerance

REAL Mapdesc::object_space_error_tolerance

Definition at line 106 of file mapdesc.h.

◆ pixel_tolerance

REAL Mapdesc::pixel_tolerance

Definition at line 104 of file mapdesc.h.

Referenced by getProperty(), Mapdesc(), and setProperty().

◆ s_steps

REAL Mapdesc::s_steps
private

Definition at line 124 of file mapdesc.h.

Referenced by getProperty(), Mapdesc(), and setProperty().

◆ sampling_method

◆ smat

Maxmatrix Mapdesc::smat
private

Definition at line 123 of file mapdesc.h.

Referenced by Mapdesc(), setSmat(), and xformSampling().

◆ t_steps

REAL Mapdesc::t_steps
private

Definition at line 125 of file mapdesc.h.

Referenced by getProperty(), Mapdesc(), and setProperty().

◆ type

long Mapdesc::type
private

Definition at line 115 of file mapdesc.h.

Referenced by getType().


The documentation for this class was generated from the following files: