ReactOS 0.4.16-dev-338-g34e76ad
Patchlist Class Reference

#include <patchlist.h>

Collaboration diagram for Patchlist:

Public Member Functions

 Patchlist (Quilt *, REAL *, REAL *)
 
 Patchlist (Patchlist &, int, REAL)
 
 ~Patchlist ()
 
void bbox ()
 
int cullCheck (void)
 
void getstepsize (void)
 
int needsNonSamplingSubdivision (void)
 
int needsSamplingSubdivision (void)
 
int needsSubdivision (int)
 
REAL getStepsize (int)
 
void getRanges (REAL ranges[4])
 
int get_uorder ()
 
int get_vorder ()
 

Private Attributes

Patchpatch
 
int notInBbox
 
int needsSampling
 
Pspec pspec [2]
 

Friends

class Subdivider
 

Detailed Description

Definition at line 45 of file patchlist.h.

Constructor & Destructor Documentation

◆ Patchlist() [1/2]

Patchlist::Patchlist ( Quilt quilts,
REAL pta,
REAL ptb 
)

Definition at line 48 of file patchlist.cc.

49{
50 patch = 0;
51 for( Quilt *q = quilts; q; q = q->next )
52 patch = new Patch( q, pta, ptb, patch );
53 pspec[0].range[0] = pta[0];
54 pspec[0].range[1] = ptb[0];
55 pspec[0].range[2] = ptb[0] - pta[0];
56
57 pspec[1].range[0] = pta[1];
58 pspec[1].range[1] = ptb[1];
59 pspec[1].range[2] = ptb[1] - pta[1];
60}
Definition: patch.h:62
Patch * patch
Definition: patchlist.h:63
Pspec pspec[2]
Definition: patchlist.h:66
Definition: quilt.h:64
GLdouble GLdouble GLdouble GLdouble q
Definition: gl.h:2063
REAL range[3]
Definition: patch.h:47

◆ Patchlist() [2/2]

Patchlist::Patchlist ( Patchlist upper,
int  param,
REAL  value 
)

Definition at line 62 of file patchlist.cc.

63{
64 Patchlist &lower = *this;
65 patch = 0;
66 for( Patch *p = upper.patch; p; p = p->next )
67 patch = new Patch( *p, param, value, patch );
68
69 if( param == 0 ) {
70 lower.pspec[0].range[0] = upper.pspec[0].range[0];
71 lower.pspec[0].range[1] = value;
72 lower.pspec[0].range[2] = value - upper.pspec[0].range[0];
73 upper.pspec[0].range[0] = value;
74 upper.pspec[0].range[2] = upper.pspec[0].range[1] - value;
75 lower.pspec[1] = upper.pspec[1];
76 } else {
77 lower.pspec[0] = upper.pspec[0];
78 lower.pspec[1].range[0] = upper.pspec[1].range[0];
79 lower.pspec[1].range[1] = value;
80 lower.pspec[1].range[2] = value - upper.pspec[1].range[0];
81 upper.pspec[1].range[0] = value;
82 upper.pspec[1].range[2] = upper.pspec[1].range[1] - value;
83 }
84}
Patch * next
Definition: patch.h:83
GLfloat GLfloat p
Definition: glext.h:8902
GLfloat param
Definition: glext.h:5796
Definition: pdh_main.c:94

◆ ~Patchlist()

Patchlist::~Patchlist ( )

Definition at line 86 of file patchlist.cc.

87{
88 while( patch ) {
89 Patch *p = patch;
90 patch = patch->next;
91 delete p;
92 }
93}

Member Function Documentation

◆ bbox()

void Patchlist::bbox ( void  )

Definition at line 137 of file patchlist.cc.

138{
139 for( Patch *p = patch; p; p = p->next )
140 p->bbox();
141}

Referenced by Subdivider::nonSamplingSplit().

◆ cullCheck()

int Patchlist::cullCheck ( void  )

Definition at line 96 of file patchlist.cc.

97{
98 for( Patch *p = patch; p; p = p->next )
99 if( p->cullCheck() == CULL_TRIVIAL_REJECT )
100 return CULL_TRIVIAL_REJECT;
101 return CULL_ACCEPT;
102}
#define CULL_ACCEPT
Definition: defines.h:42
#define CULL_TRIVIAL_REJECT
Definition: defines.h:40

Referenced by Subdivider::nonSamplingSplit(), and Subdivider::samplingSplit().

◆ get_uorder()

int Patchlist::get_uorder ( )
inline

Definition at line 76 of file patchlist.h.

77{
78 return patch->get_uorder();
79
80}
int get_uorder()
Definition: patch.h:77

Referenced by Subdivider::tessellation().

◆ get_vorder()

