44#define max(a,b) ((a>b)? a:b)
61 assert(leftCorner <= leftEnd);
62 for(
i=leftCorner;
i<= leftEnd;
i++)
66 if(ret_index_pass <= leftEnd)
68 for(
i=ret_index_pass;
i< leftEnd;
i++)
86 assert(rightCorner <= rightEnd);
87 for(
i=rightCorner;
i<= rightEnd;
i++)
95 if(ret_index_pass <= rightEnd)
97 for(
i=ret_index_pass;
i< rightEnd;
i++)
120 if(segIndexPass > rightCorner)
123 if(segIndexPass <= rightEnd)
124 tempBot = rightChain->
getVertex(segIndexPass);
140 if(segIndexPass <= rightEnd)
152 for(
i=segIndexMono;
i<=rightEnd;
i++)
153 if(rightChain->
getVertex(
i)[0] <= botVertex[0])
174 stripOfFanRight(rightChain, segIndexMono, segIndexPass, grid, gridV, midU, rightU, pStream, 1);
178 monoTriangulation2(tempTop, botVertex, rightChain, segIndexMono, rightEnd, 0, pStream);
182 stripOfFanRight(rightChain, segIndexMono, segIndexPass, grid, gridV, leftU, rightU, pStream, 1);
186 monoTriangulation2(tempTop, botVertex, rightChain, segIndexMono, rightEnd, 0, pStream);
205 if(rightEnd<rightCorner){
210 Int segIndexMono = 0, segIndexPass;
246 if(segIndexPass > leftCorner)
249 if(segIndexPass <= leftEnd)
250 tempBot = leftChain->
getVertex(segIndexPass);
261 if(segIndexPass <= leftEnd)
263 stripOfFanLeft(leftChain, segIndexMono, segIndexPass, grid, gridV, leftU, rightU, pStream, 1);
291 if(leftEnd< leftCorner){
296 Int segIndexPass, segIndexMono = 0;
307 leftU, rightU, pStream);
320 Int oldLeftI, oldRightI, newLeftI, newRightI;
326 oldLeftI = leftCorner-1;
327 oldRightI = rightCorner;
329 rightMin = rightChain->
getVertex(rightCorner)[0];
333 oldLeftI = leftCorner;
334 oldRightI = rightCorner-1;
335 leftMax = leftChain->
getVertex(leftCorner)[0];
336 rightMin = rightChain->
getVertex(rightCorner)[0] +
Real(1.0);
348 newRightI = oldRightI;
351 for(
k=
j+1;
k<= rightEnd;
k++)
367 else if(
j > rightEnd)
369 for(
k=
i+1;
k<= leftEnd;
k++)
393 for(
k=
j+1;
k<= rightEnd;
k++)
404 if(leftMax >= rightMin)
409 oldRightI = newRightI;
420 for(
k=
i+1;
k<= leftEnd;
k++)
431 if(leftMax >= rightMin)
436 oldRightI = newRightI;
442 if(oldLeftI < leftCorner || oldRightI < rightCorner)
446 ret_sep_left = oldLeftI;
447 ret_sep_right = oldRightI;
460 Int down_leftCornerWhere,
461 Int down_leftCornerIndex,
462 Int down_rightCornerWhere,
463 Int down_rightCornerIndex,
467 if(down_leftCornerWhere == 1 && down_rightCornerWhere == 1)
477 else if(down_leftCornerWhere != 0)
482 if(down_leftCornerWhere == 1){
483 tempRightEnd = rightEnd;
488 tempRightEnd = down_leftCornerIndex-1;
489 tempBot = rightChain->
getVertex(down_leftCornerIndex);
495 down_rightCornerIndex,
502 else if(down_rightCornerWhere != 2)
507 if(down_rightCornerWhere == 1){
508 tempLeftEnd = leftEnd;
513 tempLeftEnd = down_rightCornerIndex-1;
514 tempBot = leftChain->
getVertex(down_rightCornerIndex);
536 down_leftCornerWhere,
537 down_leftCornerIndex,
538 down_rightCornerWhere,
539 down_rightCornerIndex,
546 Int sep_left, sep_right;
548 rightChain, rightEnd, down_rightCornerIndex,
557 Int segLeftMono, segLeftPass, segRightMono, segRightPass;
560 down_leftCornerIndex,
566 down_rightCornerIndex,
588 down_leftCornerIndex,
599 down_rightCornerIndex,
607 tempTop[1] = leftGridChain->
get_v_value(gridIndex);
609 leftChain, segLeftMono, leftEnd,
610 rightChain, segRightMono, rightEnd,
616 Int segLeftMono, segLeftPass;
619 down_leftCornerIndex,
623 assert(segLeftPass <= sep_left);
627 down_leftCornerIndex,
653 leftChain, segLeftMono, leftEnd,
654 rightChain, down_rightCornerIndex, rightEnd,
659 Int segRightMono, segRightPass;
665 assert(segRightPass <= sep_right);
669 down_rightCornerIndex,
684 leftChain, down_leftCornerIndex, leftEnd,
685 rightChain, segRightMono, rightEnd,
699 down_leftCornerWhere,
700 down_leftCornerIndex,
701 down_rightCornerWhere,
702 down_rightCornerIndex,
718 down_leftCornerWhere,
719 down_leftCornerIndex,
720 down_rightCornerWhere,
721 down_rightCornerIndex,
737 Int down_leftCornerWhere,
738 Int down_leftCornerIndex,
739 Int down_rightCornerWhere,
740 Int down_rightCornerIndex,
747 Int ActualLeftStart, ActualLeftEnd;
748 Int ActualRightStart, ActualRightEnd;
758 for(
k=0,
i=gridRightU;
i>= gridLeftU;
i--,
k++)
764 if(down_rightCornerWhere != 0)
765 ActualLeftEnd = leftEnd;
767 ActualLeftEnd = down_rightCornerIndex-1;
769 if(down_leftCornerWhere != 0)
770 ActualLeftStart = leftEnd+1;
772 ActualLeftStart = down_leftCornerIndex;
774 vertexArray ActualLeftChain(
max(0, ActualLeftEnd - ActualLeftStart +1) + gridRightU - gridLeftU +1);
776 for(
i=0;
i<gridRightU - gridLeftU +1 ;
i++)
778 for(
i=ActualLeftStart;
i<= ActualLeftEnd;
i++)
782 if(down_rightCornerWhere != 2)
783 ActualRightStart = rightEnd +1;
785 ActualRightStart = down_rightCornerIndex;
788 if(down_leftCornerWhere != 2)
791 ActualRightEnd = rightEnd;
795 ActualRightEnd = down_leftCornerIndex-1;
800 if(down_rightCornerWhere == 2)
802 if(down_leftCornerWhere == 2)
803 ActualBot = rightChain->
getVertex(down_leftCornerIndex);
805 ActualBot = botVertex;
807 else if(down_rightCornerWhere == 1)
808 ActualBot = botVertex;
810 ActualBot = leftChain->
getVertex(down_rightCornerIndex);
812 ActualTop = gridPoints[0];
820 if(rightChain->
getVertex(ActualRightStart)[1] == ActualTop[1])
void outputFanWithPoint(Int v, Int uleft, Int uright, Real vert[2], primStream *pStream)
void appendVertex(Real *ptr)
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
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 * u
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
void monoTriangulationRecGen(Real *topVertex, Real *botVertex, vertexArray *inc_chain, Int inc_current, Int inc_end, vertexArray *dec_chain, Int dec_current, Int dec_end, primStream *pStream)
void monoTriangulation2(Real *topVertex, Real *botVertex, vertexArray *inc_chain, Int inc_smallIndex, Int inc_largeIndex, Int is_increase_chain, primStream *pStream)
void monoTriangulationRecGenOpt(Real *topVertex, Real *botVertex, vertexArray *inc_chain, Int inc_current, Int inc_end, vertexArray *dec_chain, Int dec_current, Int dec_end, primStream *pStream)
void sampleCompBot(Real *botVertex, vertexArray *leftChain, Int leftEnd, vertexArray *rightChain, Int rightEnd, gridBoundaryChain *leftGridChain, gridBoundaryChain *rightGridChain, Int gridIndex, Int down_leftCornerWhere, Int down_leftCornerIndex, Int down_rightCornerWhere, Int down_rightCornerIndex, primStream *pStream)
void sampleBotRightWithGridLine(Real *botVertex, vertexArray *rightChain, Int rightEnd, Int rightCorner, gridWrap *grid, Int gridV, Int leftU, Int rightU, primStream *pStream)
void findBotLeftSegment(vertexArray *leftChain, Int leftEnd, Int leftCorner, Real u, Int &ret_index_mono, Int &ret_index_pass)
Int findBotSeparator(vertexArray *leftChain, Int leftEnd, Int leftCorner, vertexArray *rightChain, Int rightEnd, Int rightCorner, Int &ret_sep_left, Int &ret_sep_right)
void sampleBotRightWithGridLinePost(Real *botVertex, vertexArray *rightChain, Int rightEnd, Int segIndexMono, Int segIndexPass, Int rightCorner, gridWrap *grid, Int gridV, Int leftU, Int rightU, primStream *pStream)
void sampleBotLeftWithGridLine(Real *botVertex, vertexArray *leftChain, Int leftEnd, Int leftCorner, gridWrap *grid, Int gridV, Int leftU, Int rightU, primStream *pStream)
void sampleCompBotSimple(Real *botVertex, vertexArray *leftChain, Int leftEnd, vertexArray *rightChain, Int rightEnd, gridBoundaryChain *leftGridChain, gridBoundaryChain *rightGridChain, Int gridIndex, Int down_leftCornerWhere, Int down_leftCornerIndex, Int down_rightCornerWhere, Int down_rightCornerIndex, primStream *pStream)
void sampleBotLeftWithGridLinePost(Real *botVertex, vertexArray *leftChain, Int leftEnd, Int segIndexMono, Int segIndexPass, Int leftCorner, gridWrap *grid, Int gridV, Int leftU, Int rightU, primStream *pStream)
void findBotRightSegment(vertexArray *rightChain, Int rightEnd, Int rightCorner, Real u, Int &ret_index_mono, Int &ret_index_pass)
void stripOfFanRight(vertexArray *rightChain, Int largeIndex, Int smallIndex, gridWrap *grid, Int vlineIndex, Int ulineSmallIndex, Int ulineLargeIndex, primStream *pStream, Int gridLineUp)
void stripOfFanLeft(vertexArray *leftChain, Int largeIndex, Int smallIndex, gridWrap *grid, Int vlineIndex, Int ulineSmallIndex, Int ulineLargeIndex, primStream *pStream, Int gridLineUp)