ReactOS 0.4.15-dev-7924-g5949c20
Quilt Class Reference

#include <quilt.h>

Inheritance diagram for Quilt:
Collaboration diagram for Quilt:

Public Member Functions

 Quilt (Mapdesc *)
 
void deleteMe (Pool &)
 
void toBezier (Knotvector &, INREAL *, long)
 
void toBezier (Knotvector &, Knotvector &, INREAL *, long)
 
void select (REAL *, REAL *)
 
int getDimension (void)
 
void download (Backend &)
 
void downloadAll (REAL *, REAL *, Backend &)
 
int isCulled (void)
 
void getRange (REAL *, REAL *, Flist &, Flist &)
 
void getRange (REAL *, REAL *, int, Flist &)
 
void getRange (REAL *, REAL *, Flist &)
 
void findRates (Flist &slist, Flist &tlist, REAL[2])
 
void findSampleRates (Flist &slist, Flist &tlist)
 
void show ()
 
- 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

Mapdescmapdesc
 
REALcpts
 
Quiltspec qspec [MAXDIM]
 
Quiltspec_ptr eqspec
 
Quiltnext
 

Detailed Description

Definition at line 64 of file quilt.h.

Constructor & Destructor Documentation

◆ Quilt()

Quilt::Quilt ( Mapdesc _mapdesc)

Definition at line 55 of file quilt.cc.

56{
57 mapdesc = _mapdesc;
58}
Mapdesc * mapdesc
Definition: quilt.h:67

Member Function Documentation

◆ deleteMe()

void Quilt::deleteMe ( Pool p)

Definition at line 61 of file quilt.cc.

62{
63 for( Quiltspec *q=qspec; q != eqspec; q++ ) {
64#if 1
65 if( q->breakpoints) delete[] q->breakpoints;
66 q->breakpoints = 0;
67#else
68 if( q->breakpoints) {
69 delete[] q->breakpoints;
70 q->breakpoints = 0;
71printf("in here\n");
72 }
73#endif
74 }
75 if( cpts ) delete[] cpts;
76 cpts = 0;
78}
void deleteMe(Pool &)
Definition: bufpool.h:136
REAL * cpts
Definition: quilt.h:68
Quiltspec qspec[MAXDIM]
Definition: quilt.h:69
Quiltspec_ptr eqspec
Definition: quilt.h:70
#define printf
Definition: freeldr.h:93
GLdouble GLdouble GLdouble GLdouble q
Definition: gl.h:2063
GLfloat GLfloat p
Definition: glext.h:8902

Referenced by NurbsTessellator::do_freenurbscurve(), and NurbsTessellator::do_freenurbssurface().

◆ download()

void Quilt::download ( Backend backend)

Definition at line 122 of file quilt.cc.

123{
124 if( getDimension() == 2 ) {
125 REAL *ps = cpts;
126 ps += qspec[0].offset;
127 ps += qspec[1].offset;
128 ps += qspec[0].index * qspec[0].order * qspec[0].stride;
129 ps += qspec[1].index * qspec[1].order * qspec[1].stride;
130 backend.surfpts( mapdesc->getType(), ps,
131 qspec[0].stride,
132 qspec[1].stride,
133 qspec[0].order,
134 qspec[1].order,
136 qspec[0].breakpoints[qspec[0].index+1],
138 qspec[1].breakpoints[qspec[1].index+1] );
139 } else {
140 REAL *ps = cpts;
141 ps += qspec[0].offset;
142 ps += qspec[0].index * qspec[0].order * qspec[0].stride;
143 backend.curvpts( mapdesc->getType(), ps,
144 qspec[0].stride,
145 qspec[0].order,
147 qspec[0].breakpoints[qspec[0].index+1] );
148 }
149}
void curvpts(long, REAL *, long, int, REAL, REAL)
Definition: backend.cc:541
void surfpts(long, REAL *, long, long, int, int, REAL, REAL, REAL, REAL)
Definition: backend.cc:105
long getType(void)
Definition: mapdesc.h:168
int getDimension(void)
Definition: quilt.h:78
float REAL
Definition: types.h:41
Knot * breakpoints
Definition: quilt.h:59
int index
Definition: quilt.h:56
int order
Definition: quilt.h:55
int stride
Definition: quilt.h:52
int offset
Definition: quilt.h:54

◆ downloadAll()

void Quilt::downloadAll ( REAL pta,
REAL ptb,
Backend backend 
)

Definition at line 157 of file quilt.cc.

158{
159 for( Quilt *m = this; m; m=m->next ) {
160 m->select( pta, ptb );
161 m->download( backend );
162 }
163}
Definition: quilt.h:64
const GLfloat * m
Definition: glext.h:10848

