ReactOS 0.4.15-dev-7958-gcd0bb1a
Backend Class Reference

#include <backend.h>

Collaboration diagram for Backend:

Public Member Functions

 Backend (BasicCurveEvaluator &c, BasicSurfaceEvaluator &e)
 
void bgnsurf (int, int, long)
 
void patch (REAL, REAL, REAL, REAL)
 
void surfpts (long, REAL *, long, long, int, int, REAL, REAL, REAL, REAL)
 
void surfbbox (long, REAL *, REAL *)
 
void surfgrid (REAL, REAL, long, REAL, REAL, long)
 
void surfmesh (long, long, long, long)
 
void bgntmesh (const char *)
 
void endtmesh (void)
 
void swaptmesh (void)
 
void tmeshvert (GridTrimVertex *)
 
void tmeshvert (TrimVertex *)
 
void tmeshvert (GridVertex *)
 
void tmeshvert (REAL u, REAL v)
 
void linevert (TrimVertex *)
 
void linevert (GridVertex *)
 
void bgnoutline (void)
 
void endoutline (void)
 
void endsurf (void)
 
void triangle (TrimVertex *, TrimVertex *, TrimVertex *)
 
void bgntfan ()
 
void endtfan ()
 
void bgnqstrip ()
 
void endqstrip ()
 
void evalUStrip (int n_upper, REAL v_upper, REAL *upper_val, int n_lower, REAL v_lower, REAL *lower_val)
 
void evalVStrip (int n_left, REAL u_left, REAL *left_val, int n_right, REAL v_right, REAL *right_val)
 
void tmeshvertNOGE (TrimVertex *t)
 
void tmeshvertNOGE_BU (TrimVertex *t)
 
void tmeshvertNOGE_BV (TrimVertex *t)
 
void preEvaluateBU (REAL u)
 
void preEvaluateBV (REAL v)
 
void bgncurv (void)
 
void segment (REAL, REAL)
 
void curvpts (long, REAL *, long, int, REAL, REAL)
 
void curvgrid (REAL, REAL, long)
 
void curvmesh (long, long)
 
void curvpt (REAL)
 
void bgnline (void)
 
void endline (void)
 
void endcurv (void)
 

Private Attributes

BasicCurveEvaluatorcurveEvaluator
 
BasicSurfaceEvaluatorsurfaceEvaluator
 
int wireframetris
 
int wireframequads
 
int npts
 
REAL mesh [3][4]
 
int meshindex
 

Detailed Description

Definition at line 46 of file backend.h.

Constructor & Destructor Documentation

◆ Backend()

Backend::Backend ( BasicCurveEvaluator c,
BasicSurfaceEvaluator e 
)
inline

Definition at line 51 of file backend.h.

BasicCurveEvaluator & curveEvaluator
Definition: backend.h:48
BasicSurfaceEvaluator & surfaceEvaluator
Definition: backend.h:49
const GLubyte * c
Definition: glext.h:8905
#define e
Definition: ke_i.h:82

Member Function Documentation

◆ bgncurv()

void Backend::bgncurv ( void  )

Definition at line 529 of file backend.cc.

530{
532}
virtual void bgnmap1f(long)
Definition: basiccrveval.cc:77

Referenced by Subdivider::drawCurves().

◆ bgnline()

void Backend::bgnline ( void  )

Definition at line 573 of file backend.cc.

574{
576}
virtual void bgnline(void)

◆ bgnoutline()

void Backend::bgnoutline ( void  )

Definition at line 477 of file backend.cc.

478{
480}
virtual void bgnline(void)

Referenced by Slicer::outline().

◆ bgnqstrip()

void Backend::bgnqstrip ( void  )

Definition at line 203 of file backend.cc.

204{
206/*
207 if(wireframequads)
208 surfaceEvaluator.polymode( N_MESHLINE );
209 else
210 surfaceEvaluator.polymode( N_MESHFILL );
211*/
212}
virtual void bgnqstrip(void)

Referenced by triangulateRectAux().

◆ bgnsurf()

void Backend::bgnsurf ( int  wiretris,
int  wirequads,
long  nuid 
)

Definition at line 58 of file backend.cc.

