ReactOS 0.4.16-dev-109-gf4cb10f
rectBlockArray Class Reference

#include <rectBlock.h>

Collaboration diagram for rectBlockArray:

Public Member Functions

 rectBlockArray (Int s)
 
 ~rectBlockArray ()
 
Int get_n_elements ()
 
rectBlockget_element (Int i)
 
void insert (rectBlock *newBlock)
 
Int num_quads ()
 
void print ()
 
void draw (Real *u_values, Real *v_values)
 

Private Attributes

rectBlock ** array
 
Int n_elements
 
Int size
 

Detailed Description

Definition at line 61 of file rectBlock.h.

Constructor & Destructor Documentation

◆ rectBlockArray()

rectBlockArray::rectBlockArray ( Int  s)

Definition at line 128 of file rectBlock.cc.

129{
130 Int i;
131 n_elements = 0;
132 size = s;
133 array = (rectBlock**) malloc(sizeof(rectBlock*) * s);
134 assert(array);
135//initialization
136 for(i=0; i<s; i++)
137 array[i] = NULL;
138}
#define malloc
Definition: debug_ros.c:4
int Int
Definition: definitions.h:37
#define NULL
Definition: types.h:112
#define assert(x)
Definition: debug.h:53
GLdouble s
Definition: gl.h:2039
GLsizeiptr size
Definition: glext.h:5919
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

◆ ~rectBlockArray()

rectBlockArray::~rectBlockArray ( )

Definition at line 140 of file rectBlock.cc.

141{
142 Int i;
143 for(i=0; i<size; i++)
144 {
145 if(array[i] != NULL)
146 delete array[i];
147 }
148 free(array);
149}
#define free
Definition: debug_ros.c:5

Member Function Documentation

◆ draw()

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

Definition at line 181 of file rectBlock.cc.

182{
183 Int i;
184 for(i=0; i<n_elements; i++)
185 array[i]->draw(u_values, v_values);
186}
void draw(Real *u_values, Real *v_values)
Definition: rectBlock.cc:181

Referenced by draw().

◆ get_element()

rectBlock * rectBlockArray::get_element ( Int  i)
inline

Definition at line 70 of file rectBlock.h.

70{return array[i];}

Referenced by Slicer::evalRBArray().

◆ get_n_elements()

Int rectBlockArray::get_n_elements ( )
inline

Definition at line 69 of file rectBlock.h.

69{return n_elements;}

Referenced by Slicer::evalRBArray().

◆ insert()

void rectBlockArray::insert ( rectBlock newBlock)

Definition at line 152 of file rectBlock.cc.

153{
154 Int i;
155 if(n_elements == size) //full
156 {
157 rectBlock** temp = (rectBlock**) malloc(sizeof(rectBlock) * (2*size+1));
158 assert(temp);
159 //initialization
160 for(i=0; i<2*size+1; i++)
161 temp[i] = NULL;
162
163 for(i=0; i<n_elements; i++)
164 temp[i] = array[i];
165
166 free(array);
167 array = temp;
168 size = 2*size + 1;
169 }
170
171 array[n_elements++] = newBlock;
172}
static calc_node_t temp
Definition: rpn_ieee.c:38

Referenced by sampleConnectedComp().

◆ num_quads()

Int rectBlockArray::num_quads ( )

Definition at line 120 of file rectBlock.cc.

121{
122 Int ret=0;
123 for(Int i=0; i<n_elements; i++)
124 ret += array[i]->num_quads();
125 return ret;
126}
int ret

Referenced by num_quads(), and Slicer::slice_new().

◆ print()

void rectBlockArray::print ( )

Definition at line 174 of file rectBlock.cc.

175{
176 Int i;
177 for(i=0; i<n_elements; i++)
178 array[i]->print();
179}

Referenced by print().

Member Data Documentation

◆ array

rectBlock** rectBlockArray::array
private

Definition at line 62 of file rectBlock.h.

◆ n_elements

Int rectBlockArray::n_elements
private

Definition at line 63 of file rectBlock.h.

Referenced by draw(), get_n_elements(), insert(), num_quads(), print(), and rectBlockArray().

◆ size

Int rectBlockArray::size
private

Definition at line 64 of file rectBlock.h.

Referenced by ~rectBlockArray().


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