Referenced by Subdivider::drawCurves(), Subdivider::drawSurfaces(), and Subdivider::splitInT().

◆ findRates()

void Quilt::findRates ( Flist slist,
Flist tlist,
REAL  rate[2] 
)

Definition at line 230 of file quilt.cc.

231{
232 findSampleRates( slist, tlist );
233 rate[0] = qspec[0].step_size;
234 rate[1] = qspec[1].step_size;
235
236 for( Quilt *q = next; q; q = q->next ) {
237 q->findSampleRates( slist, tlist );
238 if( q->qspec[0].step_size < rate[0] )
239 rate[0] = q->qspec[0].step_size;
240 if( q->qspec[1].step_size < rate[1] )
241 rate[1] = q->qspec[1].step_size;
242 }
243}
Quilt * next
Definition: quilt.h:71
void findSampleRates(Flist &slist, Flist &tlist)
Definition: quilt.cc:246
Definition: _slist.h:57
int rate
Definition: pcmconverter.c:97
REAL step_size
Definition: quilt.h:58

Referenced by Subdivider::drawSurfaces().

◆ findSampleRates()

void Quilt::findSampleRates ( Flist slist,
Flist tlist 
)

Definition at line 246 of file quilt.cc.

247{
249 (qspec[0].breakpoints[qspec[0].width] - qspec[0].breakpoints[0]);
251 (qspec[1].breakpoints[qspec[1].width] - qspec[1].breakpoints[0]);
252
253 for( int i = slist.start; i < slist.end-1; i++ ) {
254 for( int j = tlist.start; j < tlist.end-1; j++ ) {
255
256 REAL pta[2], ptb[2];
257 pta[0] = slist.pts[i];
258 ptb[0] = slist.pts[i+1];
259 pta[1] = tlist.pts[j];
260 ptb[1] = tlist.pts[j+1];
261 Patchlist patchlist( this, pta, ptb );
262 patchlist.getstepsize();
263
264 {
265 float edge_len_s = min(glu_abs(ptb[0]-pta[0]),1.0);
266 float edge_len_t = min(glu_abs(ptb[1]-pta[1]),1.0);
267
268 if( patchlist.getStepsize(0)/edge_len_s < qspec[0].step_size )
269 qspec[0].step_size = patchlist.getStepsize(0)/edge_len_s;
270 if( patchlist.getStepsize(1)/edge_len_t < qspec[1].step_size )
271 qspec[1].step_size = patchlist.getStepsize(1)/edge_len_t;
272 }
273 }
274 }
275}
REAL * pts
Definition: flist.h:44
int start
Definition: flist.h:46
int end
Definition: flist.h:47
iterator end()
Definition: _slist.h:420
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
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
#define min(a, b)
Definition: monoChain.cc:55
#define DEF_PATCH_STEPSIZE
Definition: quilt.cc:51
REAL glu_abs(REAL x)
Definition: simplemath.h:50
int width
Definition: quilt.h:53

Referenced by findRates().

◆ getDimension()

int Quilt::getDimension ( void  )
inline

Definition at line 78 of file quilt.h.

78{ return eqspec - qspec; }

Referenced by download().

◆ getRange() [1/3]

void Quilt::getRange ( REAL from,
REAL to,
Flist slist 
)

Definition at line 224 of file quilt.cc.

225{
226 getRange( from, to, 0, slist );
227}
void getRange(REAL *, REAL *, Flist &, Flist &)
Definition: quilt.cc:186
CardRegion * from
Definition: spigame.cpp:19

◆ getRange() [2/3]

void Quilt::getRange ( REAL from,
REAL to,
Flist slist,
Flist tlist 
)

Definition at line 186 of file quilt.cc.

187{
188 getRange( from, to, 0, slist );
189 getRange( from, to, 1, tlist );
190}

Referenced by Subdivider::drawCurves(), Subdivider::drawSurfaces(), and getRange().

◆ getRange() [3/3]

void Quilt::getRange ( REAL from,
REAL to,
int  i,
Flist list 
)

Definition at line 197 of file quilt.cc.