59{
60/*#ifndef NOWIREFRAME*/ //need this for old version
61 wireframetris = wiretris;
62 wireframequads = wirequads;
63/*#endif*/
64
65 /*in the spec, GLU_DISPLAY_MODE is either
66 * GLU_FILL
67 * GLU_OUTLINE_POLY
68 * GLU_OUTLINE_PATCH.
69 *In fact, GLU_FLL is has the same effect as
70 * set GL_FRONT_AND_BACK to be GL_FILL
71 * and GLU_OUTLINE_POLY is the same as set
72 * GL_FRONT_AND_BACK to be GL_LINE
73 *It is more efficient to do this once at the beginning of
74 *each surface than to do it for each primitive.
75 * The internal has more options: outline_triangle and outline_quad
76 *can be seperated. But since this is not in spec, and more importantly,
77 *this is not so useful, so we don't need to keep this option.
78 */
79
81
82 if(wiretris)
84 else
86}
int wireframetris
Definition: backend.h:105
int wireframequads
Definition: backend.h:106
virtual void bgnmap2f(long)
virtual void polymode(long)
#define N_MESHFILL
Definition: displaymode.h:36
#define N_MESHLINE
Definition: displaymode.h:37

Referenced by Subdivider::drawSurfaces().

◆ bgntfan()

void Backend::bgntfan ( void  )

Definition at line 185 of file backend.cc.

186{
188/*
189 if(wireframetris)
190 surfaceEvaluator.polymode( N_MESHLINE );
191 else
192 surfaceEvaluator.polymode( N_MESHFILL );
193*/
194}
virtual void bgntfan(void)

Referenced by Slicer::evalStream(), reflexChain::outputFan(), reflexChain::processNewVertex(), triangle(), and triangulateRectAux().

◆ bgntmesh()

void Backend::bgntmesh ( const char )

◆ curvgrid()

void Backend::curvgrid ( REAL  u0,
REAL  u1,
long  nu 
)

Definition at line 555 of file backend.cc.

556{
557 curveEvaluator.mapgrid1f( nu, u0, u1 );
558}
virtual void mapgrid1f(long, REAL, REAL)
Definition: basiccrveval.cc:93
GLdouble u1
Definition: glext.h:8308

Referenced by Subdivider::samplingSplit().

◆ curvmesh()

void Backend::curvmesh ( long  from,
long  n 
)

Definition at line 561 of file backend.cc.

562{
564}
virtual void mapmesh1f(long, long, long)
GLdouble n
Definition: glext.h:7729
CardRegion * from
Definition: spigame.cpp:19

Referenced by Subdivider::samplingSplit().

◆ curvpt()

void Backend::curvpt ( REAL  u)

Definition at line 567 of file backend.cc.

568{
570}
virtual void evalcoord1f(long, REAL)
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 * u
Definition: glfuncs.h:240

◆ curvpts()

void Backend::curvpts ( long  type,
REAL pts,
long  stride,
int  order,
REAL  ulo,
REAL  uhi 
)

Definition at line 541 of file backend.cc.

549{
550 curveEvaluator.map1f( type, ulo, uhi, stride, order, pts );
552}
virtual void enable(long)
Definition: basiccrveval.cc:61
virtual void map1f(long, REAL, REAL, long, long, REAL *)
Definition: basiccrveval.cc:85
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
GLsizei stride
Definition: glext.h:5848
GLuint GLdouble GLdouble GLint GLint order
Definition: glext.h:11194

Referenced by Quilt::download().

◆ endcurv()

void Backend::endcurv ( void  )

Definition at line 585 of file backend.cc.

586{
588}
virtual void endmap1f(void)

Referenced by Subdivider::drawCurves().

◆ endline()

void Backend::endline ( void  )

Definition at line 579 of file backend.cc.

580{
582}
virtual void endline(void)

◆ endoutline()

void Backend::endoutline ( void  )

Definition at line 507 of file backend.cc.

508{
510}
virtual void endline(void)

Referenced by Slicer::outline().

◆ endqstrip()

void Backend::endqstrip ( void  )

Definition at line 215 of file backend.cc.

216{
218}
virtual void endqstrip(void)

Referenced by triangulateRectAux().

◆ endsurf()

void Backend::endsurf ( void  )

Definition at line 178 of file backend.cc.

179{
181}
virtual void endmap2f(void)

Referenced by Subdivider::drawSurfaces().

◆ endtfan()

void Backend::endtfan ( void  )

◆ endtmesh()

◆ evalUStrip()

void Backend::evalUStrip ( int  n_upper,
REAL  v_upper,
REAL upper_val,
int  n_lower,
REAL  v_lower,
REAL lower_val 
)

Definition at line 221 of file backend.cc.