int Patchlist::get_vorder ( )
inline

Definition at line 83 of file patchlist.h.

84{
85 return patch->get_vorder();
86}
int get_vorder()
Definition: patch.h:78

Referenced by Subdivider::tessellation().

◆ getRanges()

void Patchlist::getRanges ( REAL  ranges[4])

Definition at line 105 of file patchlist.cc.

106{
107 ranges[0] = pspec[0].range[0];
108 ranges[1] = pspec[0].range[1];
109 ranges[2] = pspec[1].range[0];
110 ranges[3] = pspec[1].range[1];
111}

◆ getStepsize()

REAL Patchlist::getStepsize ( int  param)
inline

Definition at line 70 of file patchlist.h.

71{
72 return pspec[param].stepsize;
73}
REAL stepsize
Definition: patch.h:49

Referenced by Quilt::findSampleRates().

◆ getstepsize()

void Patchlist::getstepsize ( void  )

Definition at line 114 of file patchlist.cc.

115{
116 pspec[0].stepsize = pspec[0].range[2];
117 pspec[0].sidestep[0] = pspec[0].range[2];
118 pspec[0].sidestep[1] = pspec[0].range[2];
119
120 pspec[1].stepsize = pspec[1].range[2];
121 pspec[1].sidestep[0] = pspec[1].range[2];
122 pspec[1].sidestep[1] = pspec[1].range[2];
123
124 for( Patch *p = patch; p; p = p->next ) {
125 p->getstepsize();
126 p->clamp();
127 pspec[0].stepsize = ((p->pspec[0].stepsize < pspec[0].stepsize) ? p->pspec[0].stepsize : pspec[0].stepsize);
128 pspec[0].sidestep[0] = ((p->pspec[0].sidestep[0] < pspec[0].sidestep[0]) ? p->pspec[0].sidestep[0] : pspec[0].sidestep[0]);
129 pspec[0].sidestep[1] = ((p->pspec[0].sidestep[1] < pspec[0].sidestep[1]) ? p->pspec[0].sidestep[1] : pspec[0].sidestep[1]);
130 pspec[1].stepsize = ((p->pspec[1].stepsize < pspec[1].stepsize) ? p->pspec[1].stepsize : pspec[1].stepsize);
131 pspec[1].sidestep[0] = ((p->pspec[1].sidestep[0] < pspec[1].sidestep[0]) ? p->pspec[1].sidestep[0] : pspec[1].sidestep[0]);
132 pspec[1].sidestep[1] = ((p->pspec[1].sidestep[1] < pspec[1].sidestep[1]) ? p->pspec[1].sidestep[1] : pspec[1].sidestep[1]);
133 }
134}
REAL sidestep[2]
Definition: patch.h:48

Referenced by Quilt::findSampleRates(), and Subdivider::samplingSplit().

◆ needsNonSamplingSubdivision()

int Patchlist::needsNonSamplingSubdivision ( void  )

Definition at line 144 of file patchlist.cc.

145{
146 notInBbox = 0;
147 for( Patch *p = patch; p; p = p->next )
148 notInBbox |= p->needsNonSamplingSubdivision();
149 return notInBbox;
150}
int notInBbox
Definition: patchlist.h:64

Referenced by Subdivider::nonSamplingSplit().

◆ needsSamplingSubdivision()

int Patchlist::needsSamplingSubdivision ( void  )

Definition at line 153 of file patchlist.cc.

154{
155 pspec[0].needsSubdivision = 0;
156 pspec[1].needsSubdivision = 0;
157
158 for( Patch *p = patch; p; p = p->next ) {
159 pspec[0].needsSubdivision |= p->pspec[0].needsSubdivision;
160 pspec[1].needsSubdivision |= p->pspec[0].needsSubdivision;
161 }
162 return (pspec[0].needsSubdivision || pspec[1].needsSubdivision) ? 1 : 0;
163}
int needsSubdivision(int)
Definition: patchlist.cc:166
int needsSubdivision
Definition: patch.h:51

Referenced by Subdivider::samplingSplit().

◆ needsSubdivision()

int Patchlist::needsSubdivision ( int  param)

Definition at line 166 of file patchlist.cc.

167{
169}

Referenced by needsSamplingSubdivision(), and Subdivider::samplingSplit().

Friends And Related Function Documentation

◆ Subdivider

friend class Subdivider
friend

Definition at line 46 of file patchlist.h.

Member Data Documentation

◆ needsSampling

int Patchlist::needsSampling
private

Definition at line 65 of file patchlist.h.

◆ notInBbox

int Patchlist::notInBbox
private

Definition at line 64 of file patchlist.h.

Referenced by needsNonSamplingSubdivision().

◆ patch

◆ pspec


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