ReactOS  0.4.11-dev-765-g5e024bf
rectBlock Class Reference

#include <rectBlock.h>

Public Member Functions

 rectBlock (gridBoundaryChain *left, gridBoundaryChain *right, Int beginVline, Int endVline)
 
 ~rectBlock ()
 
Int get_upGridLineIndex ()
 
Int get_lowGridLineIndex ()
 
Intget_leftIndices ()
 
Intget_rightIndices ()
 
Int num_quads ()
 
void print ()
 
void draw (Real *u_values, Real *v_values)
 

Private Attributes

Int upGridLineIndex
 
Int lowGridLineIndex
 
IntleftIndices
 
IntrightIndices
 

Detailed Description

Definition at line 39 of file rectBlock.h.

Constructor & Destructor Documentation

rectBlock::rectBlock ( gridBoundaryChain left,
gridBoundaryChain right,
Int  beginVline,
Int  endVline 
)

Definition at line 47 of file rectBlock.cc.

48 {
49  Int i;
50 
51 
52  upGridLineIndex = left->getVlineIndex(beginVline);
53 
54  lowGridLineIndex = left->getVlineIndex(endVline);
55 
56  Int n = upGridLineIndex-lowGridLineIndex+1; //number of grid lines
57  leftIndices = (Int*) malloc(sizeof(Int) * n);
59  rightIndices = (Int*) malloc(sizeof(Int) * n);
61  for(i=0; i<n; i++)
62  {
63 
64  leftIndices[i] = left->getInnerIndex(i+beginVline);
65  rightIndices[i] = right->getInnerIndex(i+beginVline);
66  }
67 }
Int getVlineIndex(Int i)
Definition: gridWrap.h:119
#define assert(x)
Definition: debug.h:53
GLuint n
Definition: s_context.h:57
GLenum GLclampf GLint i
Definition: glfuncs.h:14
Int * leftIndices
Definition: rectBlock.h:42
Int lowGridLineIndex
Definition: rectBlock.h:41
Int getInnerIndex(Int i)
Definition: gridWrap.h:124
Int * rightIndices
Definition: rectBlock.h:43
Int upGridLineIndex
Definition: rectBlock.h:40
#define malloc
Definition: debug_ros.c:4
int Int
Definition: definitions.h:37
rectBlock::~rectBlock ( )

Definition at line 70 of file rectBlock.cc.

71 {
74 }
#define free
Definition: debug_ros.c:5
Int * leftIndices
Definition: rectBlock.h:42
Int * rightIndices
Definition: rectBlock.h:43

Member Function Documentation

void rectBlock::draw ( Real u_values,
Real v_values 
)

Definition at line 88 of file rectBlock.cc.

89 {
90  Int i,j,k;
91  //upgrid line to bot grid line
92 #ifdef DEBUG
93 printf("upGridLineIndex=%i, lowGridLineIndex=%i\n", upGridLineIndex, lowGridLineIndex);
94 #endif
95  for(k=0, i=upGridLineIndex; i > lowGridLineIndex; i--, k++)
96  {
98 
99  for(j=leftIndices[k+1]; j<= rightIndices[k+1]; j++)
100  {
101  glVertex2f(u_values[j], v_values[i]);
102  glVertex2f(u_values[j], v_values[i-1]);
103  }
104  glEnd();
105  }
106 }
GLenum GLclampf GLint GLenum GLuint GLenum GLenum GLsizei GLenum const GLvoid GLfloat GLfloat GLfloat GLfloat GLclampd GLint 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 GLboolean GLboolean GLboolean GLint GLenum GLsizei const GLvoid GLenum GLint GLenum GLint GLint GLsizei GLint GLenum GLint GLint GLint GLint GLsizei GLenum GLsizei const GLuint GLboolean GLenum GLenum GLint GLsizei GLenum GLsizei GLenum const GLvoid GLboolean const GLboolean GLenum const GLdouble const GLfloat const GLdouble const GLfloat GLenum GLint GLint GLint GLint GLint GLint j
Definition: glfuncs.h:98
GLenum GLclampf GLint i
Definition: glfuncs.h:14
GLAPI void GLAPIENTRY glVertex2f(GLfloat x, GLfloat y)
Int * leftIndices
Definition: rectBlock.h:42
Int lowGridLineIndex
Definition: rectBlock.h:41
GLAPI void GLAPIENTRY glBegin(GLenum mode)
#define GL_QUAD_STRIP
Definition: gl.h:198
Int * rightIndices
Definition: rectBlock.h:43
Int upGridLineIndex
Definition: rectBlock.h:40
GLAPI void GLAPIENTRY glEnd(void)
int k
Definition: mpi.c:3369
#define printf
Definition: config.h:203
int Int
Definition: definitions.h:37
Int* rectBlock::get_leftIndices ( )
inline