224{
225 surfaceEvaluator.evalUStrip(n_upper, v_upper, upper_val,
226 n_lower, v_lower, lower_val);
227}
virtual void evalUStrip(int n_upper, REAL v_upper, REAL *upper_val, int n_lower, REAL v_lower, REAL *lower_val)=0

Referenced by triangulateRectTopGen().

◆ evalVStrip()

void Backend::evalVStrip ( int  n_left,
REAL  u_left,
REAL left_val,
int  n_right,
REAL  v_right,
REAL right_val 
)

Definition at line 230 of file backend.cc.

233{
234 surfaceEvaluator.evalVStrip(n_left, u_left, left_val,
235 n_right, u_right, right_val);
236}
virtual void evalVStrip(int n_left, REAL u_left, REAL *left_val, int n_right, REAL u_right, REAL *right_val)=0

Referenced by triangulateRectTopGen().

◆ linevert() [1/2]

void Backend::linevert ( GridVertex g)

Definition at line 497 of file backend.cc.

498{
499 surfaceEvaluator.evalpoint2i( g->gparam[0], g->gparam[1] );
500}
virtual void evalpoint2i(long, long)
GLboolean GLboolean g
Definition: glext.h:6204

◆ linevert() [2/2]

void Backend::linevert ( TrimVertex t)

Definition at line 487 of file backend.cc.

488{
489 surfaceEvaluator.evalcoord2f( t->nuid, t->param[0], t->param[1] );
490}
virtual void evalcoord2f(long, REAL, REAL)
GLdouble GLdouble t
Definition: gl.h:2047

Referenced by Slicer::outline().

◆ patch()

void Backend::patch ( REAL  ulo,
REAL  uhi,
REAL  vlo,
REAL  vhi 
)

Definition at line 89 of file backend.cc.

90{
91 surfaceEvaluator.domain2f( ulo, uhi, vlo, vhi );
92}
virtual void domain2f(REAL, REAL, REAL, REAL)

Referenced by Subdivider::nonSamplingSplit().

◆ preEvaluateBU()

void Backend::preEvaluateBU ( REAL  u)

Definition at line 306 of file backend.cc.

307{
309}
virtual void inPreEvaluateBU_intfac(REAL u)=0

◆ preEvaluateBV()

void Backend::preEvaluateBV ( REAL  v)

Definition at line 312 of file backend.cc.

313{
315}
virtual void inPreEvaluateBV_intfac(REAL v)=0
const GLdouble * v
Definition: gl.h:2040

◆ segment()

void Backend::segment ( REAL  ulo,
REAL  uhi 
)

Definition at line 535 of file backend.cc.

536{
537 curveEvaluator.domain1f( ulo, uhi );
538}
virtual void domain1f(REAL, REAL)
Definition: basiccrveval.cc:45

◆ surfbbox()

void Backend::surfbbox ( long  type,
REAL from,
REAL to 
)

Definition at line 95 of file backend.cc.

96{
98}
virtual void range2f(long, REAL *, REAL *)

Referenced by Mapdesc::surfbbox().

◆ surfgrid()

void Backend::surfgrid ( REAL  u0,
REAL  u1,
long  nu,
REAL  v0,
REAL  v1,
long  nv 
)

Definition at line 126 of file backend.cc.

127{
128 surfaceEvaluator.mapgrid2f( nu, u0, u1, nv, v0, v1 );
129}
virtual void mapgrid2f(long, REAL, REAL, long, REAL, REAL)
GLfloat v0
Definition: glext.h:6061
GLfloat GLfloat v1
Definition: glext.h:6062

Referenced by Subdivider::drawSurfaces(), Slicer::evalRBArray(), Slicer::slice_old(), and triangulateRectCenter().

◆ surfmesh()

void Backend::surfmesh ( long  u,
long  v,
long  n,
long  m 
)

Definition at line 136 of file backend.cc.

137{
138#ifndef NOWIREFRAME
139 if( wireframequads ) {
140 long v0, v1;
141 long u0f = u, u1f = u+n;
142 long v0f = v, v1f = v+m;
143 long parity = (u & 1);
144
145 for( v0 = v0f, v1 = v0f++ ; v0<v1f; v0 = v1, v1++ ) {
147 for( long u = u0f; u<=u1f; u++ ) {
148 if( parity ) {
151 } else {
154 }
155 parity = 1 - parity;
156 }
158 }
159 } else {
161 }
162#else
163 if( wireframequads ) {
164
166 } else {
167
169 }
170#endif
171}
virtual void mapmesh2f(long, long, long, long, long)
const GLfloat * m
Definition: glext.h:10848

