ReactOS 0.4.15-dev-7931-gfd331f1
gridBoundaryChain Class Reference

#include <gridWrap.h>

Collaboration diagram for gridBoundaryChain:

Public Member Functions

 gridBoundaryChain (gridWrap *gr, Int first_vline_index, Int n_vlines, Int *uline_indices, Int *inner_indices)
 
 ~gridBoundaryChain ()
 
Int getVlineIndex (Int i)
 
Int getUlineIndex (Int i)
 
Real get_u_value (Int i)
 
Real get_v_value (Int i)
 
Int get_nVlines ()
 
Int getInnerIndex (Int i)
 
Real getInner_u_value (Int i)
 
Realget_vertex (Int i)
 
gridWrapgetGrid ()
 
void leftEndFan (Int i, primStream *pStream)
 
void rightEndFan (Int i, primStream *pStream)
 
Int lookfor (Real v, Int i1, Int i2)
 
void draw ()
 
void drawInner ()
 

Private Attributes

gridWrapgrid
 
Int firstVlineIndex
 
Int nVlines
 
IntulineIndices
 
IntinnerIndices
 
Real2vertices
 

Detailed Description

Definition at line 96 of file gridWrap.h.

Constructor & Destructor Documentation

◆ gridBoundaryChain()

gridBoundaryChain::gridBoundaryChain ( gridWrap gr,
Int  first_vline_index,
Int  n_vlines,
Int uline_indices,
Int inner_indices 
)

Definition at line 177 of file gridWrap.cc.

184: grid(gr), firstVlineIndex(first_vline_index), nVlines(n_vlines)
185{
186 ulineIndices = (Int*) malloc(sizeof(Int) * n_vlines);
188
189 innerIndices = (Int*) malloc(sizeof(Int) * n_vlines);
191
192 vertices = (Real2*) malloc(sizeof(Real2) * n_vlines);
194
195
196
197 Int i;
198 for(i=0; i<n_vlines; i++){
199 ulineIndices[i] = uline_indices[i];
200 innerIndices[i] = inner_indices[i];
201 }
202
203 for(i=0; i<n_vlines; i++){
204 vertices[i][0] = gr->get_u_value(ulineIndices[i]);
205 vertices[i][1] = gr->get_v_value(first_vline_index-i);
206 }
207}
gridWrap * grid
Definition: gridWrap.h:97
Int * ulineIndices
Definition: gridWrap.h:100
Int * innerIndices
Definition: gridWrap.h:101
Real2 * vertices
Definition: gridWrap.h:105
Real get_v_value(Int j)
Definition: gridWrap.h:83
Real get_u_value(Int i)
Definition: gridWrap.h:78
#define malloc
Definition: debug_ros.c:4
int Int
Definition: definitions.h:37
Real Real2[2]
Definition: definitions.h:38
#define assert(x)
Definition: debug.h:53
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

◆ ~gridBoundaryChain()

gridBoundaryChain::~gridBoundaryChain ( )
inline

Definition at line 110 of file gridWrap.h.

111 {
114 free(vertices);
115 }
#define free
Definition: debug_ros.c:5

Member Function Documentation

◆ draw()

void gridBoundaryChain::draw ( )

Definition at line 209 of file gridWrap.cc.

210{
211 Int i;
213 for(i=0; i<nVlines; i++)
214 {
216 }
217 glEnd();
218}
#define GL_LINE_STRIP
Definition: gl.h:193
GLAPI void GLAPIENTRY glBegin(GLenum mode)
GLAPI void GLAPIENTRY glEnd(void)
GLAPI void GLAPIENTRY glVertex2fv(const GLfloat *v)

◆ drawInner()

void gridBoundaryChain::drawInner ( )

Definition at line 220 of file gridWrap.cc.

221{
222 Int i;
223 for(i=1; i<nVlines; i++)
224 {
228 glEnd();
229 }
230}
Real get_v_value(Int i)
Definition: gridWrap.h:122
GLAPI void GLAPIENTRY glVertex2f(GLfloat x, GLfloat y)

◆ get_nVlines()

Int gridBoundaryChain::get_nVlines ( )
inline

Definition at line 123 of file gridWrap.h.

123{return nVlines;}

Referenced by findNeckF(), and sampleMonoPolyRec().

◆ get_u_value()

Real gridBoundaryChain::get_u_value ( Int  i)
inline

Definition at line 121 of file gridWrap.h.

121{return vertices[i][0];}

Referenced by drawCorners(), sampleCompBot(), sampleCompTop(), sampleLeftOneGridStep(), and sampleMonoPolyRec().

◆ get_v_value()

◆ get_vertex()

◆ getGrid()