198{
199 Quilt *maps = this;
200 from[i] = maps->qspec[i].breakpoints[0];
201 to[i] = maps->qspec[i].breakpoints[maps->qspec[i].width];
202 int maxpts = 0;
203 Quilt_ptr m;
204 for( m=maps; m; m=m->next ) {
205 if( m->qspec[i].breakpoints[0] > from[i] )
206 from[i] = m->qspec[i].breakpoints[0];
207 if( m->qspec[i].breakpoints[m->qspec[i].width] < to[i] )
208 to[i] = m->qspec[i].breakpoints[m->qspec[i].width];
209 maxpts += m->qspec[i].width + 1;
210 }
211
212 list.grow( maxpts );
213
214 for( m=maps; m; m=m->next )
215 for( int j=0; j<=m->qspec[i].width; j++ ) {
216 list.add( m->qspec[i].breakpoints[j] );
217 }
218
219 list.filter( );
220 list.taper( from[i], to[i] );
221}
Definition: list.h:37
class Quilt * Quilt_ptr
Definition: quilt.h:90

◆ isCulled()

int Quilt::isCulled ( void  )

Definition at line 171 of file quilt.cc.

172{
173 if( mapdesc->isCulling() )
175 qspec[0].order * qspec[0].width, qspec[0].stride,
176 qspec[1].order * qspec[1].width, qspec[1].stride );
177 else
178 return CULL_ACCEPT;
179}
int isCulling(void)
Definition: mapdesc.h:261
int xformAndCullCheck(REAL *, int, int, int, int)
Definition: mapdesc.cc:355
#define CULL_ACCEPT
Definition: defines.h:42
GLint GLint GLsizei width
Definition: gl.h:1546
GLsizei stride
Definition: glext.h:5848
GLuint GLdouble GLdouble GLint GLint order
Definition: glext.h:11194
GLintptr offset
Definition: glext.h:5920

◆ select()

void Quilt::select ( REAL pta,
REAL ptb 
)

Definition at line 107 of file quilt.cc.

108{
109 int dim = eqspec - qspec;
110 int i, j;
111 for( i=0; i<dim; i++) {
112 for( j=qspec[i].width-1; j>=0; j-- )
113 if( (qspec[i].breakpoints[j] <= pta[i] ) &&
114 (ptb[i] <= qspec[i].breakpoints[j+1] ) )
115 break;
116 assert( j != -1 );
117 qspec[i].index = j;
118 }
119}
#define assert(x)
Definition: debug.h:53

◆ show()

void Quilt::show ( void  )

Definition at line 81 of file quilt.cc.

82{
83#ifndef NDEBUG
84 int nc = mapdesc->getNcoords();
85 REAL *ps = cpts;
86 ps += qspec[0].offset;
87 ps += qspec[1].offset;
88 for( int i=0; i!= qspec[0].order * qspec[0].width; i++ ) {
89 for( int j = 0; j!= qspec[1].order * qspec[1].width; j++ ) {
90 for( int k=0; k < nc; k++ )
91 _glu_dprintf( "%g ", ps[i*qspec[0].stride + j*qspec[1].stride + k] );
92 _glu_dprintf( "\n" );
93 }
94 _glu_dprintf( "\n" );
95 }
96 _glu_dprintf( "\n" );
97#endif
98}
int getNcoords(void)
Definition: mapdesc.h:198
int k
Definition: mpi.c:3369

◆ toBezier() [1/2]

void Quilt::toBezier ( Knotvector knotvector,
INREAL ctlpts,
long  ncoords 
)

Definition at line 117 of file tobezier.cc.

121{
122 Splinespec spline( 1 );
123 spline.kspecinit( knotvector );
124 spline.select();
125 spline.layout( ncoords );
126 spline.setupquilt( this );
127 spline.copy( ctlpts );
128 spline.transform();
129}

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

◆ toBezier() [2/2]

void Quilt::toBezier ( Knotvector sknotvector,
Knotvector tknotvector,
INREAL ctlpts,
long  ncoords 
)

Definition at line 132 of file tobezier.cc.

137{
138 Splinespec spline( 2 );
139 spline.kspecinit( sknotvector, tknotvector );
140 spline.select();
141 spline.layout( ncoords );
142 spline.setupquilt( this );
143 spline.copy( ctlpts );
144 spline.transform();
145}

Member Data Documentation

◆ cpts

REAL* Quilt::cpts

Definition at line 68 of file quilt.h.

Referenced by deleteMe(), NurbsTessellator::do_endsurface(), download(), isCulled(), and show().

◆ eqspec

Quiltspec_ptr Quilt::eqspec

Definition at line 70 of file quilt.h.

Referenced by deleteMe(), getDimension(), and select().

◆ mapdesc

Mapdesc* Quilt::mapdesc

Definition at line 67 of file quilt.h.

Referenced by Subdivider::addArc(), download(), isCulled(), Quilt(), and show().

◆ next

Quilt* Quilt::next

Definition at line 71 of file quilt.h.

Referenced by Subdivider::addQuilt(), and findRates().

◆ qspec


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