Referenced by Subdivider::drawSurfaces(), Slicer::evalRBArray(), CoveAndTiler::tile(), and triangulateRectCenter().

◆ surfpts()

void Backend::surfpts ( long  type,
REAL pts,
long  ustride,
long  vstride,
int  uorder,
int  vorder,
REAL  ulo,
REAL  uhi,
REAL  vlo,
REAL  vhi 
)

Definition at line 105 of file backend.cc.

116{
117 surfaceEvaluator.map2f( type,ulo,uhi,ustride,uorder,vlo,vhi,vstride,vorder,pts );
119}
virtual void map2f(long, REAL, REAL, long, long, REAL, REAL, long, long, REAL *)
virtual void enable(long)
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

Referenced by Quilt::download().

◆ swaptmesh()

◆ tmeshvert() [1/4]

void Backend::tmeshvert ( GridTrimVertex v)

Definition at line 269 of file backend.cc.

270{
271 if( v->isGridVert() ) {
272 tmeshvert( v->g );
273 } else {
274 tmeshvert( v->t );
275 }
276}
void tmeshvert(GridTrimVertex *)
Definition: backend.cc:269

Referenced by Slicer::evalStream(), OPT_OUTVERT(), CoveAndTiler::output(), Mesher::output(), reflexChain::outputFan(), reflexChain::processNewVertex(), tmeshvert(), and triangle().

◆ tmeshvert() [2/4]

void Backend::tmeshvert ( GridVertex g)

Definition at line 404 of file backend.cc.

405{
406 const long u = g->gparam[0];
407 const long v = g->gparam[1];
408
409#ifndef NOWIREFRAME
410 npts++;
411 if( wireframetris ) {
412 if( npts >= 3 ) {
414 if( mesh[0][2] == 0 )
415 surfaceEvaluator.evalcoord2f( (long) mesh[0][3], mesh[0][0], mesh[0][1] );
416 else
417 surfaceEvaluator.evalpoint2i( (long) mesh[0][0], (long) mesh[0][1] );
418 if( mesh[1][2] == 0 )
419 surfaceEvaluator.evalcoord2f( (long) mesh[1][3], mesh[1][0], mesh[1][1] );
420 else
421 surfaceEvaluator.evalpoint2i( (long) mesh[1][0], (long) mesh[1][1] );
424 }
425 mesh[meshindex][0] = u;
426 mesh[meshindex][1] = v;
427 mesh[meshindex][2] = 1;
428 meshindex = (meshindex+1) % 2;
429 } else {
431 }
432#else
434#endif
435}
virtual void endclosedline(void)
virtual void bgnclosedline(void)
Definition: mesh.c:198

◆ tmeshvert() [3/4]

void Backend::tmeshvert ( REAL  u,
REAL  v 
)

Definition at line 365 of file backend.cc.

366{
367#ifndef NOWIREFRAME
368 const long nuid = 0;
369
370 npts++;
371 if( wireframetris ) {
372 if( npts >= 3 ) {
374 if( mesh[0][2] == 0 )
375 surfaceEvaluator.evalcoord2f( mesh[0][3], mesh[0][0], mesh[0][1] );
376 else
377 surfaceEvaluator.evalpoint2i( (long) mesh[0][0], (long) mesh[0][1] );
378 if( mesh[1][2] == 0 )
379 surfaceEvaluator.evalcoord2f( mesh[1][3], mesh[1][0], mesh[1][1] );
380 else
381 surfaceEvaluator.evalpoint2i( (long) mesh[1][0], (long) mesh[1][1] );
384 }
385 mesh[meshindex][0] = u;
386 mesh[meshindex][1] = v;
387 mesh[meshindex][2] = 0;
388 mesh[meshindex][3] = nuid;
389 meshindex = (meshindex+1) % 2;
390 } else {
392 }
393#else
394
396#endif
397}

◆ tmeshvert() [4/4]

void Backend::tmeshvert ( TrimVertex t)

Definition at line 323 of file backend.cc.

