ReactOS 0.4.15-dev-7681-g776c3a3
vertexArray Class Reference

#include <monoTriangulation.h>

Public Member Functions

 vertexArray (Int s)
 
 vertexArray (Real vertices[][2], Int nVertices)
 
 ~vertexArray ()
 
void appendVertex (Real *ptr)
 
RealgetVertex (Int i)
 
Real ** getArray ()
 
Int getNumElements ()
 
Int findIndexAbove (Real v)
 
Int findIndexAboveGen (Real v, Int startIndex, Int EndIndex)
 
Int findIndexBelowGen (Real v, Int startIndex, Int EndIndex)
 
Int findIndexStrictBelowGen (Real v, Int startIndex, Int EndIndex)
 
Int findIndexFirstAboveEqualGen (Real v, Int startIndex, Int endIndex)
 
Int skipEqualityFromStart (Real v, Int start, Int end)
 
Int findDecreaseChainFromEnd (Int begin, Int end)
 
void print ()
 

Private Attributes

Real ** array
 
Int index
 
Int size
 

Detailed Description

Definition at line 77 of file monoTriangulation.h.

Constructor & Destructor Documentation

◆ vertexArray() [1/2]

vertexArray::vertexArray ( Int  s)

Definition at line 1131 of file monoTriangulation.cc.

1132{
1133 size = s;
1134 array = (Real**) malloc(sizeof(Real*) * s);
1135 assert(array);
1136 index = 0;
1137}
#define malloc
Definition: debug_ros.c:4
float Real
Definition: definitions.h:36
#define assert(x)
Definition: debug.h:53
GLdouble s
Definition: gl.h:2039
GLsizeiptr size
Definition: glext.h:5919
GLuint index
Definition: glext.h:6031

◆ vertexArray() [2/2]

vertexArray::vertexArray ( Real  vertices[][2],
Int  nVertices 
)

◆ ~vertexArray()

vertexArray::~vertexArray ( )

Definition at line 1139 of file monoTriangulation.cc.

1140{
1141 free(array);
1142}
#define free
Definition: debug_ros.c:5

Member Function Documentation

◆ appendVertex()

void vertexArray::appendVertex ( Real ptr)

Definition at line 1144 of file monoTriangulation.cc.

1145{
1146 Int i;
1147 if(index >= size){
1148 Real** temp = (Real**) malloc(sizeof(Real*) * (2*size +1));
1149 assert(temp);
1150 for(i=0; i<index; i++)
1151 temp[i] = array[i];
1152 free(array);
1153 array = temp;
1154 size = 2*size+1;
1155 }
1156 array[index++] = ptr;
1157}
int Int
Definition: definitions.h:37
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
static PVOID ptr
Definition: dispmode.c:27
static calc_node_t temp
Definition: rpn_ieee.c:38

Referenced by monoTriangulation(), monoTriangulationFun(), monoTriangulationFunBackend(), monoTriangulationLoop(), sampleCompBotSimple(), sampleCompTopSimple(), sampleLeftSingleTrimEdgeRegion(), sampleLeftSingleTrimEdgeRegionGen(), sampleMonoPoly(), sampleRightSingleTrimEdgeRegion(), sampleRightSingleTrimEdgeRegionGen(), and toVertexArrays().

◆ findDecreaseChainFromEnd()

Int vertexArray::findDecreaseChainFromEnd ( Int  begin,
Int  end 
)

Definition at line 1306 of file monoTriangulation.cc.

1307{
1308 Int i = end;
1309 Real prevU = array[i][0];
1310 Real thisU;
1311 for(i=end-1; i>=begin; i--){
1312 thisU = array[i][0];
1313 if(thisU < prevU)
1314 prevU = thisU;
1315 else
1316 break;
1317 }
1318 return i;
1319}
GLuint GLuint end
Definition: gl.h:1545
static clock_t begin
Definition: xmllint.c:458

Referenced by sampleRightOneGridStep().

◆ findIndexAbove()

Int vertexArray::findIndexAbove ( Real  v)

Definition at line 1175 of file monoTriangulation.cc.

1176{
1177 Int i;
1178 if(index == 0)
1179 return -1;
1180 else if(array[0][1] < v)
1181 return -1;
1182 else
1183 {
1184 for(i=1; i<index; i++)
1185 {
1186 if(array[i][1] < v)
1187 break;
1188 }
1189 return i-1;
1190 }
1191}
const GLdouble * v
Definition: gl.h:2040

◆ findIndexAboveGen()

