55 if(
begin->head()[0] ==
end->tail()[0] &&
116 if(
fabs(
a[0]-
b[0]) < 0.00001 &&
117 fabs(
a[1]-
b[1]) < 0.00001)
127 if(this->
next ==
this)
168 tempNext =
temp->getNext();
188 tempNext =
temp->nextPolygon;
192 ret = retEnd =
temp->deleteDegenerateLines();
198 if(newPolygon !=
NULL)
218 tempNext =
temp->nextPolygon;
246 tempNext =
temp->next;
257 tempNext =
temp->nextPolygon;
258 temp->deleteSinglePolygonWithSline();
268 tempNext =
temp->next;
278 tempNext =
temp->nextPolygon;
279 temp->deleteSinglePolygon();
350 if(
next ==
this)
return 1;
401 if(
A[1] <
B[1])
return -1;
402 if(
A[1] ==
B[1] &&
A[0] <
B[0])
return -1;
403 if(
A[1] ==
B[1] &&
A[0] ==
B[0])
return 0;
409 if(
A[0] <
B[0])
return -1;
410 if(
A[0] ==
B[0] &&
A[1] <
B[1])
return -1;
411 if(
A[0] ==
B[0] &&
A[1] ==
B[1])
return 0;
425 if(
head()[1] < nl->
head()[1])
return -1;
440 if(
head()[0] < nl->
head()[0])
return -1;
449 return v1->compInY(
v2);
454 return v1->compInX(
v2);
463 Int total_num_edges = 0;
473 printf(
"direction is INCREASING\n");
475 printf(
"direction is DECREASING\n");
505 if(oldList ==
NULL)
return this;
518 if(
p ==
NULL)
return this;
533 if(prev_polygon ==
NULL)
591 y1 = this->
head()[1];
599 x2 =
temp->next->head()[0];
600 y2 =
temp->next->head()[1];
659 v2Prev ->
next = newLineDec;
661 newLineDec->
prev = v2Prev;
664 v1Prev ->
next = newLineInc;
666 newLineInc->
prev = v1Prev;
668 *ret_p1 = newLineDec;
669 *ret_p2 = newLineInc;
670 *generatedLine = nsline;
697 v2Prev ->
next = newLineDec;
699 newLineDec->
prev = v2Prev;
702 v1Prev ->
next = newLineInc;
704 newLineInc->
prev = v1Prev;
706 *ret_p1 = newLineDec;
707 *ret_p2 = newLineInc;
713 if(
v1 ==
v2)
return 1;
737 while(tempLink !=
NULL){
762 fprintf(fp,
"%i\n", nPolygons);
767 npoints =
root->get_npoints()-1;
769 npoints +=
temp->get_npoints()-1;
804 for(
i=0;
i<nPolygons;
i++)
809 Real vert[2][2] = { { 0 } };
820 VV[1][0] = vert[0][0];
821 VV[1][1] = vert[0][1];
827 for(
j=2;
j<nEdges;
j++)
829 vert[0][0]=vert[1][0];
830 vert[0][1]=vert[1][1];
directedLine * cutoffPolygon(directedLine *p)
void rootLinkSet(directedLine *r)
directedLine * deleteChain(directedLine *begin, directedLine *end)
directedLine * deleteDegenerateLines()
void deleteSinglePolygon()
directedLine ** sortAllPolygons()
void writeAllPolygons(char *filename)
directedLine * nextPolygon
void connectDiagonal(directedLine *v1, directedLine *v2, directedLine **ret_p1, directedLine **ret_p2, sampledLine **generatedLine, directedLine *list)
directedLine * cutIntersectionAllPoly(int &cutOccur)
directedLine * insertPolygon(directedLine *newpolygon)
directedLine * findRoot()
void deleteSingleLine(directedLine *dline)
void deleteSinglePolygonWithSline()
Int compInX(directedLine *nl)
directedLine * rootLinkFindRoot()
Int samePolygon(directedLine *v1, directedLine *v2)
Int compInY(directedLine *nl)
void connectDiagonal_2slines(directedLine *v1, directedLine *v2, directedLine **ret_p1, directedLine **ret_p2, directedLine *list)
directedLine ** toArrayAllPolygons(Int &total_num_edges)
void init(short dir, sampledLine *sl)
directedLine * deleteDegenerateLinesAllPolygons()
void insert(directedLine *nl)
void deletePolygonListWithSline()
Int toArraySinglePolygon(directedLine **array, Int index)
Int numEdgesAllPolygons()
void setPoint(Int i, Real p[2])
Int compV2InY(Real A[2], Real B[2])
static Int myequal(Real a[2], Real b[2])
directedLine * readAllPolygons(char *filename)
static Int compInY2(directedLine *v1, directedLine *v2)
Int compV2InX(Real A[2], Real B[2])
GLboolean GLboolean GLboolean b
GLboolean GLboolean GLboolean GLboolean a
GLfloat GLfloat GLfloat v2
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 const GLfloat const GLdouble const GLfloat GLint GLint GLint j
_Check_return_ _CRT_JIT_INTRINSIC double __cdecl fabs(_In_ double x)
_Check_return_ _CRTIMP int __cdecl fscanf(_Inout_ FILE *_File, _In_z_ _Scanf_format_string_ const char *_Format,...)
_Check_return_opt_ _CRTIMP int __cdecl fprintf(_Inout_ FILE *_File, _In_z_ _Printf_format_string_ const char *_Format,...)
_Check_return_ _CRTIMP FILE *__cdecl fopen(_In_z_ const char *_Filename, _In_z_ const char *_Mode)
_Check_return_opt_ _CRTIMP int __cdecl fclose(_Inout_ FILE *_File)
directedLine * DBG_cutIntersectionPoly(directedLine *polygon, int &cutOccur)
void quicksort(void *v[], int left, int right, int(*comp)(void *, void *))
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG _In_ LONG _In_ LONG x2
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG _In_ LONG y1
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG x1
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG _In_ LONG _In_ LONG _In_ LONG y2