324{
325
326#ifndef NOWIREFRAME
327 const long nuid = t->nuid;
328#endif
329 const REAL u = t->param[0];
330 const REAL v = t->param[1];
331
332#ifndef NOWIREFRAME
333 npts++;
334 if( wireframetris ) {
335 if( npts >= 3 ) {
337 if( mesh[0][2] == 0 )
338 surfaceEvaluator.evalcoord2f( mesh[0][3], mesh[0][0], mesh[0][1] );
339 else
340 surfaceEvaluator.evalpoint2i( (long) mesh[0][0], (long) mesh[0][1] );
341 if( mesh[1][2] == 0 )
342 surfaceEvaluator.evalcoord2f( mesh[1][3], mesh[1][0], mesh[1][1] );
343 else
344 surfaceEvaluator.evalpoint2i( (long) mesh[1][0], (long) mesh[1][1] );
347 }
348 mesh[meshindex][0] = u;
349 mesh[meshindex][1] = v;
350 mesh[meshindex][2] = 0;
351 mesh[meshindex][3] = nuid;
352 meshindex = (meshindex+1) % 2;
353 } else {
355 }
356#else
357
359//for uninitial memory read surfaceEvaluator.evalcoord2f( nuid, u, v );
360#endif
361}
float REAL
Definition: types.h:41

◆ tmeshvertNOGE()

void Backend::tmeshvertNOGE ( TrimVertex t)

Definition at line 279 of file backend.cc.

280{
281// surfaceEvaluator.inDoEvalCoord2NOGE( t->param[0], t->param[1], temp, ttt);
282#ifdef USE_OPTTT
283 surfaceEvaluator.inDoEvalCoord2NOGE( t->param[0], t->param[1], t->cache_point, t->cache_normal);
284#endif
285}
virtual void inDoEvalCoord2NOGE(REAL u, REAL v, REAL *ret_point, REAL *ret_normal)=0

◆ tmeshvertNOGE_BU()

void Backend::tmeshvertNOGE_BU ( TrimVertex t)

Definition at line 289 of file backend.cc.

290{
291#ifdef USE_OPTTT
292 surfaceEvaluator.inDoEvalCoord2NOGE_BU( t->param[0], t->param[1], t->cache_point, t->cache_normal);
293#endif
294}
virtual void inDoEvalCoord2NOGE_BU(REAL u, REAL v, REAL *ret_point, REAL *ret_normal)=0

◆ tmeshvertNOGE_BV()

void Backend::tmeshvertNOGE_BV ( TrimVertex t)

Definition at line 298 of file backend.cc.

299{
300#ifdef USE_OPTTT
301 surfaceEvaluator.inDoEvalCoord2NOGE_BV( t->param[0], t->param[1], t->cache_point, t->cache_normal);
302#endif
303}
virtual void inDoEvalCoord2NOGE_BV(REAL u, REAL v, REAL *ret_point, REAL *ret_normal)=0

◆ triangle()

void Backend::triangle ( TrimVertex a,
TrimVertex b,
TrimVertex c 
)

Definition at line 517 of file backend.cc.

518{
519/* bgntmesh( "spittriangle" );*/
520 bgntfan();
521 tmeshvert( a );
522 tmeshvert( b );
523 tmeshvert( c );
524 endtfan();
525/* endtmesh();*/
526}
void bgntfan()
Definition: backend.cc:185
void endtfan()
Definition: backend.cc:197
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
GLboolean GLboolean GLboolean GLboolean a
Definition: glext.h:6204

Referenced by Subdivider::arc_split(), Trimline::getNextPts(), and Trimline::getPrevPts().

Member Data Documentation

◆ curveEvaluator

BasicCurveEvaluator& Backend::curveEvaluator
private

Definition at line 48 of file backend.h.

Referenced by bgncurv(), bgnline(), curvgrid(), curvmesh(), curvpt(), curvpts(), endcurv(), endline(), and segment().

◆ mesh

REAL Backend::mesh[3][4]
private

Definition at line 108 of file backend.h.

◆ meshindex

int Backend::meshindex
private

Definition at line 109 of file backend.h.

Referenced by bgntmesh(), swaptmesh(), and tmeshvert().

◆ npts

int Backend::npts
private

Definition at line 107 of file backend.h.

Referenced by bgntmesh(), and tmeshvert().

◆ surfaceEvaluator

◆ wireframequads

int Backend::wireframequads
private

Definition at line 106 of file backend.h.

Referenced by bgnsurf(), and surfmesh().

◆ wireframetris

int Backend::wireframetris
private

Definition at line 105 of file backend.h.

Referenced by bgnsurf(), bgntmesh(), endtmesh(), swaptmesh(), and tmeshvert().


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