Int vertexArray::findIndexAboveGen ( Real  v,
Int  startIndex,
Int  EndIndex 
)

Definition at line 1288 of file monoTriangulation.cc.

1289{
1290 Int i;
1291 if(startIndex > endIndex)
1292 return startIndex-1;
1293 else if(array[startIndex][1] < v)
1294 return startIndex-1;
1295 else //now array[startIndex][1] >= v
1296 {
1297 for(i=startIndex+1; i<=endIndex; i++)
1298 {
1299 if(array[i][1] < v)
1300 break;
1301 }
1302 return i-1;
1303 }
1304}

Referenced by findNeck(), sampleCompLeft(), and sampleCompRight().

◆ findIndexBelowGen()

Int vertexArray::findIndexBelowGen ( Real  v,
Int  startIndex,
Int  EndIndex 
)

Definition at line 1201 of file monoTriangulation.cc.

1202{
1203 Int i;
1204 if(startIndex > endIndex)
1205 return endIndex+1;
1206 else if(array[endIndex][1] > v)
1207 return endIndex+1;
1208 else //now array[endIndex][1] <= v
1209 {
1210 for(i=endIndex-1; i>=startIndex; i--)
1211 {
1212 if(array[i][1] > v)
1213 break;
1214 }
1215 return i+1;
1216 }
1217}

Referenced by findDownCorners(), sampleCompLeft(), and sampleCompRight().

◆ findIndexFirstAboveEqualGen()

Int vertexArray::findIndexFirstAboveEqualGen ( Real  v,
Int  startIndex,
Int  endIndex 
)

Definition at line 1253 of file monoTriangulation.cc.

1254{
1255
1256 Int i;
1257 if(startIndex > endIndex)
1258 return startIndex-1;
1259 else if(array[startIndex][1] < v)
1260 return startIndex-1;
1261 else //now array[startIndex][1] >= v
1262 {
1263
1264 for(i=startIndex; i<=endIndex; i++)
1265 {
1266 if(array[i][1] <= v)
1267 break;
1268 }
1269 if(i>endIndex) // v is strictly below all
1270 return endIndex;
1271 else if(array[i][1] == v)
1272 return i;
1273 else
1274 return i-1;
1275 }
1276
1277}

Referenced by findNeckF(), and findUpCorners().

◆ findIndexStrictBelowGen()

Int vertexArray::findIndexStrictBelowGen ( Real  v,
Int  startIndex,
Int  EndIndex 
)

Definition at line 1227 of file monoTriangulation.cc.

1228{
1229 Int i;
1230 if(startIndex > endIndex)
1231 return endIndex+1;
1232 else if(array[endIndex][1] >= v)
1233 return endIndex+1;
1234 else //now array[endIndex][1] < v
1235 {
1236 for(i=endIndex-1; i>=startIndex; i--)
1237 {
1238 if(array[i][1] >= v)
1239 break;
1240 }
1241 return i+1;
1242 }
1243}

Referenced by sampleMonoPolyRec().

◆ getArray()

◆ getNumElements()

◆ getVertex()

◆ print()

void vertexArray::print ( )

Definition at line 1159 of file monoTriangulation.cc.

1160{
1161 printf("vertex Array:index=%i, size=%i\n", index, size);
1162 for(Int i=0; i<index; i++)
1163 {
1164 printf("(%f,%f) ", array[i][0], array[i][1]);
1165 }
1166 printf("\n");
1167}
#define printf
Definition: freeldr.h:94

Referenced by findDownCorners().

◆ skipEqualityFromStart()

Int vertexArray::skipEqualityFromStart ( Real  v,
Int  start,
Int  end 
)

Definition at line 1323 of file monoTriangulation.cc.

1324{
1325 Int i;
1326 if(array[start][1] != v)
1327 return start;
1328 //now array[start][1] == v
1329 for(i=start+1; i<= end; i++)
1330 if(array[i][1] != v)
1331 break;
1332 return i-1;
1333}
GLuint start
Definition: gl.h:1545

Referenced by findDownCorners(), and findUpCorners().

Member Data Documentation

◆ array

Real** vertexArray::array
private

Definition at line 78 of file monoTriangulation.h.

Referenced by getArray().

◆ index

Int vertexArray::index
private

Definition at line 79 of file monoTriangulation.h.

Referenced by appendVertex(), findIndexAbove(), getNumElements(), and print().

◆ size

Int vertexArray::size
private

Definition at line 80 of file monoTriangulation.h.


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