Definition at line 51 of file rectBlock.h.

Referenced by Slicer::evalRBArray().

51 {return leftIndices;}
Int * leftIndices
Definition: rectBlock.h:42
Int rectBlock::get_lowGridLineIndex ( )
inline

Definition at line 50 of file rectBlock.h.

Referenced by Slicer::evalRBArray().

50 {return lowGridLineIndex;}
Int lowGridLineIndex
Definition: rectBlock.h:41
Int* rectBlock::get_rightIndices ( )
inline

Definition at line 52 of file rectBlock.h.

Referenced by Slicer::evalRBArray().

52 {return rightIndices;}
Int * rightIndices
Definition: rectBlock.h:43
Int rectBlock::get_upGridLineIndex ( )
inline

Definition at line 49 of file rectBlock.h.

Referenced by Slicer::evalRBArray().

49 {return upGridLineIndex;}
Int upGridLineIndex
Definition: rectBlock.h:40
Int rectBlock::num_quads ( )

Definition at line 109 of file rectBlock.cc.

110 {
111  Int ret=0;
112  Int k,i;
113  for(k=0, i=upGridLineIndex; i>lowGridLineIndex; i--, k++)
114  {
115  ret += (rightIndices[k+1]-leftIndices[k+1]);
116  }
117  return ret;
118 }
GLenum GLclampf GLint i
Definition: glfuncs.h:14
Int * leftIndices
Definition: rectBlock.h:42
Int lowGridLineIndex
Definition: rectBlock.h:41
int ret
Int * rightIndices
Definition: rectBlock.h:43
Int upGridLineIndex
Definition: rectBlock.h:40
int k
Definition: mpi.c:3369
int Int
Definition: definitions.h:37
void rectBlock::print ( void  )

Definition at line 76 of file rectBlock.cc.

77 {
78  Int i;
79  printf("block:\n");
80  for(i=upGridLineIndex; i >= lowGridLineIndex; i--)
81  {
82  printf("gridline %i, (%i,%i)\n", i, leftIndices[upGridLineIndex-i], rightIndices[upGridLineIndex-i]);
83  }
84 }
GLenum GLclampf GLint i
Definition: glfuncs.h:14
Int * leftIndices
Definition: rectBlock.h:42
Int lowGridLineIndex
Definition: rectBlock.h:41
Int * rightIndices
Definition: rectBlock.h:43
Int upGridLineIndex
Definition: rectBlock.h:40
#define printf
Definition: config.h:203
int Int
Definition: definitions.h:37

Member Data Documentation

Int* rectBlock::leftIndices
private

Definition at line 42 of file rectBlock.h.

Referenced by draw(), get_leftIndices(), num_quads(), print(), rectBlock(), and ~rectBlock().

Int rectBlock::lowGridLineIndex
private

Definition at line 41 of file rectBlock.h.

Referenced by draw(), get_lowGridLineIndex(), num_quads(), print(), and rectBlock().

Int* rectBlock::rightIndices
private

Definition at line 43 of file rectBlock.h.

Referenced by draw(), get_rightIndices(), num_quads(), print(), rectBlock(), and ~rectBlock().

Int rectBlock::upGridLineIndex
private

Definition at line 40 of file rectBlock.h.

Referenced by draw(), get_upGridLineIndex(), num_quads(), print(), and rectBlock().


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