◆ getInner_u_value()

Real gridBoundaryChain::getInner_u_value ( Int  i)
inline

Definition at line 125 of file gridWrap.h.

125{return grid->get_u_value(innerIndices[i]);}

Referenced by sampleLeftOneGridStep(), and sampleRightOneGridStep().

◆ getInnerIndex()

Int gridBoundaryChain::getInnerIndex ( Int  i)
inline

Definition at line 124 of file gridWrap.h.

124{return innerIndices[i];}

Referenced by sampleLeftOneGridStep(), sampleMonoPolyRec(), and sampleRightOneGridStep().

◆ getUlineIndex()

◆ getVlineIndex()

Int gridBoundaryChain::getVlineIndex ( Int  i)
inline

◆ leftEndFan()

void gridBoundaryChain::leftEndFan ( Int  i,
primStream pStream 
)

Definition at line 273 of file gridWrap.cc.

274{
275 Int j;
277 {
278 pStream->begin();
279 pStream->insert(get_vertex(i-1));
280 for(j=getUlineIndex(i); j<= getUlineIndex(i-1); j++)
281 pStream->insert(grid->get_u_value(j), get_v_value(i));
282 pStream->end(PRIMITIVE_STREAM_FAN);
283 }
284 else if(getUlineIndex(i) > getUlineIndex(i-1))
285 {
286 pStream->begin();
287 pStream->insert(get_vertex(i));
288 for(j=getUlineIndex(i); j>= getUlineIndex(i-1); j--)
289 pStream->insert(grid->get_u_value(j), get_v_value(i-1));
290 pStream->end(PRIMITIVE_STREAM_FAN);
291 }
292 /*otherwisem, the two are equal, so there is no fan to outout*/
293}
Int getUlineIndex(Int i)
Definition: gridWrap.h:120
Real * get_vertex(Int i)
Definition: gridWrap.h:127
void insert(Real u, Real v)
void end(Int type)
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
@ PRIMITIVE_STREAM_FAN

Referenced by sampleLeftOneGridStepNoMiddle().

◆ lookfor()

Int gridBoundaryChain::lookfor ( Real  v,
Int  i1,
Int  i2 
)

Definition at line 232 of file gridWrap.cc.

233{
234 Int mid;
235 while(i1 < i2-1)
236 {
237 mid = (i1+i2)/2;
238 if(v > vertices[mid][1])
239 {
240 i2 = mid;
241 }
242 else
243 i1 = mid;
244 }
245 return i1;
246}
const GLdouble * v
Definition: gl.h:2040

Referenced by sampleCompLeft().

◆ rightEndFan()

void gridBoundaryChain::rightEndFan ( Int  i,
primStream pStream 
)

Definition at line 249 of file gridWrap.cc.

250{
251 Int j;
253 {
254 pStream->begin();
255 pStream->insert(get_vertex(i-1));
256 for(j=getUlineIndex(i-1); j<= getUlineIndex(i); j++)
257 pStream->insert(grid->get_u_value(j), get_v_value(i));
258 pStream->end(PRIMITIVE_STREAM_FAN);
259 }
260 else if(getUlineIndex(i) < getUlineIndex(i-1))
261 {
262 pStream->begin();
263 pStream->insert(get_vertex(i));
264 for(j=getUlineIndex(i-1); j>= getUlineIndex(i); j--)
265 pStream->insert(grid->get_u_value(j), get_v_value(i-1));
266 pStream->end(PRIMITIVE_STREAM_FAN);
267 }
268 //otherside, the two are equal, so there is no fan to output
269}

Referenced by sampleRightOneGridStepNoMiddle(), sampleRightSingleTrimEdgeRegion(), and sampleRightSingleTrimEdgeRegionGen().

Member Data Documentation

◆ firstVlineIndex

Int gridBoundaryChain::firstVlineIndex
private

Definition at line 98 of file gridWrap.h.

Referenced by getVlineIndex().

◆ grid

gridWrap* gridBoundaryChain::grid
private

Definition at line 97 of file gridWrap.h.

Referenced by drawInner(), getGrid(), getInner_u_value(), leftEndFan(), and rightEndFan().

◆ innerIndices

Int* gridBoundaryChain::innerIndices
private

◆ nVlines

Int gridBoundaryChain::nVlines
private

Definition at line 99 of file gridWrap.h.

Referenced by draw(), drawInner(), and get_nVlines().

◆ ulineIndices

Int* gridBoundaryChain::ulineIndices
private

Definition at line 100 of file gridWrap.h.

Referenced by getUlineIndex(), gridBoundaryChain(), and ~gridBoundaryChain().

◆ vertices

Real2* gridBoundaryChain::vertices
private

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